Skip to content

Commit 8c9f268

Browse files
committed
add export segment all list design modal
1 parent 8892fd9 commit 8c9f268

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

backend/packages/Upgrade/.env.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TYPEORM_CONNECTION=postgres
2727
TYPEORM_HOST=postgres
2828
TYPEORM_HOSTNAME_REPLICAS=[]
2929
TYPEORM_PORT=5432
30-
TYPEORM_USERNAME=postgres
30+
TYPEORM_USERNAME=doswalt
3131
TYPEORM_PASSWORD=postgres
3232
TYPEORM_DATABASE=postgres
3333
TYPEORM_SYNCHRONIZE=false

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)