LP#1808268 eg2 grid rename action disable option
[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 <!-- FM Editor Experiments ----------------------------- -->
6 <div class="row mb-3">
7   <ng-template #descriptionTemplate 
8       let-field="field" let-record="record" let-hello="hello">
9   <!-- example custom template for editing the 'description' field -->
10     <textarea
11       placeholder="{{hello}}"
12       class="form-control"
13       name="{{field.name}}"
14       [readonly]="field.readOnly"
15       [required]="field.isRequired()"
16       [ngModel]="record[field.name]()"
17       (ngModelChange)="record[field.name]($event)">
18     </textarea>
19   </ng-template>
20   <eg-fm-record-editor #fmRecordEditor 
21       idlClass="cmrcfld" mode="create" 
22       [customFieldTemplates]="{description:{template:descriptionTemplate,context:{'hello':'goodbye'}}}"
23       recordId="1" orgDefaultAllowed="owner">
24   </eg-fm-record-editor>
25   <button class="btn btn-dark" (click)="fmRecordEditor.open({size:'lg'})">
26       Fm Record Editor
27   </button>
28 </div>
29 <!-- / FM Editor Experiments ----------------------------- -->
30
31 <!-- Progress Dialog Experiments ----------------------------- -->
32 <div class="row mb-3">
33   <div class="col-lg-3">
34     <button class="btn btn-outline-danger" (click)="progress.increment()">Increment Inline</button>
35   </div>
36   <div class="col-lg-3">
37     <eg-progress-inline [max]="100" [value]="1" #progress></eg-progress-inline>
38   </div>
39 </div>
40 <div class="row mb-3">
41   <div class="col-lg-4">
42     <eg-progress-dialog #progressDialog>
43     </eg-progress-dialog>
44     <button class="btn btn-light" (click)="showProgress()">Test Progress Dialog</button>
45   </div>
46   <div class="col-lg-3">
47     <eg-combobox [allowFreeText]="true" 
48       placeholder="Combobox with static data"
49       [entries]="cbEntries"></eg-combobox>
50   </div>
51   <div class="col-lg-3">
52     <eg-combobox
53       placeholder="Combobox with dynamic data"
54       [asyncDataSource]="cbAsyncSource"></eg-combobox>
55   </div>
56 </div>
57 <div class="row mb-3">
58   <div class="col-lg-4">
59    <button class="btn btn-info" (click)="testToast()">Test Toast Message</button>
60   </div>
61   <div class="col-lg-2">
62     Org select with limit perms
63   </div>
64   <div class="col-lg-2">
65     <eg-org-select [limitPerms]="['REGISTER_WORKSTATION']">
66     </eg-org-select>
67   </div>
68 </div>
69 <!-- /Progress Dialog Experiments ----------------------------- -->
70
71 <!-- eg strings -->
72 <!--
73 <div class="row mb-3">
74     <eg-string #helloString text="Hello, {{name}}" i18n-text></eg-string>
75     <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
76 </div>
77 -->
78
79 <div class="row mb-3">
80     <ng-template #helloStrTmpl let-name="name" i18n>Hello, {{name}}</ng-template>
81     <!--
82     <eg-string #helloStr key="helloKey" [template]="helloStrTmpl"></eg-string>
83     -->
84     <eg-string key="staff.sandbox.test" [template]="helloStrTmpl"></eg-string>
85     <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
86 </div>
87
88 <div class="row">
89   <div class="form-group">
90     <eg-date-select (onChangeAsDate)="changeDate($event)"
91         initialYmd="2017-03-04">
92     </eg-date-select>
93   </div>
94   <div>HERE: {{testDate}}</div>
95 </div>
96
97 <!-- printing -->
98
99 <button class="btn btn-secondary" (click)="doPrint()">Test Print</button>
100 <ng-template #printTemplate let-context>Hello, {{context.world}}!</ng-template>
101
102 <br/><br/>
103 HERasdfE
104 <div class="row">
105   <div class="col-lg-3">
106     <eg-translate #translate [idlObject]="oneBtype" fieldName="name"></eg-translate>
107     <button class="btn btn-info"
108       (click)="translate.open({size:'lg'})">Translate</button>
109   </div>
110 </div>
111 <br/><br/>
112
113 <!-- grid stuff -->
114 <ng-template #cellTmpl let-row="row" let-col="col" let-userContext="userContext">
115   HELLO {{userContext.hello}}
116   <button>{{row.id()}}</button>
117 </ng-template>
118 <eg-grid #cbtGrid idlClass="cbt" 
119   [dataSource]="btSource" 
120   [rowClassCallback]="btGridRowClassCallback"
121   [rowFlairIsEnabled]="true"
122   [rowFlairCallback]="btGridRowFlairCallback"
123   [cellClassCallback]="btGridCellClassCallback"
124   [sortable]="true">
125   <eg-grid-toolbar-action label="Action that needs a single row" i18n-label
126     [action]="complimentEvergreen" [disableOnRows]="notOneSelectedRow">
127   </eg-grid-toolbar-action>
128   <eg-grid-column name="test" [cellTemplate]="cellTmpl" 
129     [cellContext]="btGridTestContext" [sortable]="false">
130   </eg-grid-column>
131   <eg-grid-column [sortable]="false" path="owner.name"></eg-grid-column>
132   <eg-grid-column [sortable]="false" path="datetime_test" 
133     datatype="timestamp" [datePlusTime]="true"></eg-grid-column>
134 </eg-grid>
135
136 <br/><br/>
137
138