diff --git a/CHANGELOG.md b/CHANGELOG.md index f3243e2ae..f67b26633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `FINANCIAL_MODELING_PREP` as a new data source type +### Fixed + +- Improved the _Select all_ activities checkbox state after importing activities including a duplicate + +## Unreleased + ### Changed - Improved the market price on the first buy date in the chart of the position detail dialog diff --git a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts index 581160752..04efb7a56 100644 --- a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts @@ -235,8 +235,10 @@ export class ImportActivitiesDialog implements OnDestroy { input.click(); } - public updateSelection(data: Activity[]) { - this.selectedActivities = data; + public updateSelection(activities: Activity[]) { + this.selectedActivities = activities.filter(({ isDuplicate }) => { + return !isDuplicate; + }); } public ngOnDestroy() { diff --git a/libs/ui/src/lib/activities-table/activities-table.component.html b/libs/ui/src/lib/activities-table/activities-table.component.html index 45551305b..b4dc5c404 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.html +++ b/libs/ui/src/lib/activities-table/activities-table.component.html @@ -77,7 +77,12 @@ diff --git a/libs/ui/src/lib/activities-table/activities-table.component.ts b/libs/ui/src/lib/activities-table/activities-table.component.ts index 0ba6e4f58..63d8811a6 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.ts @@ -66,6 +66,7 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy, OnInit { public endOfToday = endOfToday(); public filters$ = new Subject(); public hasDrafts = false; + public hasDuplicateActivity = false; public isAfter = isAfter; public isLoading = true; public isUUID = isUUID; @@ -97,6 +98,10 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy, OnInit { this.selectedActivities.emit(selectedRows.source.selected); }); } + + this.hasDuplicateActivity = this.activities.some(({ isDuplicate }) => { + return isDuplicate; + }); } public areAllRowsSelected() {