From 122ca092ad31ad0e7dd1312555875b9dc233081d Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Tue, 17 Sep 2024 17:33:43 +0300 Subject: [PATCH 1/3] UI: Fixed next btn for notify again dialog --- .../src/app/shared/components/entity/entity-list.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts index 2108551031..c06569e0b9 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts +++ b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts @@ -196,8 +196,8 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV this.entityListFormGroup.get('entities').setValue(this.entities); if (this.syncIdsWithDB && this.modelValue.length !== entities.length) { this.modelValue = entities.map(entity => entity.id.id); - this.propagateChange(this.modelValue); } + this.propagateChange(this.modelValue); } ); } else { From fd8107aa90415aca881d29b40d2fbf081475b3ca Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Wed, 18 Sep 2024 12:19:12 +0300 Subject: [PATCH 2/3] UI: Refactoring --- .../app/shared/components/entity/entity-list.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts index c06569e0b9..a9aae0c9ce 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts +++ b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts @@ -46,6 +46,7 @@ import { MatChipGrid } from '@angular/material/chips'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { SubscriptSizing } from '@angular/material/form-field'; import { coerceBoolean } from '@shared/decorators/coercion'; +import { isArray } from 'lodash'; @Component({ selector: 'tb-entity-list', @@ -196,8 +197,8 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV this.entityListFormGroup.get('entities').setValue(this.entities); if (this.syncIdsWithDB && this.modelValue.length !== entities.length) { this.modelValue = entities.map(entity => entity.id.id); + this.propagateChange(this.modelValue); } - this.propagateChange(this.modelValue); } ); } else { @@ -209,7 +210,7 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV } validate(): ValidationErrors | null { - return this.entityListFormGroup.valid ? null : { + return isArray(this.modelValue) && this.modelValue.length ? null : { entities: {valid: false} }; } From 027d4eeeab00c18b1e5e736535447323883ef89c Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Mon, 23 Sep 2024 14:43:22 +0300 Subject: [PATCH 3/3] UI: Refactoring for required --- .../src/app/shared/components/entity/entity-list.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts index a9aae0c9ce..cfb0f19b1b 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts +++ b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts @@ -210,7 +210,7 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV } validate(): ValidationErrors | null { - return isArray(this.modelValue) && this.modelValue.length ? null : { + return (isArray(this.modelValue) && this.modelValue.length) || !this.required ? null : { entities: {valid: false} }; }