a00b35fcff10d257c9e0d2568650e295807e5948
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / cat / vandelay / import.component.html
1 <div class="row mb-3" *ngIf="importSelection()">
2   <div class="col-lg-2" *ngIf="selectedQueue">
3     <button class="btn btn-info label-with-material-icon"
4       routerLink="/staff/cat/vandelay/queue/{{recordType}}/{{selectedQueue.id}}">
5       <span class="material-icons">arrow_back</span>
6       <span i18n>Return to Queue</span>
7     </button>
8   </div>
9 </div>
10
11 <h2 i18n>MARC File Upload</h2>
12 <div class="common-form striped-odd form-validated ml-3 mr-3">
13   <div class="row">
14     <div class="col-lg-3">
15       <label for="template-select" i18n>Apply/Create Form Template</label>
16     </div>
17     <div class="col-lg-3">
18       <eg-combobox #formTemplateSelector
19         id="template-select"
20         (onChange)="templateSelectorChange($event)"
21         [allowFreeText]="true"
22         [startId]="selectedTemplate"
23         [startIdFiresOnChange]="true"
24         [entries]="formatTemplateEntries()"
25         placeholder="Apply or Create Form Template..." i18n-placeholder>
26       </eg-combobox>
27     </div>
28     <div class="col-lg-6">
29       <button class="btn btn-success"
30         [disabled]="!selectedTemplate"
31         (click)="saveTemplate()" i18n>Save As New Template</button>
32       <button class="btn btn-outline-primary ml-3"
33         [disabled]="!selectedTemplate"
34         (click)="markTemplateDefault()" i18n>Mark Template as Default</button>
35       <button class="btn btn-danger ml-3"
36         [disabled]="!selectedTemplate"
37         (click)="deleteTemplate()" i18n>Delete Template</button>
38     </div>
39   </div>
40
41   <div class="row">
42     <div class="col-lg-3">
43       <label for="type-select" i18n>Record Type</label>
44     </div>
45     <div class="col-lg-3">
46       <eg-combobox #recordTypeSelector
47         id="type-select"
48         (onChange)="selectEntry($event, 'recordType')"
49         [disabled]="importSelection()" [required]="true"
50         [startId]="recordType" placeholder="Record Type..." i18n-placeholder>
51         <eg-combobox-entry entryId="bib" entryLabel="Bibliographic Records" 
52           i18n-entryLabel></eg-combobox-entry>
53         <eg-combobox-entry entryId="authority" entryLabel="Authority Records" 
54           i18n-entryLabel></eg-combobox-entry>
55         <eg-combobox-entry entryId="bib-acq" entryLabel="Acquisitions Records" 
56           i18n-entryLabel></eg-combobox-entry>
57       </eg-combobox>
58     </div>
59     <div class="col-lg-3">
60       <label for="source-select" i18n>Select a Record Source</label>
61     </div>
62     <div class="col-lg-3">
63       <eg-combobox #bibSourceSelector
64         id="source-select"
65         [entries]="formatEntries('bibSources')" 
66         (onChange)="selectEntry($event, 'bibSources')"
67         [startId]="selectedBibSource"
68         placeholder="Record Source..." i18n-placeholder>
69       </eg-combobox>
70     </div>
71   </div>
72   <div class="row">
73     <div class="col-lg-3">
74       <label for="queue-select" i18n>Select or Create a Queue</label>
75     </div>
76     <div class="col-lg-3">
77       <eg-combobox [entries]="formatEntries('allQueues')"
78         id="queue-select"
79         [startId]="startQueueId"
80         [startIdFiresOnChange]="true"
81         [disabled]="startQueueId"
82         (onChange)="selectedQueue=$event" i18n-placeholder
83         [required]="true"
84         [allowFreeText]="true" placeholder="Select or Create a Queue...">
85       </eg-combobox>
86     </div>
87     <div class="col-lg-3">
88       <label for="bucket-select" i18n>Limit Matches to Bucket</label>
89     </div>
90     <div class="col-lg-3">
91       <eg-combobox [entries]="formatEntries('bibBuckets')" 
92         id="bucket-select"
93         [startId]="selectedBucket"
94         [disabled]="(selectedQueue && !selectedQueue.freetext) || importSelection()"
95         (onChange)="selectEntry($event, 'bibBuckets')"
96         placeholder="Buckets..." i18n-placeholder></eg-combobox>
97     </div>
98   </div>
99   <div class="row">
100     <div class="col-lg-3">
101       <label for="match-set-select" i18n>Record Match Set</label>
102     </div>
103     <div class="col-lg-3">
104       <eg-combobox #matchSetSelector
105         id="match-set-select"
106         [entries]="formatEntries('matchSets')" 
107         [disabled]="(selectedQueue && !selectedQueue.freetext) || importSelection()"
108         [startId]="selectedMatchSet || defaultMatchSet"
109         (onChange)="selectEntry($event, 'matchSets')"
110         placeholder="Match Set..." i18n-placeholder></eg-combobox>
111     </div>
112     <div class="col-lg-3">
113         <label for="import-non-matching" i18n>Import Non-Matching Records</label>
114     </div>
115     <div class="col-lg-3">
116       <input class="form-check-input" type="checkbox" 
117         id="import-non-matching"
118         [(ngModel)]="importNonMatching">
119     </div>
120  </div>
121   <div class="row">
122     <div class="col-lg-3">
123       <label for="item-import-def" i18n>Holdings Import Profile</label>
124     </div>
125     <div class="col-lg-3"> <!-- TODO disable for authority -->
126       <eg-combobox #holdingsProfileSelector
127         id="item-import-def"
128         [entries]="formatEntries('importItemDefs')"
129         [startId]="selectedHoldingsProfile"
130         [disabled]="(selectedQueue && !selectedQueue.freetext) || importSelection()"
131         (onChange)="selectEntry($event, 'importItemDefs')"
132         placeholder="Holdings Import Profile..." i18n-placeholder>
133       </eg-combobox>
134     </div>
135     <div class="col-lg-3">
136         <label for="merge-on-exact" i18n>Merge On Exact Match (901c)</label>
137     </div>
138     <div class="col-lg-3">
139       <input class="form-check-input" type="checkbox" 
140         id="merge-on-exact" [(ngModel)]="mergeOnExact">
141     </div>
142   </div>
143   <div class="row">
144     <div class="col-lg-3">
145       <label for="merge-profiles" i18n>Merge Profile</label>
146     </div>
147     <div class="col-lg-3">
148       <eg-combobox #mergeProfileSelector
149         id="merge-profiles"
150         [entries]="formatEntries('mergeProfiles')"
151         (onChange)="selectEntry($event, 'mergeProfiles')"
152         placeholder="Merge Profile..." i18n-placeholder>
153       </eg-combobox>
154     </div>
155     <div class="col-lg-3">
156         <label for="merge-on-single" i18n>Merge On Single Match</label>
157     </div>
158     <div class="col-lg-3">
159       <input class="form-check-input" type="checkbox" 
160         id="merge-on-single" [(ngModel)]="mergeOnSingleMatch">
161     </div>
162   </div>
163   <div class="row">
164     <div class="col-lg-3">
165       <label for="insuff-merge-profiles" i18n>
166         Insufficient Quality Fall-Through Profile
167     </label>
168     </div>
169     <div class="col-lg-3">
170       <eg-combobox #fallThruMergeProfileSelector
171         id="insuff-merge-profiles"
172         [entries]="formatEntries('mergeProfiles')"
173         (onChange)="selectEntry($event, 'FallThruMergeProfile')"
174         placeholder="Fall-Through Merge Profile..." i18n-placeholder>
175       </eg-combobox>
176     </div>
177     <div class="col-lg-3">
178       <label for="merge-on-best" i18n>Merge On Best Match</label>
179     </div>
180     <div class="col-lg-3">
181       <input class="form-check-input" type="checkbox" 
182         id="merge-on-best" [(ngModel)]="mergeOnBestMatch">
183     </div>
184   </div>
185   <div class="row">
186     <div class="col-lg-3">
187       <label for="min-quality-ratio" i18n>
188         Best/Single Match Minimum Quality Ratio
189       </label>
190     </div>
191     <div class="col-lg-3">
192       <input type="number" step="0.1" id="min-quality-ratio" 
193         class="form-control" [(ngModel)]="minQualityRatio">
194     </div>
195     <div class="col-lg-3">
196       <label for="auto-overlay-acq-copies" i18n>
197         Auto-overlay In-process Acquisitions Copies
198       </label>
199     </div>
200     <div class="col-lg-3">
201       <input id="form-check-input" type="checkbox" 
202         name="auto-overlay-acq-copies"
203         [disabled]="recordType == 'authority'"
204         [(ngModel)]="autoOverlayAcqCopies">
205     </div>
206   </div>
207   <div class="row">
208     <div class="col-lg-3">
209       <label for="session-name" i18n>Optional Session Name:</label>
210     </div>
211     <div class="col-lg-3">
212       <input [(ngModel)]="sessionName" class="form-control" type="text"
213         name="session-name" i18n-placeholder placeholder="Session Name..."/>
214     </div>
215     <div class="col-lg-3">
216       <label for="marc-remove-groups" i18n>Remove MARC Field Groups</label>
217     </div>
218     <ng-container *ngIf="recordType != 'authority'">
219       <div class="col-lg-3" *ngIf="bibTrashGroups.length == 0">
220         <span i18n class="font-italic">No Groups Configured</span>
221       </div>
222       <div class="col-lg-3" *ngIf="bibTrashGroups.length">
223         <select multiple [(ngModel)]="selectedTrashGroups" 
224           id="marc-remove-groups" class="form-control" size="3">
225           <option *ngFor="let grp of bibTrashGroups" 
226             value="{{grp.id()}}">{{grp.label()}}</option>
227         </select>
228       </div>
229     </ng-container>
230   </div>
231   <div class="row" *ngIf="!importSelection()">
232     <div class="col-lg-3">
233       <label for="upload-file" i18n>File to Upload:</label>
234     </div>
235     <div class="col-lg-3">
236       <input #fileSelector (change)="fileSelected($event)" 
237         id="upload-file" required class="form-control" type="file"/>
238     </div>
239   </div>
240   <div class="row" *ngIf="importSelection()">
241     <div class="col-lg-3">
242       <label>Import Selected</label>
243     </div>
244     <div class="col-lg-3">
245       <span *ngIf="!importSelection().importQueue" i18n>
246         Importing {{importSelection().recordIds.length}} Record(s)</span>
247       <span *ngIf="importSelection().importQueue" i18n>
248         Importing Queue {{importSelection().queue.name()}}</span>
249     </div>
250     <div class="col-lg-3">
251       <button class="btn btn-outline-info ml-2" (click)="clearSelection()" i18n>
252         Clear Selection
253       </button>
254     </div>
255   </div>
256   <div class="row">
257     <div class="col-lg-6 offset-lg-3">
258       <button class="btn btn-success btn-lg btn-block font-weight-bold"
259         [disabled]="isUploading || !hasNeededData()" 
260         (click)="upload()" i18n>Upload</button>
261     </div>
262   </div>
263   <!-- hide instead of *ngIf so ViewChild can find the progress bars -->
264   <div class="row" [hidden]="!showProgress || importSelection()">
265     <div class="col-lg-3">
266       <label i18n>Upload Progress</label>
267     </div>
268     <div class="col-lg-6">
269       <eg-progress-inline #uploadProgress></eg-progress-inline>
270     </div>
271   </div>
272   <div class="row" [hidden]="!showProgress || importSelection()">
273     <div class="col-lg-3">
274       <label i18n>Enqueue Progress</label>
275     </div>
276     <div class="col-lg-6">
277       <eg-progress-inline #enqueueProgress></eg-progress-inline>
278     </div>
279   </div>
280   <div class="row" [hidden]="!showProgress">
281     <div class="col-lg-3">
282       <label i18n>Import Progress</label>
283     </div>
284     <div class="col-lg-6">
285       <eg-progress-inline #importProgress></eg-progress-inline>
286     </div>
287   </div>
288   <div class="row" [hidden]="!uploadComplete">
289     <div class="col-lg-6 offset-lg-3">
290       <button class="btn btn-info btn-lg btn-block font-weight-bold"
291         routerLink="/staff/cat/vandelay/queue/{{recordType}}/{{activeQueueId}}"
292         i18n>Go To Queue</button>
293     </div>
294   </div>
295 </div>
296
297