LP#1807461 FM-editor show danger toasts when create/update fails
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / share / admin-page / admin-page.component.html
1 <ng-template #successStrTmpl i18n>{{idlClassDef.label}} Update Succeeded</ng-template>
2 <eg-string #successString [template]="successStrTmpl"></eg-string>
3
4 <ng-template #updateFailedStrTmpl i18n>Update of {{idlClassDef.label}} failed</ng-template>
5 <eg-string #updateFailedString [template]="updateFailedStrTmpl"></eg-string>
6
7
8 <ng-template #createStrTmpl i18n>{{idlClassDef.label}} Succeessfully Created</ng-template>
9 <eg-string #createString [template]="createStrTmpl"></eg-string>
10
11 <ng-template #createErrStrTmpl i18n>Failed to create new {{idlClassDef.label}}</ng-template>
12 <eg-string #createErrString [template]="createErrStrTmpl"></eg-string>
13
14 <ng-container *ngIf="orgField">
15   <div class="d-flex">
16     <div>
17       <div class="input-group">
18         <div class="input-group-prepend">
19           <span class="input-group-text">{{orgFieldLabel}}</span>
20         </div>
21         <eg-org-select 
22           [limitPerms]="viewPerms"
23           [initialOrg]="contextOrg"
24           (onChange)="orgOnChange($event)">
25         </eg-org-select>
26       </div>
27     </div>
28     <div class="pl-2">
29       <div class="form-check">
30         <input type="checkbox" (click)="grid.reload()" 
31           [disabled]="disableAncestorSelector()"
32           [(ngModel)]="includeOrgAncestors"
33           class="form-check-input" id="include-ancestors">
34         <label class="form-check-label" for="include-ancestors" i18n>+ Ancestors</label>
35       </div>
36       <div class="form-check">
37         <input type="checkbox" (click)="grid.reload()" 
38           [disabled]="disableDescendantSelector()"
39           [(ngModel)]="includeOrgDescendants" 
40           class="form-check-input" id="include-descendants">
41         <label class="form-check-label" for="include-descendants" i18n>+ Descendants</label>
42       </div>
43     </div>
44   </div>
45   <hr/>
46 </ng-container>
47
48 <!-- idlObject and fieldName applied programmatically -->
49 <eg-translate #translator></eg-translate>
50
51 <eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" 
52     [sortable]="true" persistKey="{{persistKey}}">
53   <eg-grid-toolbar-button [disabled]="!canCreate" 
54     label="New {{idlClassDef.label}}" i18n-label [action]="createNew">
55   </eg-grid-toolbar-button>
56   <eg-grid-toolbar-button [disabled]="translatableFields.length == 0" 
57     label="Apply Translations" i18n-label [action]="translate">
58   </eg-grid-toolbar-button>
59   <eg-grid-toolbar-action label="Edit Selected" i18n-label [action]="editSelected">
60   </eg-grid-toolbar-action>
61   <eg-grid-toolbar-action label="Delete Selected" i18n-label [action]="deleteSelected">
62   </eg-grid-toolbar-action>
63 </eg-grid>
64
65 <eg-fm-record-editor #editDialog idlClass="{{idlClass}}" readonlyFields="{{readonlyFields}}">
66 </eg-fm-record-editor>
67
68