Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring

This commit is contained in:
mchouliara 2024-09-02 10:44:49 +03:00
commit 60308a7029
2 changed files with 4 additions and 2 deletions

View File

@ -62,6 +62,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
nameof<DescriptionTemplate>(x => x.description), nameof<DescriptionTemplate>(x => x.description),
nameof<DescriptionTemplate>(x => x.status), nameof<DescriptionTemplate>(x => x.status),
nameof<DescriptionTemplate>(x => x.version), nameof<DescriptionTemplate>(x => x.version),
nameof<DescriptionTemplate>(x => x.versionStatus),
nameof<DescriptionTemplate>(x => x.groupId), nameof<DescriptionTemplate>(x => x.groupId),
nameof<DescriptionTemplate>(x => x.updatedAt), nameof<DescriptionTemplate>(x => x.updatedAt),
nameof<DescriptionTemplate>(x => x.createdAt), nameof<DescriptionTemplate>(x => x.createdAt),
@ -220,7 +221,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
} }
public canAddNewVersion(descriptionTemplate: DescriptionTemplate): boolean { public canAddNewVersion(descriptionTemplate: DescriptionTemplate): boolean {
return descriptionTemplate.belongsToCurrentTenant != false && descriptionTemplate.isActive == IsActive.Active && this.canCreateNew(); return descriptionTemplate.versionStatus == DescriptionTemplateVersionStatus.Current && descriptionTemplate.status == DescriptionTemplateStatus.Finalized && descriptionTemplate.belongsToCurrentTenant != false && descriptionTemplate.isActive == IsActive.Active && this.canCreateNew();
} }
public canClone(descriptionTemplate: DescriptionTemplate): boolean { public canClone(descriptionTemplate: DescriptionTemplate): boolean {

View File

@ -59,6 +59,7 @@ export class PlanBlueprintListingComponent extends BaseListingComponent<PlanBlue
nameof<PlanBlueprint>(x => x.code), nameof<PlanBlueprint>(x => x.code),
nameof<PlanBlueprint>(x => x.status), nameof<PlanBlueprint>(x => x.status),
nameof<PlanBlueprint>(x => x.version), nameof<PlanBlueprint>(x => x.version),
nameof<PlanBlueprint>(x => x.versionStatus),
nameof<PlanBlueprint>(x => x.groupId), nameof<PlanBlueprint>(x => x.groupId),
nameof<PlanBlueprint>(x => x.updatedAt), nameof<PlanBlueprint>(x => x.updatedAt),
nameof<PlanBlueprint>(x => x.createdAt), nameof<PlanBlueprint>(x => x.createdAt),
@ -108,7 +109,7 @@ export class PlanBlueprintListingComponent extends BaseListingComponent<PlanBlue
} }
protected canCreateNewVersion(blueprint: PlanBlueprint): boolean { protected canCreateNewVersion(blueprint: PlanBlueprint): boolean {
return blueprint?.belongsToCurrentTenant != false && (blueprint?.status === PlanBlueprintStatus.Finalized || blueprint?.status == null) && blueprint?.isActive === IsActive.Active; return blueprint?.status === PlanBlueprintStatus.Finalized && blueprint?.versionStatus == PlanBlueprintVersionStatus.Current && blueprint?.belongsToCurrentTenant != false && blueprint?.isActive === IsActive.Active;
} }
protected canDelete(blueprint: PlanBlueprint): boolean { protected canDelete(blueprint: PlanBlueprint): boolean {