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