--- /dev/null
+
+
+.import-form {
+ margin-right: 10px;
+ margin-left: 10px;
+ font-size: 95%;
+}
+
+.import-form .row {
+ margin: 5px;
+ padding: 3px;
+}
+
+.import-form .row:nth-child(even) {
+ background-color: rgba(0,0,0,.03);
+ border-bottom: 1px solid rgba(0,0,0,.125);
+}
+
+.import-form label {
+ font-weight: bold;
+}
+
+.import-form input[type="checkbox"] {
+ /* BS adds a negative left margin */
+ margin-left: 0px;
+}
</eg-typeahead>
</div>
</div>
-</div>
+ <div class="row">
+ <div class="col-lg-3">
+ <label i18n>Merge Profile</label>
+ </div>
+ <div class="col-lg-3">
+ <eg-typeahead [entries]="formatEntries('mergeProfiles')"
+ placeholder="Merge Profile..." i18n-placeholder>
+ </eg-typeahead>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-lg-3"><label i18n>Import Non-Matching Records</label></div>
+ <div class="col-lg-3">
+ <input class="form-check-input" type="checkbox"
+ [(ngModel)]="importNonMatching">
+ </div>
+ <div class="col-lg-3"><label i18n>Merge On Single Match</label></div>
+ <div class="col-lg-3">
+ <input class="form-check-input" type="checkbox"
+ [(ngModel)]="mergeOnSingleMatch">
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-lg-3"><label i18n>Merge On Exact Match (901c)</label></div>
+ <div class="col-lg-3">
+ <input class="form-check-input" type="checkbox"
+ [(ngModel)]="mergeOnExact">
+ </div>
+ <div class="col-lg-3"><label i18n>Merge On Best Match</label></div>
+ <div class="col-lg-3">
+ <input class="form-check-input" type="checkbox"
+ [(ngModel)]="mergeOnBestMatch">
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-lg-3">
+ <label i18n>Best/Single Match Minimum Quality Ratio</label></div>
+ <div class="col-lg-3">
+ <input type="number" step="0.1"
+ class="form-control" [(ngModel)]="minQualityRatio">
+ </div>
+ <div class="col-lg-3">
+ <label i18n>Insufficient Quality Fall-Through Profile</label></div>
+ <div class="col-lg-3">
+ <eg-typeahead [entries]="formatEntries('mergeProfiles')"
+ placeholder="Merge Profile..." i18n-placeholder>
+ </eg-typeahead>
+ </div>
+ </div>
+</div>
itemImportAttrDefs: IdlObject[];
matchSets: {[stype: string]: IdlObject[]};
defaultMatchSet: string;
+ mergeProfiles: IdlObject[];
matchSetEntries: TypeaheadEntry[];
importItemDefEntries: TypeaheadEntry[];
+ importNonMatching: boolean;
+ mergeOnExact: boolean;
+ mergeOnSingleMatch: boolean;
+ mergeOnBestMatch: boolean;
+ minQualityRatio: number;
+
@ViewChild('progressDialog')
private progressDialog: ProgressDialogComponent;
this.attrDefs = {};
this.matchSets = {};
this.activeQueues = {};
+ this.minQualityRatio = 0;
}
ngOnInit() {}
.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')
return (this.itemImportAttrDefs || []).map(d => {
return {id: d.id(), label: d.name()};
});
+
+ case 'mergeProfiles':
+ return (this.mergeProfiles || []).map(d => {
+ return {id: d.id(), label: d.name()};
+ });
}
}
}
matchSets: {[stype: string]: IdlObject[]};
importItemAttrDefs: IdlObject[];
bibTrashGroups: IdlObject[];
+ mergeProfiles: IdlObject[];
constructor(
private idl: IdlService,
});
}
+ getMergeProfiles(): Promise<IdlObject[]> {
+ if (this.mergeProfiles) {
+ return Promise.resolve(this.mergeProfiles);
+ }
+
+ const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
+ return this.pcrud.search('vmp',
+ {owner: owners}, {order_by: {vmp: ['name']}}, {atomic: true})
+ .toPromise().then(profiles => {
+ this.mergeProfiles = profiles;
+ return profiles;
+ });
+ }
+
// Returns a promise resolved with the list of queues.
// Also emits the onQueueListUpdate event so listeners
// can detect queue content changes.