develop #5
|
@ -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>
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue