feature/2-secure-configurations #2

Merged
william merged 4 commits from feature/2-secure-configurations into develop 2021-08-09 22:16:29 -04:00
3 changed files with 6 additions and 2 deletions
Showing only changes of commit 7bed986536 - Show all commits

View File

@ -4,7 +4,7 @@
<cre-primary-button routerLink="/color">Retour</cre-primary-button>
</cre-action-group>
<cre-action-group>
<cre-accent-button type="submit" (click)="onSubmit()">Enregistrer</cre-accent-button>
<cre-accent-button [disabled]="!(form.dirty && form.valid)" (click)="onSubmit()">Enregistrer</cre-accent-button>
</cre-action-group>
</cre-action-bar>

View File

@ -47,6 +47,10 @@ export class CreConfigEditor extends ErrorHandlingComponent {
this.fetchConfigurations(formBuilder)
}
ngOnInit() {
super.ngOnInit()
}
getConfigControl(key: string): ConfigControl {
return {
config: this.configs.get(key),

View File

@ -46,7 +46,7 @@ export class ConfigControl {
}
export function buildFormControl(config: Config): AbstractControl {
return new FormControl({value: config.content, disabled: !config.editable}, Validators.required)
return new FormControl({value: config.content, disabled: !config.editable}, !configKeyIsPassword(config.key) ? Validators.required : null)
}
export function configKeyIsPassword(key: string): boolean {