diff --git a/smp-angular/src/app/system-settings/admin-domain/domain-panel/domain-panel.component.ts b/smp-angular/src/app/system-settings/admin-domain/domain-panel/domain-panel.component.ts index 9fded1fc62377aa052fbce3d64f8da3c752c3b11..6d6735d2e80eec94f46a2e325521f47551e831ef 100644 --- a/smp-angular/src/app/system-settings/admin-domain/domain-panel/domain-panel.component.ts +++ b/smp-angular/src/app/system-settings/admin-domain/domain-panel/domain-panel.component.ts @@ -18,7 +18,7 @@ export class DomainPanelComponent implements BeforeLeaveGuard { @Output() onSaveBasicDataEvent: EventEmitter<DomainRo> = new EventEmitter(); @Output() onDiscardNew: EventEmitter<any> = new EventEmitter(); - readonly warningTimeout: number = 50000; + readonly warningTimeout: number = 3000; readonly domainCodePattern = '^[a-zA-Z0-9]{1,63}$'; readonly domainVisibilityOptions = Object.keys(VisibilityEnum) .map(el => { @@ -60,8 +60,15 @@ export class DomainPanelComponent implements BeforeLeaveGuard { * @param value */ onFieldKeyPressed(controlName: string, showTheWarningReference: string) { + + if (this.domainForm.controls['domainCode'].hasError('pattern')) { + // already visible error - skip the length validation + return; + } + let value = this.domainForm.get(controlName).value + if (!!value && value.length >= 63 && !this.fieldWarningTimeoutMap[showTheWarningReference]) { this.fieldWarningTimeoutMap[showTheWarningReference] = setTimeout(() => { this.fieldWarningTimeoutMap[showTheWarningReference] = null;