]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
LP#1858138: remove remaining uses of showLinkSelector
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / sandbox / sandbox.component.html
1
2 <eg-staff-banner bannerText="Sandbox" i18n-bannerText>
3 </eg-staff-banner>
4
5 <eg-title 
6   i18n-prefix i18n-suffix
7   prefix=":) {{dynamicTitleText}}"
8   suffix="Sandbox">
9 </eg-title>
10 <eg-help-popover [placement]="'right'" helpText="This page is for random ng stuff!"></eg-help-popover>
11 <div class="row flex pt-2">
12   <div i18n> Modify Page Title: </div>
13   <div class="col-lg-2">
14     <input type="text" [(ngModel)]="dynamicTitleText" class="form-control"/>
15   </div>
16 </div>
17
18 <!-- FM Editor Experiments ----------------------------- -->
19 <div class="row mb-3">
20   <ng-template #descriptionTemplate 
21       let-field="field" let-record="record" let-hello="hello">
22   <!-- example custom template for editing the 'description' field -->
23     <textarea
24       placeholder="{{hello}}"
25       class="form-control"
26       name="{{field.name}}"
27       [readonly]="field.readOnly"
28       [required]="field.isRequired()"
29       [ngModel]="record[field.name]()"
30       (ngModelChange)="record[field.name]($event)">
31     </textarea>
32   </ng-template>
33   <!-- note: fieldOptions would be best defined in the .ts file, but
34       want to demostrate it can be set in the template as well -->
35   <eg-fm-record-editor #fmRecordEditor 
36     idlClass="cmrcfld" mode="create" hiddenFields="id"
37     fieldOrder="owner,name,description,marc_format,marc_record_type,tag"
38     [fieldOptions]="{marc_record_type:{customValues:[{id:'biblio'},{id:'serial'},{id:'authority'}]},description:{customTemplate:{template:descriptionTemplate,context:{'hello':'goodbye'}}}}"
39     recordId="1" orgDefaultAllowed="owner">
40   </eg-fm-record-editor>
41   <button class="btn btn-dark" (click)="openEditor()">
42       Fm Record Editor
43   </button>
44 </div>
45 <!-- / FM Editor Experiments ----------------------------- -->
46
47 <!-- Progress Dialog Experiments ----------------------------- -->
48 <div class="row mb-3">
49   <div class="col-lg-3">
50     <button class="btn btn-outline-danger" (click)="progress.increment()">Increment Inline</button>
51     <eg-help-popover [placement]="'bottom'" helpText="Exercise your clicking finger by clicking the button above.">
52     </eg-help-popover>
53   </div>
54   <div class="col-lg-3">
55     <eg-progress-inline [max]="100" [value]="1" #progress></eg-progress-inline>
56   </div>
57 </div>
58 <div class="row mb-3">
59   <div class="col-lg-4">
60     <eg-progress-dialog #progressDialog>
61     </eg-progress-dialog>
62     <button class="btn btn-light" (click)="showProgress()">Test Progress Dialog</button>
63   </div>
64   <div class="col-lg-3">
65     <eg-help-popover helpLink="https://www.youtube.com/watch?v=dQw4w9WgXcQ" helpText="This popover is supposed to help or something...!"></eg-help-popover>
66     <eg-combobox [allowFreeText]="true" 
67       placeholder="Combobox with static data"
68       [entries]="cbEntries"></eg-combobox>
69   </div>
70   <div class="col-lg-3">
71     <eg-help-popover helpText="You have to type to see any options in this dropdown."></eg-help-popover>
72     <eg-combobox
73       placeholder="Combobox with dynamic data that does not enable click if no search term is supplied"
74       [asyncDataSource]="cbAsyncSource"></eg-combobox>
75   </div>
76 </div>
77 <div class="row mb-3">
78   <div class="col-lg-4">
79    <eg-help-popover helpText="If you like Toast you must click below!" placement="'auto'"></eg-help-popover>
80    <button class="btn btn-info" (click)="testToast()">Test Toast Message</button>
81   </div>
82   <div class="col-lg-2">
83     Org select with limit perms
84   </div>
85   <div class="col-lg-2">
86     <eg-org-select [limitPerms]="['REGISTER_WORKSTATION']">
87     </eg-org-select>
88   </div>
89 </div>
90 <div class="row mb-3">
91   <div class="col-lg-4">
92   </div>
93   <div class="col-lg-3">
94     <eg-combobox placeholder="Combobox with @idlClass = 'aou' @idlField='shortname'" idlClass="aou" idlField="shortname" [asyncSupportsEmptyTermClick]="true">
95     </eg-combobox>
96   </div>
97   <div class="col-lg-3">
98     <eg-combobox placeholder="Combobox with @idlClass = 'cvrfm'" idlClass="cvrfm" [asyncSupportsEmptyTermClick]="true">
99     </eg-combobox>
100   </div>
101   <div class="col-lg-3">
102     <eg-combobox placeholder="Combobox with @idlClass = 'csp'" idlClass="csp" [asyncSupportsEmptyTermClick]="true">
103     </eg-combobox>
104   </div>
105 </div>
106 <div class="row mb-3">
107   <div class="col-lg-4">
108   </div>
109   <div class="col-lg-3">
110     <eg-combobox placeholder="Combobox with @idlClass = 'aou'" idlClass="aou" [asyncSupportsEmptyTermClick]="true">
111     </eg-combobox>
112   </div>
113   <div class="col-lg-3">
114     <eg-multi-select idlClass="acpl" linkedLibraryLabel="owning_lib" [startValue]="'{129,130,131}'">
115     </eg-multi-select>
116   </div>
117 </div>
118 <!-- /Progress Dialog Experiments ----------------------------- -->
119
120 <!-- eg strings -->
121 <!--
122 <div class="row mb-3">
123     <eg-string #helloString text="Hello, {{name}}" i18n-text></eg-string>
124     <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
125 </div>
126 -->
127
128 <div class="row mb-3">
129     <ng-template #helloStrTmpl let-name="name" i18n>Hello, {{name}}</ng-template>
130     <!--
131     <eg-string #helloStr key="helloKey" [template]="helloStrTmpl"></eg-string>
132     -->
133     <eg-string key="staff.sandbox.test" [template]="helloStrTmpl"></eg-string>
134     <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
135 </div>
136
137 <div class="row">
138   <div class="form-group">
139     <eg-date-select (onChangeAsDate)="changeDate($event)"
140         initialYmd="2017-03-04">
141     </eg-date-select>
142   </div>
143   <div>HERE: {{testDate}}</div>
144 </div>
145
146 <!-- printing -->
147
148 <h4>PRINTING</h4>
149
150 <div class="d-flex">
151   <div class="mr-2">
152     <button class="btn btn-info" (click)="doPrint()">Test Local Print</button>
153     <ng-template #printTemplate let-context>Hello, {{context.world}}!</ng-template>
154   </div>
155   <div class="mr-2">
156     <button class="btn btn-info" (click)="printWithDialog()">
157       Print with dialog (Hatch Only)
158     </button>
159   </div>
160   <div class="mr-2">
161     <button class="btn btn-info" 
162       (click)="testServerPrint()">Test Server-Generated Print</button>
163   </div>
164 </div>
165
166 <br/><br/>
167 <div class="row">
168   <div class="col-lg-3">
169     <eg-translate #translate [idlObject]="oneBtype" fieldName="name"></eg-translate>
170     <button class="btn btn-info"
171       (click)="translate.open({size:'lg'})">Translate</button>
172   </div>
173 </div>
174 <br/><br/>
175
176
177 <div>
178   <h4>Cross-tab communications example</h4>
179   <p>To test, open this sandbox in a second browser tab. Enter something in the input box below, then switch to the other tab and click anywhere on the page. 
180      You should see the message that you sent to the other browser tab.</p>
181 </div>
182 <div class="row">
183   <div class="col-lg-3">
184     <input type="text" #sendSbMessage placeholder="message to send to another tab" size="40" (change)="sendMessage($event)">
185   </div>
186   <div class="col-lg-3">
187     message received: {{sbChannelText}}
188   </div>
189 </div>
190 <br/><br/>
191
192 <ngb-accordion>
193   <ngb-panel title="Open me for comboboxes">
194     <ng-template ngbPanelContent>
195       <eg-org-select></eg-org-select>
196       <eg-combobox>
197         <eg-combobox-entry entryId="bib" entryLabel="Bibliographic Records"
198           i18n-entryLabel></eg-combobox-entry>
199         <eg-combobox-entry entryId="auth" entryLabel="Authority Records"
200           i18n-entryLabel></eg-combobox-entry>
201         <eg-combobox-entry entryId="bib-acq" entryLabel="Acquisitions Records"
202           i18n-entryLabel></eg-combobox-entry>
203       </eg-combobox>
204     </ng-template>
205   </ngb-panel>
206 </ngb-accordion>
207
208 <!-- grid stuff -->
209 <ng-template #cellTmpl let-row="row" let-col="col" let-userContext="userContext">
210   HELLO {{userContext.hello}}
211   <button>{{row.id()}}</button>
212 </ng-template>
213 <eg-grid #cbtGrid idlClass="cbt" 
214   [dataSource]="btSource" 
215   [rowClassCallback]="btGridRowClassCallback"
216   [rowFlairIsEnabled]="true"
217   [rowFlairCallback]="btGridRowFlairCallback"
218   [cellClassCallback]="btGridCellClassCallback"
219   [stickyHeader]="true"
220   [sortable]="true">
221   <eg-grid-toolbar-action label="Action that needs a single row" i18n-label
222     (onClick)="complimentEvergreen($event)" [disableOnRows]="notOneSelectedRow">
223   </eg-grid-toolbar-action>
224   <eg-grid-toolbar-action [isSeparator]="true">
225   </eg-grid-toolbar-action>
226   <eg-grid-toolbar-action label="Another Action" i18n-label
227     (onClick)="complimentEvergreen2($event)">
228   </eg-grid-toolbar-action>
229   <eg-grid-column name="test" [cellTemplate]="cellTmpl" 
230     [cellContext]="btGridTestContext" [sortable]="false">
231   </eg-grid-column>
232   <eg-grid-column [sortable]="false" path="owner.name"></eg-grid-column>
233   <eg-grid-column [sortable]="false" path="datetime_test" 
234     datatype="timestamp" [datePlusTime]="true"></eg-grid-column>
235 </eg-grid>
236
237 <br/><br/>
238 <div class="row">
239   <div class="col">
240     <eg-daterange-select
241       ngModel #myRange="ngModel"
242       [initialRangeStart]="sevenDaysAgo()"
243       [initialRangeLength]="5"
244       [markDisabled]="allFutureDates">
245     </eg-daterange-select>
246     Your range is: {{myRange.value | json}}
247   </div>
248   <div class="col">
249     <form [formGroup]="myTimeForm">
250       <eg-datetime-select
251         formControlName="datetime">
252       </eg-datetime-select>
253       Your datetime is: {{myTimeForm.get('datetime').value | json}}
254     </form>
255   </div>
256 </div>
257 <label for="date-time-input">
258   Set the datetime and timezone library settings, and enter a valid datetime string for an exciting animation surprise:
259 </label>
260 <input id="date-time-input" type="text" class="date-time-input" ngModel egValidDatetime required>
261 <br/><br/>
262
263 <h4>Grid with filtering</h4>
264 <eg-grid #acpGrid idlClass="acp"
265   [dataSource]="acpSource"
266   [filterable]="true"
267   [sortable]="true"
268   [stickyHeader]="true"
269   showFields="barcode,location,circ_lib,price,dummy_title,create_date"
270 >
271   <eg-grid-toolbar-action label="Edit Selected" i18n-label [action]="editSelected">
272   </eg-grid-toolbar-action>
273   <eg-grid-column [sortable]="true" [filterable]="false"  path="barcode"></eg-grid-column>
274   <eg-grid-column [sortable]="true" path="circ_lib"></eg-grid-column>
275   <eg-grid-column [sortable]="true" path="price"></eg-grid-column>
276   <eg-grid-column [sortable]="true" path="dummy_title"></eg-grid-column>
277   <eg-grid-column [sortable]="true" path="create_date"></eg-grid-column>
278 </eg-grid>
279
280 <eg-fm-record-editor #acpEditDialog idlClass="acp" hiddenFields="call_number,creator,create_date,editor,edit_time,loan_duration,fine_level,dummy_author,dummy_isbn,ref,floating,holdable,circ_as_type,active_date,mint_condition,cost,deleted,deposit,deposit_amount,circulate,status_changed_time,copy_number">
281 </eg-fm-record-editor>
282 <eg-string #successString text="Updated succeeded!" i18n-text></eg-string>
283 <eg-string #updateFailedString text="Updated failed!" i18n-text></eg-string>
284
285 <h4>PCRUD auto flesh and FormatService detection</h4>
286 <div *ngIf="aMetarecord">Fingerprint: {{aMetarecord}}</div>
287
288 <div class="row">
289   <div class="card col-md-6">
290     <div class="card-body">
291       <h3 class="card-title">Do you like template-driven forms?</h3>
292       <div class="card-text">
293         <eg-org-family-select
294           [ancestorSelectorChecked]="true"
295           [hideDescendantSelector]="true"
296           selectedOrgId="7"
297           labelText="Choose the best libraries"
298           ngModel #bestOnes="ngModel">
299         </eg-org-family-select>
300         The best libraries are: {{bestOnes.value | json}}
301         <hr>
302         <eg-combobox [(ngModel)]="kingdom" [allowFreeText]="true">
303           <eg-combobox-entry entryId="Bacteria"></eg-combobox-entry>
304           <eg-combobox-entry entryId="Archaea"></eg-combobox-entry>
305           <eg-combobox-entry entryId="Protozoa"></eg-combobox-entry>
306           <eg-combobox-entry entryId="Chromista"></eg-combobox-entry>
307           <eg-combobox-entry entryId="Plantae"></eg-combobox-entry>
308           <eg-combobox-entry entryId="Fungi"></eg-combobox-entry>
309           <eg-combobox-entry entryId="Animalia"></eg-combobox-entry>
310         </eg-combobox>
311       Result: {{kingdom | json}}
312         <hr>
313         <eg-date-select [(ngModel)]="dateObject">
314         </eg-date-select>
315       ngModel: {{dateObject.toLocaleDateString()}}
316       </div>
317     </div>
318   </div>
319   <form class="card col-md-4" [formGroup]="ranganathan">
320     <div class="card-body">
321       <h3 class="card-title">Or perhaps reactive forms interest you?</h3>
322       <div class="card-text">
323         Choose your favorite law of library science: 
324         <eg-combobox formControlName="law" value="second" 
325           [allowFreeText]="true" [startIdFiresOnChange]="true">
326           <eg-combobox-entry entryId="first" entryLabel="Books are for use" i18n-entryLabel></eg-combobox-entry>
327           <eg-combobox-entry entryId="second" entryLabel="Every person his or her book" i18n-entryLabel></eg-combobox-entry>
328           <eg-combobox-entry entryId="third" entryLabel="Every book its reader" i18n-entryLabel></eg-combobox-entry>
329           <eg-combobox-entry entryId="fourth" entryLabel="Save the time of the reader" i18n-entryLabel></eg-combobox-entry>
330           <eg-combobox-entry entryId="fifth" entryLabel="Library is a growing organism" i18n-entryLabel></eg-combobox-entry>
331           <eg-combobox-entry entryId="wrong" entryLabel="42" i18n-entryLabel></eg-combobox-entry>
332         </eg-combobox>
333         <div *ngIf="!ranganathan.valid" class="alert alert-danger">
334           <span class="material-icons">error</span>
335           <span i18n>That isn't a real law of library science!</span>
336         </div>
337       </div>
338     </div>
339   </form>
340   <form class="card col-md-4" [formGroup]="badOrgForm">
341     <div class="card-body">
342       <h3 class="card-title">Another reactive form!</h3>
343       <div class="card-text">
344         <eg-org-family-select
345           formControlName="badOrgSelector"
346           labelText="Choose the fanciest libraries">
347         </eg-org-family-select>
348         <div *ngIf="!badOrgForm.valid" class="alert alert-danger">
349           <span class="material-icons">error</span>
350           <span i18n>Too many fancy libraries!</span>
351         </div>
352       </div>
353     </div>
354   </form>
355 </div>
356
357 <button (click)="confirmNumber(1)">Confirm 1</button>
358 <button (click)="confirmNumber(0)">Confirm 0</button>
359 <button (click)="confirmNumber(20)">Confirm 20</button>
360
361 <eg-confirm-dialog #numConfirmDialog
362   i18n-dialogTitle
363   dialogTitle="Confirm Number"
364   [dialogBodyTemplate]="confirmMsg">
365 </eg-confirm-dialog>
366 <ng-template #confirmMsg>
367   <span i18n>Are you sure you want to confirm {numThings, plural, =1 {this thing} other {these {{numThings}} things}}?</span>
368 </ng-template>
369
370 <div class="row">
371   <eg-fm-record-editor #bresvEditor
372     idlClass="bresv"
373     hiddenFields="capture_staff,usr" readonlyFields="cancel_time">
374   </eg-fm-record-editor>
375   <button class="btn btn-info" (click)="bresvEditor.open({})">
376     Test Readonly Date
377   </button>
378 </div>
379
380 <div class="row m-3 p-3 border-top border-dark">
381   <div class="col-lg-3">Simple Combobox using [(ngModel)]</div>
382   <div class="col-lg-3">
383     <eg-combobox [(ngModel)]="simpleCombo" [allowFreeText]="true">
384       <eg-combobox-entry 
385         entryId="abc" entryLabel="ABC" i18n-entryLabel></eg-combobox-entry>
386       <eg-combobox-entry 
387         entryId="def" entryLabel="DEF" i18n-entryLabel></eg-combobox-entry>
388     </eg-combobox>
389   </div>
390   <div class="col-lg-3">
391     <span i18n>Combobox Value: {{simpleCombo ? simpleCombo.label : ''}}</span>
392   </div>
393 </div>
394
395 <div class="mt-4 mb-4">
396   <h4>Inline FM Editor</h4>
397   <div class="row">
398     <div class="col-lg-6">
399       <eg-fm-record-editor displayMode="inline"
400         idlClass="cbt" mode="update" recordId="1" orgDefaultAllowed="owner">
401       </eg-fm-record-editor>
402     </div>
403   </div>
404 </div>
405
406 <div class="mt-4 mb-4">
407   <h4>Grid Stock Selector Display and Filtering</h4>
408   <eg-grid #eventsGrid idlClass="atevdef"
409     [dataSource]="eventsDataSource"
410     showFields="name,hook,validator,reactor"
411     [sortable]="true" [filterable]="true">
412     <!-- demo how explicit fields and auto fields support link field selector
413          display and filtering consisently without additional biolerplate -->
414     <eg-grid-column name="name"></eg-grid-column>
415     <eg-grid-column name="hook"></eg-grid-column>
416   </eg-grid>
417 </div>