mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-7765] Improved display mandatory form fields (#7531)
* [MNT-22765] Improved display mandatory form fields * [MNT-22765] added unit tests * [MNT-22765] fixed test with error icon on rest fail * Trigger travis * [MNT-22765] removed underscore from var name * [AAE-7765] removed underscore from unit test * [AAE-7765] fixed css lint * [AAE-7765] fixed e2e error message css class * [AAE-7765] fixed storybook e2e
This commit is contained in:
@@ -83,6 +83,11 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@Input()
|
||||
readOnly = false;
|
||||
|
||||
/** Mark this field as required
|
||||
*/
|
||||
@Input()
|
||||
required = false;
|
||||
|
||||
/** FormControl to list of group */
|
||||
@Input()
|
||||
groupChipsCtrl = new FormControl({ value: '', disabled: false });
|
||||
@@ -121,9 +126,10 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
invalidGroups: IdentityGroupModel[] = [];
|
||||
|
||||
searchGroups$ = new BehaviorSubject<IdentityGroupModel[]>(this.searchGroups);
|
||||
_subscriptAnimationState = 'enter';
|
||||
subscriptAnimationState: string = 'enter';
|
||||
clientId: string;
|
||||
isFocused: boolean;
|
||||
touched: boolean = false;
|
||||
|
||||
validateGroupsMessage: string;
|
||||
searchedValue = '';
|
||||
@@ -472,6 +478,22 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
return this.isValidationEnabled() && this.validationLoading;
|
||||
}
|
||||
|
||||
markAsTouched(): void {
|
||||
this.touched = true;
|
||||
}
|
||||
|
||||
isTouched(): boolean {
|
||||
return this.touched;
|
||||
}
|
||||
|
||||
isSelected(): boolean {
|
||||
return this.selectedGroups && !!this.selectedGroups.length;
|
||||
}
|
||||
|
||||
isDirty(): boolean {
|
||||
return this.isTouched() && !this.isSelected();
|
||||
}
|
||||
|
||||
setFocus(isFocused: boolean) {
|
||||
this.isFocused = isFocused;
|
||||
}
|
||||
|
Reference in New Issue
Block a user