recordType: string;
newQueueName: string;
- allQueues: {[qtype: string]: IdlObject[]};
- activeQueues: {[qtype: string]: IdlObject[]};
attrDefs: {[atype: string]: IdlObject[]};
- bibSources: IdlObject[];
- bibBuckets: IdlObject[];
- itemImportAttrDefs: IdlObject[];
- matchSets: {[stype: string]: IdlObject[]};
defaultMatchSet: string;
- mergeProfiles: IdlObject[];
-
- matchSetEntries: TypeaheadEntry[];
- importItemDefEntries: TypeaheadEntry[];
importNonMatching: boolean;
mergeOnExact: boolean;
) {
this.recordType = 'bib';
this.attrDefs = {};
- this.matchSets = {};
- this.activeQueues = {};
this.minQualityRatio = 0;
}
.then(defs => this.attrDefs.bib = defs),
this.vandelay.getAttrDefs('auth')
.then(defs => this.attrDefs.auth = defs),
- this.vandelay.getMergeProfiles()
- .then(profiles => this.mergeProfiles = profiles),
- this.vandelay.getActiveQueues('bib')
- .then(queues => this.activeQueues.bib = queues),
- this.vandelay.getActiveQueues('auth')
- .then(queues => this.activeQueues.auth = queues),
- this.vandelay.getMatchSets('bib')
- .then(sets => this.matchSets.bib = sets),
- this.vandelay.getMatchSets('auth')
- .then(sets => this.matchSets.auth= sets),
- this.vandelay.getBibBuckets()
- .then(bkts => this.bibBuckets = bkts),
- this.vandelay.getBibSources()
- .then(srcs => this.bibSources = srcs),
- this.vandelay.getItemImportDefs()
- .then(defs => this.itemImportAttrDefs = defs),
+ this.vandelay.getMergeProfiles(),
+ this.vandelay.getActiveQueues('bib'),
+ this.vandelay.getActiveQueues('auth'),
+ this.vandelay.getMatchSets('bib'),
+ this.vandelay.getMatchSets('auth'),
+ this.vandelay.getBibBuckets(),
+ this.vandelay.getBibSources(),
+ this.vandelay.getItemImportDefs(),
this.org.settings(['vandelay.default_match_set']).then(
s => this.defaultMatchSet = s['vandelay.default_match_set'])
];
// Format typeahead data sets
formatEntries(etype: string): TypeaheadEntry[] {
const rtype = this.recordType;
+ let list;
switch (etype) {
case 'bibSources':
- return (this.bibSources || []).map(s => {
- return {id: s.id(), label: s.source()};
- });
+ return (this.vandelay.bibSources || []).map(
+ s => { return {id: s.id(), label: s.source()}; });
+
+ case 'bibBuckets':
+ list = this.vandelay.bibBuckets;
+ break;
case 'activeQueues':
- return (this.activeQueues[rtype] || []).map(q => {
- return {id: q.id(), label: q.name()};
- });
+ list = this.vandelay.activeQueues[rtype];
+ break;
case 'matchSets':
- return (this.matchSets[rtype] || []).map(s => {
- return {id: s.id(), label: s.name()};
- });
+ list = this.vandelay.matchSets[rtype];
+ break;
case 'importItemDefs':
- return (this.itemImportAttrDefs || []).map(d => {
- return {id: d.id(), label: d.name()};
- });
+ list = this.vandelay.importItemAttrDefs;
+ break;
case 'mergeProfiles':
- return (this.mergeProfiles || []).map(d => {
- return {id: d.id(), label: d.name()};
- });
+ list = this.vandelay.mergeProfiles;
+ break;
}
+
+ return (list || []).map(item => {
+ return {id: item.id(), label: item.name()};
+ });
}
}