]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
8d23a4919a89bce2a68baddab883ef64afa2584b
[ceph.git] /
1 <cds-modal size="md"
2            [open]="open"
3            [hasScrollingContent]="true"
4            (overlaySelected)="closeModal()">
5   <cds-modal-header (closeSelect)="closeModal()">
6     <h3 cdsModalHeaderHeading
7         i18n>{{ action | titlecase }} {{ resource | upperFirst }}</h3>
8   </cds-modal-header>
9   <ng-container *cdFormLoading="loading">
10     <form name="domainSettingsForm"
11           #formDir="ngForm"
12           [formGroup]="domainSettingsForm"
13           novalidate>
14       <div cdsModalContent>
15         <div class="form-item">
16           <cds-text-label
17             label="realm"
18             cdRequiredField="Realm Name"
19             [invalid]="
20               !domainSettingsForm.controls.realm.valid && domainSettingsForm.controls.realm.dirty
21             "
22             [invalidText]="realmNameError"
23             i18n
24             >Realm Name
25             <input
26               cdsText
27               type="text"
28               placeholder="Realm name..."
29               formControlName="realm"
30               autofocus
31             />
32           </cds-text-label>
33           <ng-template #realmNameError>
34             <span
35               *ngIf="domainSettingsForm.showError('realm', formDir, 'required')"
36               class="invalid-feedback"
37             >
38               <ng-container i18n> This field is required. </ng-container>
39             </span>
40           </ng-template>
41         </div>
42
43         <!-- Join Source -->
44         <ng-container
45           formArrayName="join_sources"
46           *ngFor="let joinSource of join_sources.controls; index as i"
47         >
48           <ng-container [formGroupName]="i">
49             <div cdsRow
50                  class="form-item form-item-append">
51               <div cdsCol
52                    [columnNumbers]="{ lg: 14 }">
53                 <input
54                   cdsText
55                   type="text"
56                   placeholder="Id.."
57                   [id]="'ref' + i"
58                   formControlName="ref"
59                   modal-primary-focus
60                   [invalid]="
61                     !domainSettingsForm.controls['join_sources'].controls[i].valid &&
62                     domainSettingsForm.controls['join_sources'].dirty
63                   "
64                   [invalidText]="refError"
65                 />
66                 <ng-template #refError>
67                   <span
68                     class="invalid-feedback"
69                     *ngIf="domainSettingsForm.showError('join_sources', formDir, 'required')"
70                     i18n
71                     >This field is required.</span
72                   >
73                 </ng-template>
74               </div>
75               <div cdsCol
76                    *ngIf="i > 0"
77                    [columnNumbers]="{ lg: 1 }">
78                 <cds-icon-button kind="danger"
79                                  size="sm"
80                                  (click)="removeJoinSource(i)">
81                   <svg cdsIcon="trash-can"
82                        size="32"
83                        class="cds--btn__icon"></svg>
84                 </cds-icon-button>
85               </div>
86             </div>
87           </ng-container>
88         </ng-container>
89         <div class="form-item">
90           <button cdsButton="tertiary"
91                   type="button"
92                   (click)="addJoinSource()"
93                   i18n>
94             Add Join Source
95             <svg cdsIcon="add"
96                  size="32"
97                  class="cds--btn__icon"
98                  icon></svg>
99           </button>
100         </div>
101       </div>
102       <cd-form-button-panel
103         (submitActionEvent)="submit()"
104         [form]="domainSettingsForm"
105         [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
106         [modalForm]="true"
107       >
108       </cd-form-button-panel>
109     </form>
110   </ng-container>
111 </cds-modal>