From 99023ed159cf72bd8d6e824a332c8908cf480dea Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Tue, 17 Sep 2024 10:43:25 +0300 Subject: [PATCH] plan, description status ui fixes --- ...criptionStatusDefinitionAuthorizationItemPersist.java | 2 -- .../PlanStatusDefinitionAuthorizationItemPersist.java | 2 -- .../description-status-editor.component.html | 2 +- .../description-status-editor.model.ts | 2 +- .../description-status-listing.component.html | 9 +-------- .../plan-status-editor/plan-status-editor.component.html | 2 +- .../plan-status-editor/plan-status-editor.model.ts | 2 +- .../plan-status-listing.component.html | 8 +------- 8 files changed, 6 insertions(+), 23 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/model/persist/descriptionstatus/DescriptionStatusDefinitionAuthorizationItemPersist.java b/backend/core/src/main/java/org/opencdmp/model/persist/descriptionstatus/DescriptionStatusDefinitionAuthorizationItemPersist.java index f402d41b3..93976048d 100644 --- a/backend/core/src/main/java/org/opencdmp/model/persist/descriptionstatus/DescriptionStatusDefinitionAuthorizationItemPersist.java +++ b/backend/core/src/main/java/org/opencdmp/model/persist/descriptionstatus/DescriptionStatusDefinitionAuthorizationItemPersist.java @@ -63,8 +63,6 @@ public class DescriptionStatusDefinitionAuthorizationItemPersist { protected List specifications(DescriptionStatusDefinitionAuthorizationItemPersist item) { return Arrays.asList( this.spec() - .must(() -> !this.isListNullOrEmpty(item.getRoles())) - .failOn(PlanStatusDefinitionAuthorizationItemPersist._roles).failWith(messageSource.getMessage("Validation_Required", new Object[]{PlanStatusDefinitionAuthorizationItemPersist._roles}, LocaleContextHolder.getLocale())), this.spec() .must(() -> !this.isListNullOrEmpty(item.getPlanRoles())) .failOn(PlanStatusDefinitionAuthorizationItemPersist._planRoles).failWith(messageSource.getMessage("Validation_Required", new Object[]{PlanStatusDefinitionAuthorizationItemPersist._planRoles}, LocaleContextHolder.getLocale())) ); diff --git a/backend/core/src/main/java/org/opencdmp/model/persist/planstatus/PlanStatusDefinitionAuthorizationItemPersist.java b/backend/core/src/main/java/org/opencdmp/model/persist/planstatus/PlanStatusDefinitionAuthorizationItemPersist.java index 10e4c5df8..7ef9c0d48 100644 --- a/backend/core/src/main/java/org/opencdmp/model/persist/planstatus/PlanStatusDefinitionAuthorizationItemPersist.java +++ b/backend/core/src/main/java/org/opencdmp/model/persist/planstatus/PlanStatusDefinitionAuthorizationItemPersist.java @@ -67,8 +67,6 @@ public class PlanStatusDefinitionAuthorizationItemPersist { protected List specifications(PlanStatusDefinitionAuthorizationItemPersist item) { return Arrays.asList( this.spec() - .must(() -> !this.isListNullOrEmpty(item.getRoles())) - .failOn(PlanStatusDefinitionAuthorizationItemPersist._roles).failWith(messageSource.getMessage("Validation_Required", new Object[]{PlanStatusDefinitionAuthorizationItemPersist._roles}, LocaleContextHolder.getLocale())), this.spec() .must(() -> !this.isListNullOrEmpty(item.getPlanRoles())) .failOn(PlanStatusDefinitionAuthorizationItemPersist._planRoles).failWith(messageSource.getMessage("Validation_Required", new Object[]{PlanStatusDefinitionAuthorizationItemPersist._planRoles}, LocaleContextHolder.getLocale())) ); diff --git a/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.component.html b/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.component.html index c7a43d239..72c7413a8 100644 --- a/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.component.html +++ b/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.component.html @@ -73,7 +73,7 @@
- {{'DESCRIPTION-STATUS-EDITOR.FIELDS.ROLES' | translate}}* + {{'DESCRIPTION-STATUS-EDITOR.FIELDS.ROLES' | translate}} {{enumUtils.toAppRoleString(userRole)}} diff --git a/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts b/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts index 13b9db7f5..86f1f1eb3 100644 --- a/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts +++ b/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts @@ -84,7 +84,7 @@ export class DescriptionStatusEditorModel extends BaseEditorModel implements Des baseValidationArray.push({ key: 'allowAnonymous', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}allowAnonymous`)] }); baseValidationArray.push({ key: 'allowAuthenticated', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}allowAuthenticated`)] }); baseValidationArray.push({ key: 'planRoles', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}planRoles`)] }); - baseValidationArray.push({ key: 'roles', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}roles`)] }); + baseValidationArray.push({ key: 'roles', validators: [BackendErrorValidator(this.validationErrorModel, `${rootPath}roles`)] }); baseContext.validation = baseValidationArray; return baseContext; diff --git a/frontend/src/app/ui/admin/description-status/listing/description-status-listing/description-status-listing.component.html b/frontend/src/app/ui/admin/description-status/listing/description-status-listing/description-status-listing.component.html index 09a535ed6..08c65c462 100644 --- a/frontend/src/app/ui/admin/description-status/listing/description-status-listing/description-status-listing.component.html +++ b/frontend/src/app/ui/admin/description-status/listing/description-status-listing/description-status-listing.component.html @@ -38,14 +38,7 @@
-
- {{enumUtils.toDescriptionStatusString(row.internalStatus)}} -
+ {{enumUtils.toDescriptionStatusString(row.internalStatus)}}
diff --git a/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.component.html b/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.component.html index d24c9095c..081b4b1c4 100644 --- a/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.component.html +++ b/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.component.html @@ -73,7 +73,7 @@
- {{'PLAN-STATUS-EDITOR.FIELDS.ROLES' | translate}}* + {{'PLAN-STATUS-EDITOR.FIELDS.ROLES' | translate}} {{enumUtils.toAppRoleString(userRole)}} diff --git a/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts b/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts index 5fd0ce7cc..56e2afc38 100644 --- a/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts +++ b/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts @@ -85,7 +85,7 @@ export class PlanStatusEditorModel extends BaseEditorModel implements PlanStatus baseValidationArray.push({ key: 'allowAnonymous', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}allowAnonymous`)] }); baseValidationArray.push({ key: 'allowAuthenticated', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}allowAuthenticated`)] }); baseValidationArray.push({ key: 'planRoles', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}planRoles`)] }); - baseValidationArray.push({ key: 'roles', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, `${rootPath}roles`)] }); + baseValidationArray.push({ key: 'roles', validators: [BackendErrorValidator(this.validationErrorModel, `${rootPath}roles`)] }); baseContext.validation = baseValidationArray; return baseContext; diff --git a/frontend/src/app/ui/admin/plan-status/listing/plan-status-listing/plan-status-listing.component.html b/frontend/src/app/ui/admin/plan-status/listing/plan-status-listing/plan-status-listing.component.html index 004000c49..7bae0856e 100644 --- a/frontend/src/app/ui/admin/plan-status/listing/plan-status-listing/plan-status-listing.component.html +++ b/frontend/src/app/ui/admin/plan-status/listing/plan-status-listing/plan-status-listing.component.html @@ -38,13 +38,7 @@
-
- {{enumUtils.toPlanStatusString(row.internalStatus)}} -
+ {{enumUtils.toPlanStatusString(row.internalStatus)}}