Skip to content

Commit 509743d

Browse files
committed
remove .env-test
1 parent 8892fd9 commit 509743d

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

frontend/projects/upgrade/src/app/features/dashboard/segments/pages/segment-details-page/segment-details-page-content/segment-lists-section-card/segment-lists-section-card.component.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { IMenuButtonItem } from 'upgrade_types';
1010
import { SegmentsService } from '../../../../../../../core/segments/segments.service';
1111
import { DialogService } from '../../../../../../../shared/services/common-dialog.service';
1212
import { Segment, SEGMENT_LIST_ACTIONS } from '../../../../../../../core/segments/store/segments.model';
13-
import { Observable } from 'rxjs';
13+
import { Observable, Subscription } from 'rxjs';
1414
import { AuthService } from '../../../../../../../core/auth/auth.service';
1515
import { UserPermission } from '../../../../../../../core/auth/store/auth.models';
1616
import { ParticipantListRowActionEvent } from '../../../../../../../core/feature-flags/store/feature-flags.model';
@@ -36,6 +36,7 @@ export class SegmentListsSectionCardComponent {
3636
permissions$: Observable<UserPermission>;
3737
tableRowCount$ = this.segmentsService.selectSegmentListsLength$;
3838
selectedSegment$ = this.segmentsService.selectedSegment$;
39+
subscriptions = new Subscription();
3940

4041
menuButtonItems: IMenuButtonItem[] = [
4142
{
@@ -78,15 +79,17 @@ export class SegmentListsSectionCardComponent {
7879
}
7980

8081
handleExportAllLists(segment: Segment) {
81-
this.dialogService
82-
.openExportSegmentListsDesignModal()
83-
.afterClosed()
84-
.subscribe((isExportClicked: boolean) => {
85-
if (isExportClicked) {
86-
const subsegmentIds = segment.subSegments.map((subSegment) => subSegment.id);
87-
this.segmentsService.exportSegments(subsegmentIds);
88-
}
89-
});
82+
this.subscriptions.add(
83+
this.dialogService
84+
.openExportSegmentListsDesignModal()
85+
.afterClosed()
86+
.subscribe((isExportClicked: boolean) => {
87+
if (isExportClicked) {
88+
const subsegmentIds = segment.subSegments.map((subSegment) => subSegment.id);
89+
this.segmentsService.exportSegments(subsegmentIds);
90+
}
91+
})
92+
);
9093
}
9194

9295
onSectionCardExpandChange(isSectionCardExpanded: boolean) {
@@ -97,4 +100,8 @@ export class SegmentListsSectionCardComponent {
97100
// This will be implemented later when we implement the table component
98101
console.log('Row action', event, segmentId);
99102
}
103+
104+
onDestroy() {
105+
this.subscriptions.unsubscribe();
106+
}
100107
}

0 commit comments

Comments
 (0)