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 a2437f2329..3fc2d14384 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 }" - [disabled]="permissions && !permissions.segments.delete" + [ngClass]="{ 'button--disabled': permissions && !permissions.segments.delete || segmentUsed }" + [disabled]="permissions && !permissions.segments.delete || segmentUsed" > {{ 'global.delete.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 8356489a67..b5c4090533 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 @@ -25,6 +25,7 @@ export class ViewSegmentComponent implements OnInit, OnDestroy { segment: Segment; segmentSub: Subscription; members: { type: string; id: string }[] = []; + segmentUsed: boolean; displayedVariationColumns: string[] = ['value', 'name']; @@ -60,6 +61,8 @@ export class ViewSegmentComponent implements OnInit, OnDestroy { this.members.push({ type: MemberTypes.SEGMENT, id: subSegment.name }); }); }); + + this.segmentUsed = this.segment?.status === SEGMENT_STATUS.USED; } openEditSegmentDialog() {