Skip to content

Commit

Permalink
Merge pull request #152 from esune/em-940
Browse files Browse the repository at this point in the history
EM-940: EAO main documents not displaying in MMTI.
  • Loading branch information
NickPhura authored May 11, 2018
2 parents 5f0f225 + feafaf5 commit 11f2022
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ module.exports = function(config) {
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
autoWatch: false,
browsers: ['ChromeHeadless'],
singleRun: true,
concurrency: Infinity
});
};
11 changes: 10 additions & 1 deletion src/app/models/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ export class Collection {

// Set documents
this.documents = [];
if (collection.mainDocuments && collection.mainDocuments.length > 0) {

if (this.agency === 'eao' && collection.mainDocument) {
// EAO main documents are still returned as a single element
this.documents.push({
name : collection.mainDocument.document.displayName,
ref : this.getURL(collection.mainDocument.document._id),
date : collection.mainDocument.document.documentDate ? new Date(collection.mainDocument.document.documentDate) : null
});
} else if (collection.mainDocuments && collection.mainDocuments.length > 0) {
// MEM main documents come in an array
const mainDocs = collection.mainDocuments.filter((doc) => {
return doc.document && doc.document.isPublished;
}).sort((a, b) => { return a.sortOrder - b.sortOrder; });
Expand Down

0 comments on commit 11f2022

Please sign in to comment.