Skip to content

Commit 11f2022

Browse files
authored
Merge pull request #152 from esune/em-940
EM-940: EAO main documents not displaying in MMTI.
2 parents 5f0f225 + feafaf5 commit 11f2022

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ module.exports = function(config) {
3939
port: 9876,
4040
colors: true,
4141
logLevel: config.LOG_INFO,
42-
autoWatch: true,
43-
browsers: ['Chrome'],
44-
singleRun: false,
42+
autoWatch: false,
43+
browsers: ['ChromeHeadless'],
44+
singleRun: true,
4545
concurrency: Infinity
4646
});
4747
};

src/app/models/collection.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,16 @@ export class Collection {
7171

7272
// Set documents
7373
this.documents = [];
74-
if (collection.mainDocuments && collection.mainDocuments.length > 0) {
74+
75+
if (this.agency === 'eao' && collection.mainDocument) {
76+
// EAO main documents are still returned as a single element
77+
this.documents.push({
78+
name : collection.mainDocument.document.displayName,
79+
ref : this.getURL(collection.mainDocument.document._id),
80+
date : collection.mainDocument.document.documentDate ? new Date(collection.mainDocument.document.documentDate) : null
81+
});
82+
} else if (collection.mainDocuments && collection.mainDocuments.length > 0) {
83+
// MEM main documents come in an array
7584
const mainDocs = collection.mainDocuments.filter((doc) => {
7685
return doc.document && doc.document.isPublished;
7786
}).sort((a, b) => { return a.sortOrder - b.sortOrder; });

0 commit comments

Comments
 (0)