1 import {Component, OnInit, ViewChild, Output, Input} from '@angular/core';
2 import {IdlObject, IdlService} from '@eg/core/idl.service';
3 import {PcrudService} from '@eg/core/pcrud.service';
4 import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
6 // Can be used to create match_set_point's and match_set_quality's
7 export class MatchSetPointValues {
20 selector: 'eg-match-set-new-point',
21 templateUrl: 'match-set-new-point.component.html'
23 export class MatchSetNewPointComponent implements OnInit {
25 public values: MatchSetPointValues;
27 bibAttrDefs: IdlObject[];
28 bibAttrDefEntries: ComboboxEntry[];
30 // defining a new match_set_quality
31 @Input() isForQuality: boolean;
33 // biblio, authority, quality
34 @Input() set pointType(type_: string) {
35 this.values.pointType = type_;
36 this.values.recordAttr = '';
37 this.values.matchScore = 1;
38 this.values.negate = false;
39 this.values.marcTag = '';
40 this.values.marcSf = '';
41 this.values.boolOp = 'AND';
42 this.values.value = '';
46 private idl: IdlService,
47 private pcrud: PcrudService
49 this.values = new MatchSetPointValues();
50 this.bibAttrDefs = [];
51 this.bibAttrDefEntries = [];
55 this.pcrud.retrieveAll('crad', {order_by: {crad: 'label'}})
57 this.bibAttrDefs.push(attr);
58 this.bibAttrDefEntries.push({id: attr.name(), label: attr.label()});
62 setNewPointType(type_: string) {