new-version action fix

This commit is contained in:
CITE\spapacharalampous 2024-09-02 10:23:44 +03:00
parent 398a2059ad
commit c1d062c66f
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.status),
nameof<DescriptionTemplate>(x => x.version),
nameof<DescriptionTemplate>(x => x.versionStatus),
nameof<DescriptionTemplate>(x => x.groupId),
nameof<DescriptionTemplate>(x => x.updatedAt),
nameof<DescriptionTemplate>(x => x.createdAt),
@ -220,7 +221,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
}
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 {

View File

@ -59,6 +59,7 @@ export class PlanBlueprintListingComponent extends BaseListingComponent<PlanBlue
nameof<PlanBlueprint>(x => x.code),
nameof<PlanBlueprint>(x => x.status),
nameof<PlanBlueprint>(x => x.version),
nameof<PlanBlueprint>(x => x.versionStatus),
nameof<PlanBlueprint>(x => x.groupId),
nameof<PlanBlueprint>(x => x.updatedAt),
nameof<PlanBlueprint>(x => x.createdAt),
@ -108,7 +109,7 @@ export class PlanBlueprintListingComponent extends BaseListingComponent<PlanBlue
}
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 {