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 93976048d..2fda7fca8 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 @@ -62,9 +62,6 @@ public class DescriptionStatusDefinitionAuthorizationItemPersist { @Override protected List specifications(DescriptionStatusDefinitionAuthorizationItemPersist item) { return Arrays.asList( - 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 7ef9c0d48..1c30f022c 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 @@ -66,9 +66,6 @@ public class PlanStatusDefinitionAuthorizationItemPersist { @Override protected List specifications(PlanStatusDefinitionAuthorizationItemPersist item) { return Arrays.asList( - 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 bb61d6afb..d4fa4c4cd 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 @@ -103,7 +103,7 @@
- {{'DESCRIPTION-STATUS-EDITOR.FIELDS.PLAN-ROLES' | translate}}* + {{'DESCRIPTION-STATUS-EDITOR.FIELDS.PLAN-ROLES' | translate}} {{enumUtils.toPlanUserRoleString(planRole)}} 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 54975ddd8..20e476240 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 @@ -90,7 +90,7 @@ export class DescriptionStatusEditorModel extends BaseEditorModel implements Des const baseValidationArray: Validation[] = new Array(); 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: 'planRoles', validators: [ BackendErrorValidator(this.validationErrorModel, `${rootPath}planRoles`)] }); baseValidationArray.push({ key: 'roles', validators: [BackendErrorValidator(this.validationErrorModel, `${rootPath}roles`)] }); baseContext.validation = baseValidationArray; 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 ed16242e9..d898ca1da 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 @@ -101,7 +101,7 @@
- {{'PLAN-STATUS-EDITOR.FIELDS.PLAN-ROLES' | translate}}* + {{'PLAN-STATUS-EDITOR.FIELDS.PLAN-ROLES' | translate}} {{enumUtils.toPlanUserRoleString(planRole)}} 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 05e86971b..1b07af72b 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 @@ -91,7 +91,7 @@ export class PlanStatusEditorModel extends BaseEditorModel implements PlanStatus const baseValidationArray: Validation[] = new Array(); 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: 'planRoles', validators: [BackendErrorValidator(this.validationErrorModel, `${rootPath}planRoles`)] }); baseValidationArray.push({ key: 'roles', validators: [BackendErrorValidator(this.validationErrorModel, `${rootPath}roles`)] }); baseContext.validation = baseValidationArray; diff --git a/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts b/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts index 68293bae0..b322baba2 100644 --- a/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts +++ b/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts @@ -66,7 +66,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { } get canClonePlan(): boolean { - return this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan) || (this.authentication.hasPermission(AppPermission.PublicClonePlan) && this.isPublic); + return this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan) || (this.authentication.hasPermission(AppPermission.PublicClonePlan)) && !this.isDeleted; } get canFinalizePlan(): boolean { @@ -74,7 +74,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { } get canExportPlan(): boolean { - return (this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan)) && this.isPublic && + return (this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan)) && !this.isDeleted && this.plan.status?.definition?.availableActions?.filter(x => x === PlanStatusAvailableActionType.Export).length > 0;; } @@ -127,7 +127,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { this.isPublished = false; if (this.plan.status.internalStatus === PlanStatusEnum.Finalized && this.plan.accessType === PlanAccessType.Public) { this.isPublished = true } } - if (this.plan.isActive != IsActive.Active) { + if (this.plan.isActive === IsActive.Inactive) { this.isDeleted = true; } }