diff --git a/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.html b/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.html index 4b6dfbd6dc..4e068d075f 100644 --- a/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.html +++ b/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.html @@ -29,8 +29,8 @@ mat-flat-button class="ft-14-600 button" (click)="deleteSegment()" - [ngClass]="{ 'button--disabled': (permissions && !permissions.segments.delete) || segmentUsed }" - [disabled]="(permissions && !permissions.segments.delete) || segmentUsed" + [ngClass]="{ 'button--disabled': segment.type === SegmentType.GLOBAL_EXCLUDE || segmentUsed || !permissions?.segments.delete }" + [disabled]="segment.type === SegmentStatus.GLOBAL_EXCLUDE || segmentUsed || !permissions?.segments.delete" > {{ 'global.delete.text' | translate }} @@ -40,8 +40,8 @@ mat-flat-button class="ft-14-600 button-long" (click)="duplicateSegmentDialog()" - [ngClass]="{ 'button-long--disabled': segment?.type == 'global_exclude' }" - [disabled]="segment?.type == 'global_exclude'" + [ngClass]="{ 'button-long--disabled': segment.type == SegmentType.GLOBAL_EXCLUDE }" + [disabled]="segment.type == SegmentType.GLOBAL_EXCLUDE" > {{ 'global.duplicate.text' | translate }} diff --git a/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.ts b/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.ts index 61a31c24b1..0c523b3380 100644 --- a/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.ts +++ b/frontend/projects/upgrade/src/app/features/dashboard/segments/pages/view-segment/view-segment.component.ts @@ -43,6 +43,10 @@ export class ViewSegmentComponent implements OnInit, OnDestroy { return SEGMENT_STATUS; } + get SegmentType() { + return SEGMENT_TYPE; + } + get SegmentStatusPipeTypes() { return SegmentStatusPipeType; } @@ -62,7 +66,6 @@ export class ViewSegmentComponent implements OnInit, OnDestroy { .subscribe((segment) => { this.segment = { ...segment, status: segment.status || SEGMENT_STATUS.UNUSED }; - this.permissions.segments.delete = this.segment.type !== SEGMENT_TYPE.GLOBAL_EXCLUDE; this.members = []; this.segment.individualForSegment.forEach((user) => { this.members.push({ type: MemberTypes.INDIVIDUAL, id: user.userId });