remove edit actions from public plans/descriptions, small change in styles

This commit is contained in:
mchouliara 2024-09-02 11:41:13 +03:00
parent c377153de7
commit 2b39cae424
3 changed files with 11 additions and 15 deletions

View File

@ -90,13 +90,13 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
this.isDeleted = false; this.isDeleted = false;
} }
this.canDelete = (this.authService.hasPermission(AppPermission.DeleteDescription) || this.canDelete = !this.isPublic && (this.authService.hasPermission(AppPermission.DeleteDescription) ||
this.description.authorizationFlags?.some(x => x === AppPermission.DeleteDescription)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.DeleteDescription)) && this.description.belongsToCurrentTenant != false;
this.canEdit = (this.authService.hasPermission(AppPermission.EditDescription) || this.canEdit = !this.isPublic && (this.authService.hasPermission(AppPermission.EditDescription) ||
this.description.authorizationFlags?.some(x => x === AppPermission.EditDescription)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.EditDescription)) && this.description.belongsToCurrentTenant != false;
this.canInvitePlanUsers = (this.authService.hasPermission(AppPermission.InvitePlanUsers) || this.canInvitePlanUsers = !this.isPublic && (this.authService.hasPermission(AppPermission.InvitePlanUsers) ||
this.description.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers)) && this.description.belongsToCurrentTenant != false; this.description.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers)) && this.description.belongsToCurrentTenant != false;
} }

View File

@ -237,15 +237,15 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
} }
canEditPlan(): boolean { canEditPlan(): boolean {
return (this.isDraft) && (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; return (this.isDraft) && (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && !this.isPublic && this.plan.belongsToCurrentTenant != false;
} }
canCreateNewVersion(): boolean { canCreateNewVersion(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublic == false && this.plan.belongsToCurrentTenant != false; return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && !this.isPublic && this.plan.belongsToCurrentTenant != false;
} }
canDeletePlan(): boolean { canDeletePlan(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && !this.isPublic && this.plan.belongsToCurrentTenant != false;
} }
canClonePlan(): boolean { canClonePlan(): boolean {
@ -253,7 +253,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
} }
canFinalizePlan(): boolean { canFinalizePlan(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && !this.isPublic && this.plan.belongsToCurrentTenant != false;
} }
canExportPlan(): boolean { canExportPlan(): boolean {
@ -261,10 +261,10 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
} }
canInvitePlanUsers(): boolean { canInvitePlanUsers(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && !this.isPublic && this.plan.belongsToCurrentTenant != false;
} }
canAssignPlanUsers(): boolean { canAssignPlanUsers(): boolean {
return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && !this.isPublic && this.plan.belongsToCurrentTenant != false;
} }
} }

View File

@ -401,11 +401,12 @@ $mat-dark-theme: mat.m2-define-dark-theme((color: (primary: $mat-dark-theme-prim
@include mat.all-component-densities(-10); @include mat.all-component-densities(-10);
} }
button,.mdc-button,.mat-mdc-button, .mdc-button:has(.material-icons,mat-icon,[matButtonIcon]) { button,.mdc-button,.mat-mdc-button, .mdc-button:has(.material-icons,mat-icon,[matButtonIcon]), .md-button {
&.rounded-btn{ &.rounded-btn{
font-size: 0.87rem; font-size: 0.87rem;
padding: 0.62rem 1.87rem; padding: 0.62rem 1.87rem;
height: 40px; height: 40px;
font-weight: 400;
border-radius: 30px; border-radius: 30px;
border: none; border: none;
@ -465,11 +466,6 @@ button,.mdc-button,.mat-mdc-button, .mdc-button:has(.material-icons,mat-icon,[ma
border: 0px; border: 0px;
} }
} }
&.md-button {
padding: 0.62rem 1.87rem;
font-weight: 400;
}
&.mat-mdc-button.mat-mdc-button-disabled { &.mat-mdc-button.mat-mdc-button-disabled {
background-color: #CBCBCB; //!important background-color: #CBCBCB; //!important