mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-9374] Show validation error on checking and unchecking checkbox
This commit is contained in:
+2
-2
@@ -118,7 +118,7 @@ export class SearchInputControlComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
if (changes['hasLibrariesConstraint'] && !changes['hasLibrariesConstraint'].firstChange && this.searchFieldFormControl.touched) {
|
if (changes['hasLibrariesConstraint'] && !changes['hasLibrariesConstraint'].firstChange) {
|
||||||
this.emitValidationError();
|
this.emitValidationError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ export class SearchInputControlComponent implements OnInit, OnChanges {
|
|||||||
return this.searchTerm.trim()?.length < 2;
|
return this.searchTerm.trim()?.length < 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private emitValidationError(): void {
|
emitValidationError(): void {
|
||||||
const errors = this.searchFieldFormControl.errors;
|
const errors = this.searchFieldFormControl.errors;
|
||||||
if (errors?.whitespace) {
|
if (errors?.whitespace) {
|
||||||
this.validationError.emit('SEARCH.INPUT.WHITESPACE');
|
this.validationError.emit('SEARCH.INPUT.WHITESPACE');
|
||||||
|
|||||||
@@ -211,6 +211,8 @@ export class SearchInputComponent implements OnInit, OnDestroy {
|
|||||||
this.syncInputValues();
|
this.syncInputValues();
|
||||||
this.has400LibraryError = false;
|
this.has400LibraryError = false;
|
||||||
|
|
||||||
|
this.searchInputControl.emitValidationError();
|
||||||
|
|
||||||
if (!this.searchedWord.trim()) {
|
if (!this.searchedWord.trim()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user