Commit f4c7d6c3e287a256d72c7f0b82ad5721bb307289
Committed by
GitHub
Merge pull request #2938 from vvlladd28/improvement/minor-fix
[3.0] Optimaze and clear code
Showing
7 changed files
with
168 additions
and
175 deletions
@@ -62,14 +62,14 @@ | @@ -62,14 +62,14 @@ | ||
62 | <!-- <mat-form-field fxFlex class="mat-block">--> | 62 | <!-- <mat-form-field fxFlex class="mat-block">--> |
63 | <!-- <mat-label>Integer Value</mat-label>--> | 63 | <!-- <mat-label>Integer Value</mat-label>--> |
64 | <!-- <input type="number" step="1" matInput formControlName="number">--> | 64 | <!-- <input type="number" step="1" matInput formControlName="number">--> |
65 | -<!-- <mat-error *ngIf="editEntityFormGroup.get('attributes').get('number').hasError('pattern')">--> | 65 | +<!-- <mat-error *ngIf="editEntityFormGroup.get('attributes.number').hasError('pattern')">--> |
66 | <!-- Invalid integer value.--> | 66 | <!-- Invalid integer value.--> |
67 | <!-- </mat-error>--> | 67 | <!-- </mat-error>--> |
68 | <!-- </mat-form-field>--> | 68 | <!-- </mat-form-field>--> |
69 | <!-- <div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>--> | 69 | <!-- <div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>--> |
70 | <!-- <label class="checkbox-label">Boolean Value</label>--> | 70 | <!-- <label class="checkbox-label">Boolean Value</label>--> |
71 | <!-- <mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">--> | 71 | <!-- <mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">--> |
72 | -<!-- {{ (editEntityFormGroup.get('attributes').get('booleanValue').value ? "value.true" : "value.false") | translate }}--> | 72 | +<!-- {{ (editEntityFormGroup.get('attributes.booleanValue').value ? "value.true" : "value.false") | translate }}--> |
73 | <!-- </mat-checkbox>--> | 73 | <!-- </mat-checkbox>--> |
74 | <!-- </div>--> | 74 | <!-- </div>--> |
75 | <!-- </div>--> | 75 | <!-- </div>--> |
@@ -184,7 +184,6 @@ | @@ -184,7 +184,6 @@ | ||
184 | <!-- Save--> | 184 | <!-- Save--> |
185 | <!-- </button>--> | 185 | <!-- </button>--> |
186 | <!-- <button mat-button color="primary"--> | 186 | <!-- <button mat-button color="primary"--> |
187 | -<!-- style="margin-right: 20px;"--> | ||
188 | <!-- type="button"--> | 187 | <!-- type="button"--> |
189 | <!-- [disabled]="(isLoading$ | async)"--> | 188 | <!-- [disabled]="(isLoading$ | async)"--> |
190 | <!-- (click)="cancel()" cdkFocusInitial>--> | 189 | <!-- (click)="cancel()" cdkFocusInitial>--> |
@@ -270,14 +269,14 @@ | @@ -270,14 +269,14 @@ | ||
270 | <!-- <mat-form-field fxFlex class="mat-block">--> | 269 | <!-- <mat-form-field fxFlex class="mat-block">--> |
271 | <!-- <mat-label>Integer Value</mat-label>--> | 270 | <!-- <mat-label>Integer Value</mat-label>--> |
272 | <!-- <input type="number" step="1" matInput formControlName="number">--> | 271 | <!-- <input type="number" step="1" matInput formControlName="number">--> |
273 | -<!-- <mat-error *ngIf="addEntityFormGroup.get('attributes').get('number').hasError('pattern')">--> | 272 | +<!-- <mat-error *ngIf="addEntityFormGroup.get('attributes.number').hasError('pattern')">--> |
274 | <!-- Invalid integer value.--> | 273 | <!-- Invalid integer value.--> |
275 | <!-- </mat-error>--> | 274 | <!-- </mat-error>--> |
276 | <!-- </mat-form-field>--> | 275 | <!-- </mat-form-field>--> |
277 | <!-- <div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>--> | 276 | <!-- <div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>--> |
278 | <!-- <label class="checkbox-label">Boolean Value</label>--> | 277 | <!-- <label class="checkbox-label">Boolean Value</label>--> |
279 | <!-- <mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">--> | 278 | <!-- <mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">--> |
280 | -<!-- {{ (addEntityFormGroup.get('attributes').get('booleanValue').value ? "value.true" : "value.false") | translate }}--> | 279 | +<!-- {{ (addEntityFormGroup.get('attributes.booleanValue').value ? "value.true" : "value.false") | translate }}--> |
281 | <!-- </mat-checkbox>--> | 280 | <!-- </mat-checkbox>--> |
282 | <!-- </div>--> | 281 | <!-- </div>--> |
283 | <!-- </div>--> | 282 | <!-- </div>--> |
@@ -345,7 +344,6 @@ | @@ -345,7 +344,6 @@ | ||
345 | <!-- Create--> | 344 | <!-- Create--> |
346 | <!-- </button>--> | 345 | <!-- </button>--> |
347 | <!-- <button mat-button color="primary"--> | 346 | <!-- <button mat-button color="primary"--> |
348 | -<!-- style="margin-right: 20px;"--> | ||
349 | <!-- type="button"--> | 347 | <!-- type="button"--> |
350 | <!-- [disabled]="(isLoading$ | async)"--> | 348 | <!-- [disabled]="(isLoading$ | async)"--> |
351 | <!-- (click)="cancel()" cdkFocusInitial>--> | 349 | <!-- (click)="cancel()" cdkFocusInitial>--> |
@@ -186,28 +186,27 @@ | @@ -186,28 +186,27 @@ | ||
186 | // } | 186 | // } |
187 | // | 187 | // |
188 | // function getEntityInfo() { | 188 | // function getEntityInfo() { |
189 | -// entityService.getEntity(entityId.entityType, entityId.id).subscribe(function (entity) { | ||
190 | -// vm.entity = entity; | ||
191 | -// widgetContext.rxjs.forkJoin([ | ||
192 | -// entityRelationService.findInfoByFrom(entityId), | ||
193 | -// entityRelationService.findInfoByTo(entityId), | ||
194 | -// attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE') | ||
195 | -// ]).subscribe( | ||
196 | -// function (data) { | ||
197 | -// getEntityRelations(data.slice(0,2)); | ||
198 | -// getEntityAttributes(data[2]); | ||
199 | -// vm.editEntityFormGroup.patchValue({ | ||
200 | -// entityName: vm.entity.name, | ||
201 | -// entityType: vm.entityType, | ||
202 | -// entityLabel: vm.entity.label, | ||
203 | -// type: vm.entity.type, | ||
204 | -// attributes: vm.attributes, | ||
205 | -// oldRelations: vm.oldRelationsData | ||
206 | -// }, {emitEvent: false}); | ||
207 | -// } | ||
208 | -// ); | ||
209 | -// }); | ||
210 | -// } | 189 | +// widgetContext.rxjs.forkJoin([ |
190 | +// entityRelationService.findInfoByFrom(entityId), | ||
191 | +// entityRelationService.findInfoByTo(entityId), | ||
192 | +// attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE'), | ||
193 | +// entityService.getEntity(entityId.entityType, entityId.id) | ||
194 | +// ]).subscribe( | ||
195 | +// function (data) { | ||
196 | +// getEntityRelations(data.slice(0,2)); | ||
197 | +// getEntityAttributes(data[2]); | ||
198 | +// vm.entity = data[3]; | ||
199 | +// vm.editEntityFormGroup.patchValue({ | ||
200 | +// entityName: vm.entity.name, | ||
201 | +// entityType: vm.entityType, | ||
202 | +// entityLabel: vm.entity.label, | ||
203 | +// type: vm.entity.type, | ||
204 | +// attributes: vm.attributes, | ||
205 | +// oldRelations: vm.oldRelationsData | ||
206 | +// }, {emitEvent: false}); | ||
207 | +// } | ||
208 | +// ); | ||
209 | +// } | ||
211 | // | 210 | // |
212 | // function saveEntity() { | 211 | // function saveEntity() { |
213 | // const formValues = vm.editEntityFormGroup.value; | 212 | // const formValues = vm.editEntityFormGroup.value; |
@@ -218,9 +217,8 @@ | @@ -218,9 +217,8 @@ | ||
218 | // } else if (formValues.entityType == 'DEVICE') { | 217 | // } else if (formValues.entityType == 'DEVICE') { |
219 | // return deviceService.saveDevice(vm.entity); | 218 | // return deviceService.saveDevice(vm.entity); |
220 | // } | 219 | // } |
221 | -// } else { | ||
222 | -// return widgetContext.rxjs.of([]); | ||
223 | // } | 220 | // } |
221 | +// return widgetContext.rxjs.of([]); | ||
224 | // } | 222 | // } |
225 | // | 223 | // |
226 | // function saveAttributes(entityId) { | 224 | // function saveAttributes(entityId) { |
@@ -233,9 +231,8 @@ | @@ -233,9 +231,8 @@ | ||
233 | // } | 231 | // } |
234 | // if (attributesArray.length > 0) { | 232 | // if (attributesArray.length > 0) { |
235 | // return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); | 233 | // return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); |
236 | -// } else { | ||
237 | -// return widgetContext.rxjs.of([]); | ||
238 | // } | 234 | // } |
235 | +// return widgetContext.rxjs.of([]); | ||
239 | // } | 236 | // } |
240 | // | 237 | // |
241 | // function saveRelations(entityId) { | 238 | // function saveRelations(entityId) { |
@@ -270,9 +267,8 @@ | @@ -270,9 +267,8 @@ | ||
270 | // } | 267 | // } |
271 | // if (tasks.length > 0) { | 268 | // if (tasks.length > 0) { |
272 | // return widgetContext.rxjs.forkJoin(tasks); | 269 | // return widgetContext.rxjs.forkJoin(tasks); |
273 | -// } else { | ||
274 | -// return widgetContext.rxjs.of([]); | ||
275 | // } | 270 | // } |
271 | +// return widgetContext.rxjs.of([]); | ||
276 | // } | 272 | // } |
277 | //} | 273 | //} |
278 | // | 274 | // |
@@ -380,9 +376,8 @@ | @@ -380,9 +376,8 @@ | ||
380 | // } | 376 | // } |
381 | // if (attributesArray.length > 0) { | 377 | // if (attributesArray.length > 0) { |
382 | // return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); | 378 | // return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); |
383 | -// } else { | ||
384 | -// return widgetContext.rxjs.of([]); | ||
385 | // } | 379 | // } |
380 | +// return widgetContext.rxjs.of([]); | ||
386 | // } | 381 | // } |
387 | // | 382 | // |
388 | // function saveRelations(entityId) { | 383 | // function saveRelations(entityId) { |
@@ -404,8 +399,7 @@ | @@ -404,8 +399,7 @@ | ||
404 | // } | 399 | // } |
405 | // if (tasks.length > 0) { | 400 | // if (tasks.length > 0) { |
406 | // return widgetContext.rxjs.forkJoin(tasks); | 401 | // return widgetContext.rxjs.forkJoin(tasks); |
407 | -// } else { | ||
408 | -// return widgetContext.rxjs.of([]); | ||
409 | // } | 402 | // } |
403 | +// return widgetContext.rxjs.of([]); | ||
410 | // } | 404 | // } |
411 | //} | 405 | //} |
@@ -28,117 +28,121 @@ | @@ -28,117 +28,121 @@ | ||
28 | </mat-progress-bar> | 28 | </mat-progress-bar> |
29 | <div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div> | 29 | <div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div> |
30 | <mat-card-content style="padding-top: 16px;"> | 30 | <mat-card-content style="padding-top: 16px;"> |
31 | - <form [formGroup]="securitySettingsFormGroup" (ngSubmit)="save()"> | 31 | + <form [formGroup]="securitySettingsFormGroup" (ngSubmit)="save()" autocomplete="off"> |
32 | <fieldset [disabled]="isLoading$ | async"> | 32 | <fieldset [disabled]="isLoading$ | async"> |
33 | - <mat-expansion-panel [expanded]="true"> | ||
34 | - <mat-expansion-panel-header> | ||
35 | - <mat-panel-title> | ||
36 | - <div class="tb-panel-title" translate>admin.general-policy</div> | ||
37 | - </mat-panel-title> | ||
38 | - </mat-expansion-panel-header> | ||
39 | - <mat-form-field class="mat-block"> | ||
40 | - <mat-label translate>admin.max-failed-login-attempts</mat-label> | ||
41 | - <input matInput type="number" | ||
42 | - formControlName="maxFailedLoginAttempts" | ||
43 | - step="1" | ||
44 | - min="0"/> | ||
45 | - <mat-error *ngIf="securitySettingsFormGroup.get('maxFailedLoginAttempts').hasError('min')"> | ||
46 | - {{ 'admin.minimum-max-failed-login-attempts-range' | translate }} | ||
47 | - </mat-error> | ||
48 | - </mat-form-field> | ||
49 | - <mat-form-field class="mat-block"> | ||
50 | - <mat-label translate>admin.user-lockout-notification-email</mat-label> | ||
51 | - <input matInput type="email" | ||
52 | - formControlName="userLockoutNotificationEmail"/> | ||
53 | - </mat-form-field> | ||
54 | - </mat-expansion-panel> | ||
55 | - <mat-expansion-panel [expanded]="true"> | ||
56 | - <mat-expansion-panel-header> | ||
57 | - <mat-panel-title> | ||
58 | - <div class="tb-panel-title" translate>admin.password-policy</div> | ||
59 | - </mat-panel-title> | ||
60 | - </mat-expansion-panel-header> | ||
61 | - <section formGroupName="passwordPolicy"> | ||
62 | - <mat-form-field class="mat-block"> | ||
63 | - <mat-label translate>admin.minimum-password-length</mat-label> | ||
64 | - <input matInput type="number" | ||
65 | - formControlName="minimumLength" | ||
66 | - step="1" | ||
67 | - min="5" | ||
68 | - max="50" | ||
69 | - required/> | ||
70 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLength').hasError('required')"> | ||
71 | - {{ 'admin.minimum-password-length-required' | translate }} | ||
72 | - </mat-error> | ||
73 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLength').hasError('min')"> | ||
74 | - {{ 'admin.minimum-password-length-range' | translate }} | ||
75 | - </mat-error> | ||
76 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLength').hasError('max')"> | ||
77 | - {{ 'admin.minimum-password-length-range' | translate }} | ||
78 | - </mat-error> | ||
79 | - </mat-form-field> | ||
80 | - <mat-form-field class="mat-block"> | ||
81 | - <mat-label translate>admin.minimum-uppercase-letters</mat-label> | ||
82 | - <input matInput type="number" | ||
83 | - formControlName="minimumUppercaseLetters" | ||
84 | - step="1" | ||
85 | - min="0"/> | ||
86 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumUppercaseLetters').hasError('min')"> | ||
87 | - {{ 'admin.minimum-uppercase-letters-range' | translate }} | ||
88 | - </mat-error> | ||
89 | - </mat-form-field> | ||
90 | - <mat-form-field class="mat-block"> | ||
91 | - <mat-label translate>admin.minimum-lowercase-letters</mat-label> | ||
92 | - <input matInput type="number" | ||
93 | - formControlName="minimumLowercaseLetters" | ||
94 | - step="1" | ||
95 | - min="0"/> | ||
96 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLowercaseLetters').hasError('min')"> | ||
97 | - {{ 'admin.minimum-lowercase-letters-range' | translate }} | ||
98 | - </mat-error> | ||
99 | - </mat-form-field> | ||
100 | - <mat-form-field class="mat-block"> | ||
101 | - <mat-label translate>admin.minimum-digits</mat-label> | ||
102 | - <input matInput type="number" | ||
103 | - formControlName="minimumDigits" | ||
104 | - step="1" | ||
105 | - min="0"/> | ||
106 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumDigits').hasError('min')"> | ||
107 | - {{ 'admin.minimum-digits-range' | translate }} | ||
108 | - </mat-error> | ||
109 | - </mat-form-field> | ||
110 | - <mat-form-field class="mat-block"> | ||
111 | - <mat-label translate>admin.minimum-special-characters</mat-label> | ||
112 | - <input matInput type="number" | ||
113 | - formControlName="minimumSpecialCharacters" | ||
114 | - step="1" | ||
115 | - min="0"/> | ||
116 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumSpecialCharacters').hasError('min')"> | ||
117 | - {{ 'admin.minimum-special-characters-range' | translate }} | ||
118 | - </mat-error> | ||
119 | - </mat-form-field> | ||
120 | - <mat-form-field class="mat-block"> | ||
121 | - <mat-label translate>admin.password-expiration-period-days</mat-label> | ||
122 | - <input matInput type="number" | ||
123 | - formControlName="passwordExpirationPeriodDays" | ||
124 | - step="1" | ||
125 | - min="0"/> | ||
126 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('passwordExpirationPeriodDays').hasError('min')"> | ||
127 | - {{ 'admin.password-expiration-period-days-range' | translate }} | ||
128 | - </mat-error> | ||
129 | - </mat-form-field> | ||
130 | - <mat-form-field class="mat-block"> | ||
131 | - <mat-label translate>admin.password-reuse-frequency-days</mat-label> | ||
132 | - <input matInput type="number" | ||
133 | - formControlName="passwordReuseFrequencyDays" | ||
134 | - step="1" | ||
135 | - min="0"/> | ||
136 | - <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('passwordReuseFrequencyDays').hasError('min')"> | ||
137 | - {{ 'admin.password-reuse-frequency-days-range' | translate }} | ||
138 | - </mat-error> | ||
139 | - </mat-form-field> | ||
140 | - </section> | ||
141 | - </mat-expansion-panel> | 33 | + <div class="mat-accordion-container"> |
34 | + <mat-accordion multi="true"> | ||
35 | + <mat-expansion-panel [expanded]="true"> | ||
36 | + <mat-expansion-panel-header> | ||
37 | + <mat-panel-title> | ||
38 | + <div class="tb-panel-title" translate>admin.general-policy</div> | ||
39 | + </mat-panel-title> | ||
40 | + </mat-expansion-panel-header> | ||
41 | + <mat-form-field class="mat-block"> | ||
42 | + <mat-label translate>admin.max-failed-login-attempts</mat-label> | ||
43 | + <input matInput type="number" | ||
44 | + formControlName="maxFailedLoginAttempts" | ||
45 | + step="1" | ||
46 | + min="0"/> | ||
47 | + <mat-error *ngIf="securitySettingsFormGroup.get('maxFailedLoginAttempts').hasError('min')"> | ||
48 | + {{ 'admin.minimum-max-failed-login-attempts-range' | translate }} | ||
49 | + </mat-error> | ||
50 | + </mat-form-field> | ||
51 | + <mat-form-field class="mat-block"> | ||
52 | + <mat-label translate>admin.user-lockout-notification-email</mat-label> | ||
53 | + <input matInput type="email" | ||
54 | + formControlName="userLockoutNotificationEmail"/> | ||
55 | + </mat-form-field> | ||
56 | + </mat-expansion-panel> | ||
57 | + <mat-expansion-panel [expanded]="true"> | ||
58 | + <mat-expansion-panel-header> | ||
59 | + <mat-panel-title> | ||
60 | + <div class="tb-panel-title" translate>admin.password-policy</div> | ||
61 | + </mat-panel-title> | ||
62 | + </mat-expansion-panel-header> | ||
63 | + <section formGroupName="passwordPolicy"> | ||
64 | + <mat-form-field class="mat-block"> | ||
65 | + <mat-label translate>admin.minimum-password-length</mat-label> | ||
66 | + <input matInput type="number" | ||
67 | + formControlName="minimumLength" | ||
68 | + step="1" | ||
69 | + min="5" | ||
70 | + max="50" | ||
71 | + required/> | ||
72 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.minimumLength').hasError('required')"> | ||
73 | + {{ 'admin.minimum-password-length-required' | translate }} | ||
74 | + </mat-error> | ||
75 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.minimumLength').hasError('min')"> | ||
76 | + {{ 'admin.minimum-password-length-range' | translate }} | ||
77 | + </mat-error> | ||
78 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.minimumLength').hasError('max')"> | ||
79 | + {{ 'admin.minimum-password-length-range' | translate }} | ||
80 | + </mat-error> | ||
81 | + </mat-form-field> | ||
82 | + <mat-form-field class="mat-block"> | ||
83 | + <mat-label translate>admin.minimum-uppercase-letters</mat-label> | ||
84 | + <input matInput type="number" | ||
85 | + formControlName="minimumUppercaseLetters" | ||
86 | + step="1" | ||
87 | + min="0"/> | ||
88 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.minimumUppercaseLetters').hasError('min')"> | ||
89 | + {{ 'admin.minimum-uppercase-letters-range' | translate }} | ||
90 | + </mat-error> | ||
91 | + </mat-form-field> | ||
92 | + <mat-form-field class="mat-block"> | ||
93 | + <mat-label translate>admin.minimum-lowercase-letters</mat-label> | ||
94 | + <input matInput type="number" | ||
95 | + formControlName="minimumLowercaseLetters" | ||
96 | + step="1" | ||
97 | + min="0"/> | ||
98 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.minimumLowercaseLetters').hasError('min')"> | ||
99 | + {{ 'admin.minimum-lowercase-letters-range' | translate }} | ||
100 | + </mat-error> | ||
101 | + </mat-form-field> | ||
102 | + <mat-form-field class="mat-block"> | ||
103 | + <mat-label translate>admin.minimum-digits</mat-label> | ||
104 | + <input matInput type="number" | ||
105 | + formControlName="minimumDigits" | ||
106 | + step="1" | ||
107 | + min="0"/> | ||
108 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.minimumDigits').hasError('min')"> | ||
109 | + {{ 'admin.minimum-digits-range' | translate }} | ||
110 | + </mat-error> | ||
111 | + </mat-form-field> | ||
112 | + <mat-form-field class="mat-block"> | ||
113 | + <mat-label translate>admin.minimum-special-characters</mat-label> | ||
114 | + <input matInput type="number" | ||
115 | + formControlName="minimumSpecialCharacters" | ||
116 | + step="1" | ||
117 | + min="0"/> | ||
118 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.minimumSpecialCharacters').hasError('min')"> | ||
119 | + {{ 'admin.minimum-special-characters-range' | translate }} | ||
120 | + </mat-error> | ||
121 | + </mat-form-field> | ||
122 | + <mat-form-field class="mat-block"> | ||
123 | + <mat-label translate>admin.password-expiration-period-days</mat-label> | ||
124 | + <input matInput type="number" | ||
125 | + formControlName="passwordExpirationPeriodDays" | ||
126 | + step="1" | ||
127 | + min="0"/> | ||
128 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.passwordExpirationPeriodDays').hasError('min')"> | ||
129 | + {{ 'admin.password-expiration-period-days-range' | translate }} | ||
130 | + </mat-error> | ||
131 | + </mat-form-field> | ||
132 | + <mat-form-field class="mat-block"> | ||
133 | + <mat-label translate>admin.password-reuse-frequency-days</mat-label> | ||
134 | + <input matInput type="number" | ||
135 | + formControlName="passwordReuseFrequencyDays" | ||
136 | + step="1" | ||
137 | + min="0"/> | ||
138 | + <mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy.passwordReuseFrequencyDays').hasError('min')"> | ||
139 | + {{ 'admin.password-reuse-frequency-days-range' | translate }} | ||
140 | + </mat-error> | ||
141 | + </mat-form-field> | ||
142 | + </section> | ||
143 | + </mat-expansion-panel> | ||
144 | + </mat-accordion> | ||
145 | + </div> | ||
142 | <div fxLayout="row" fxLayoutAlign="end center" style="width: 100%;" class="layout-wrap"> | 146 | <div fxLayout="row" fxLayoutAlign="end center" style="width: 100%;" class="layout-wrap"> |
143 | <button mat-button mat-raised-button color="primary" [disabled]="(isLoading$ | async) || securitySettingsFormGroup.invalid || !securitySettingsFormGroup.dirty" | 147 | <button mat-button mat-raised-button color="primary" [disabled]="(isLoading$ | async) || securitySettingsFormGroup.invalid || !securitySettingsFormGroup.dirty" |
144 | type="submit">{{'action.save' | translate}} | 148 | type="submit">{{'action.save' | translate}} |
@@ -14,10 +14,7 @@ | @@ -14,10 +14,7 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | :host { | 16 | :host { |
17 | - mat-expansion-panel { | 17 | + .mat-accordion-container { |
18 | margin-bottom: 16px; | 18 | margin-bottom: 16px; |
19 | } | 19 | } |
20 | - .tb-panel-title { | ||
21 | - | ||
22 | - } | ||
23 | } | 20 | } |
@@ -174,8 +174,8 @@ export class NodeScriptTestDialogComponent extends DialogComponent<NodeScriptTes | @@ -174,8 +174,8 @@ export class NodeScriptTestDialogComponent extends DialogComponent<NodeScriptTes | ||
174 | const inputParams: TestScriptInputParams = { | 174 | const inputParams: TestScriptInputParams = { |
175 | argNames: this.data.argNames, | 175 | argNames: this.data.argNames, |
176 | scriptType: this.data.scriptType, | 176 | scriptType: this.data.scriptType, |
177 | - msgType: this.nodeScriptTestFormGroup.get('payload').get('msgType').value, | ||
178 | - msg: this.nodeScriptTestFormGroup.get('payload').get('msg').value, | 177 | + msgType: this.nodeScriptTestFormGroup.get('payload.msgType').value, |
178 | + msg: this.nodeScriptTestFormGroup.get('payload.msg').value, | ||
179 | metadata: this.nodeScriptTestFormGroup.get('metadata').value, | 179 | metadata: this.nodeScriptTestFormGroup.get('metadata').value, |
180 | script: this.nodeScriptTestFormGroup.get('script').value | 180 | script: this.nodeScriptTestFormGroup.get('script').value |
181 | }; | 181 | }; |
@@ -48,9 +48,9 @@ | @@ -48,9 +48,9 @@ | ||
48 | <tb-timeinterval | 48 | <tb-timeinterval |
49 | formControlName="timewindowMs" | 49 | formControlName="timewindowMs" |
50 | predefinedName="timewindow.last" | 50 | predefinedName="timewindow.last" |
51 | - [fxShow]="timewindowForm.get('history').get('historyType').value === historyTypes.LAST_INTERVAL" | 51 | + [fxShow]="timewindowForm.get('history.historyType').value === historyTypes.LAST_INTERVAL" |
52 | [required]="timewindow.selectedTab === timewindowTypes.HISTORY && | 52 | [required]="timewindow.selectedTab === timewindowTypes.HISTORY && |
53 | - timewindowForm.get('history').get('historyType').value === historyTypes.LAST_INTERVAL" | 53 | + timewindowForm.get('history.historyType').value === historyTypes.LAST_INTERVAL" |
54 | style="padding-top: 8px;"></tb-timeinterval> | 54 | style="padding-top: 8px;"></tb-timeinterval> |
55 | </section> | 55 | </section> |
56 | </mat-radio-button> | 56 | </mat-radio-button> |
@@ -59,9 +59,9 @@ | @@ -59,9 +59,9 @@ | ||
59 | <span translate>timewindow.time-period</span> | 59 | <span translate>timewindow.time-period</span> |
60 | <tb-datetime-period | 60 | <tb-datetime-period |
61 | formControlName="fixedTimewindow" | 61 | formControlName="fixedTimewindow" |
62 | - [fxShow]="timewindowForm.get('history').get('historyType').value === historyTypes.FIXED" | 62 | + [fxShow]="timewindowForm.get('history.historyType').value === historyTypes.FIXED" |
63 | [required]="timewindow.selectedTab === timewindowTypes.HISTORY && | 63 | [required]="timewindow.selectedTab === timewindowTypes.HISTORY && |
64 | - timewindowForm.get('history').get('historyType').value === historyTypes.FIXED" | 64 | + timewindowForm.get('history.historyType').value === historyTypes.FIXED" |
65 | style="padding-top: 8px;"></tb-datetime-period> | 65 | style="padding-top: 8px;"></tb-datetime-period> |
66 | </section> | 66 | </section> |
67 | </mat-radio-button> | 67 | </mat-radio-button> |
@@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
89 | </mat-form-field> | 89 | </mat-form-field> |
90 | </section> | 90 | </section> |
91 | </section> | 91 | </section> |
92 | - <section fxLayout="row" [fxShow]="timewindowForm.get('aggregation').get('type').value === aggregationTypes.NONE"> | 92 | + <section fxLayout="row" [fxShow]="timewindowForm.get('aggregation.type').value === aggregationTypes.NONE"> |
93 | <section fxLayout="column" [fxShow]="isEdit"> | 93 | <section fxLayout="column" [fxShow]="isEdit"> |
94 | <label class="tb-small hide-label" translate>timewindow.hide</label> | 94 | <label class="tb-small hide-label" translate>timewindow.hide</label> |
95 | <mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideAggInterval" | 95 | <mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideAggInterval" |
@@ -101,13 +101,13 @@ | @@ -101,13 +101,13 @@ | ||
101 | <span translate>aggregation.limit</span> | 101 | <span translate>aggregation.limit</span> |
102 | <mat-slider fxFlex formControlName="limit" | 102 | <mat-slider fxFlex formControlName="limit" |
103 | thumbLabel | 103 | thumbLabel |
104 | - [value]="timewindowForm.get('aggregation').get('limit').value" | 104 | + [value]="timewindowForm.get('aggregation.limit').value" |
105 | min="{{minDatapointsLimit()}}" | 105 | min="{{minDatapointsLimit()}}" |
106 | max="{{maxDatapointsLimit()}}"> | 106 | max="{{maxDatapointsLimit()}}"> |
107 | </mat-slider> | 107 | </mat-slider> |
108 | <mat-form-field style="max-width: 80px;"> | 108 | <mat-form-field style="max-width: 80px;"> |
109 | <input matInput formControlName="limit" type="number" step="1" | 109 | <input matInput formControlName="limit" type="number" step="1" |
110 | - [value]="timewindowForm.get('aggregation').get('limit').value" | 110 | + [value]="timewindowForm.get('aggregation.limit').value" |
111 | min="{{minDatapointsLimit()}}" | 111 | min="{{minDatapointsLimit()}}" |
112 | max="{{maxDatapointsLimit()}}"/> | 112 | max="{{maxDatapointsLimit()}}"/> |
113 | </mat-form-field> | 113 | </mat-form-field> |
@@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
116 | </section> | 116 | </section> |
117 | </div> | 117 | </div> |
118 | <div formGroupName="realtime" | 118 | <div formGroupName="realtime" |
119 | - *ngIf="aggregation && timewindowForm.get('aggregation').get('type').value !== aggregationTypes.NONE && | 119 | + *ngIf="aggregation && timewindowForm.get('aggregation.type').value !== aggregationTypes.NONE && |
120 | timewindow.selectedTab === timewindowTypes.REALTIME" class="mat-content mat-padding" fxLayout="column"> | 120 | timewindow.selectedTab === timewindowTypes.REALTIME" class="mat-content mat-padding" fxLayout="column"> |
121 | <tb-timeinterval | 121 | <tb-timeinterval |
122 | formControlName="interval" | 122 | formControlName="interval" |
@@ -128,7 +128,7 @@ | @@ -128,7 +128,7 @@ | ||
128 | </tb-timeinterval> | 128 | </tb-timeinterval> |
129 | </div> | 129 | </div> |
130 | <div formGroupName="history" | 130 | <div formGroupName="history" |
131 | - *ngIf="aggregation && timewindowForm.get('aggregation').get('type').value !== aggregationTypes.NONE && | 131 | + *ngIf="aggregation && timewindowForm.get('aggregation.type').value !== aggregationTypes.NONE && |
132 | timewindow.selectedTab === timewindowTypes.HISTORY" class="mat-content mat-padding" fxLayout="column"> | 132 | timewindow.selectedTab === timewindowTypes.HISTORY" class="mat-content mat-padding" fxLayout="column"> |
133 | <tb-timeinterval | 133 | <tb-timeinterval |
134 | formControlName="interval" | 134 | formControlName="interval" |
@@ -174,11 +174,11 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { | @@ -174,11 +174,11 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { | ||
174 | } | 174 | } |
175 | 175 | ||
176 | minRealtimeAggInterval() { | 176 | minRealtimeAggInterval() { |
177 | - return this.timeService.minIntervalLimit(this.timewindowForm.get('realtime').get('timewindowMs').value); | 177 | + return this.timeService.minIntervalLimit(this.timewindowForm.get('realtime.timewindowMs').value); |
178 | } | 178 | } |
179 | 179 | ||
180 | maxRealtimeAggInterval() { | 180 | maxRealtimeAggInterval() { |
181 | - return this.timeService.maxIntervalLimit(this.timewindowForm.get('realtime').get('timewindowMs').value); | 181 | + return this.timeService.maxIntervalLimit(this.timewindowForm.get('realtime.timewindowMs').value); |
182 | } | 182 | } |
183 | 183 | ||
184 | minHistoryAggInterval() { | 184 | minHistoryAggInterval() { |
@@ -203,31 +203,31 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { | @@ -203,31 +203,31 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { | ||
203 | 203 | ||
204 | onHideIntervalChanged() { | 204 | onHideIntervalChanged() { |
205 | if (this.timewindow.hideInterval) { | 205 | if (this.timewindow.hideInterval) { |
206 | - this.timewindowForm.get('history').get('historyType').disable({emitEvent: false}); | ||
207 | - this.timewindowForm.get('history').get('timewindowMs').disable({emitEvent: false}); | ||
208 | - this.timewindowForm.get('history').get('fixedTimewindow').disable({emitEvent: false}); | 206 | + this.timewindowForm.get('history.historyType').disable({emitEvent: false}); |
207 | + this.timewindowForm.get('history.timewindowMs').disable({emitEvent: false}); | ||
208 | + this.timewindowForm.get('history.fixedTimewindow').disable({emitEvent: false}); | ||
209 | } else { | 209 | } else { |
210 | - this.timewindowForm.get('history').get('historyType').enable({emitEvent: false}); | ||
211 | - this.timewindowForm.get('history').get('timewindowMs').enable({emitEvent: false}); | ||
212 | - this.timewindowForm.get('history').get('fixedTimewindow').enable({emitEvent: false}); | 210 | + this.timewindowForm.get('history.historyType').enable({emitEvent: false}); |
211 | + this.timewindowForm.get('history.timewindowMs').enable({emitEvent: false}); | ||
212 | + this.timewindowForm.get('history.fixedTimewindow').enable({emitEvent: false}); | ||
213 | } | 213 | } |
214 | this.timewindowForm.markAsDirty(); | 214 | this.timewindowForm.markAsDirty(); |
215 | } | 215 | } |
216 | 216 | ||
217 | onHideAggregationChanged() { | 217 | onHideAggregationChanged() { |
218 | if (this.timewindow.hideAggregation) { | 218 | if (this.timewindow.hideAggregation) { |
219 | - this.timewindowForm.get('aggregation').get('type').disable({emitEvent: false}); | 219 | + this.timewindowForm.get('aggregation.type').disable({emitEvent: false}); |
220 | } else { | 220 | } else { |
221 | - this.timewindowForm.get('aggregation').get('type').enable({emitEvent: false}); | 221 | + this.timewindowForm.get('aggregation.type').enable({emitEvent: false}); |
222 | } | 222 | } |
223 | this.timewindowForm.markAsDirty(); | 223 | this.timewindowForm.markAsDirty(); |
224 | } | 224 | } |
225 | 225 | ||
226 | onHideAggIntervalChanged() { | 226 | onHideAggIntervalChanged() { |
227 | if (this.timewindow.hideAggInterval) { | 227 | if (this.timewindow.hideAggInterval) { |
228 | - this.timewindowForm.get('aggregation').get('limit').disable({emitEvent: false}); | 228 | + this.timewindowForm.get('aggregation.limit').disable({emitEvent: false}); |
229 | } else { | 229 | } else { |
230 | - this.timewindowForm.get('aggregation').get('limit').enable({emitEvent: false}); | 230 | + this.timewindowForm.get('aggregation.limit').enable({emitEvent: false}); |
231 | } | 231 | } |
232 | this.timewindowForm.markAsDirty(); | 232 | this.timewindowForm.markAsDirty(); |
233 | } | 233 | } |