Browse Source

Task/add activity count to delete menu item and confirmation dialog of activities table component (#7489)

* Add activity count to delete menu and confirmation dialog

* Update changelog
pull/7480/head^2
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
eb62190c74
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 11
      libs/ui/src/lib/activities-table/activities-table.component.html
  3. 12
      libs/ui/src/lib/activities-table/activities-table.component.ts

2
CHANGELOG.md

@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the style of the tabs in the holding detail dialog on mobile - Improved the style of the tabs in the holding detail dialog on mobile
- Improved the style of the tabs in the asset profile dialog of the admin control panel on mobile - Improved the style of the tabs in the asset profile dialog of the admin control panel on mobile
- Improved the style of the empty state in the _Fear & Greed Index_ component - Improved the style of the empty state in the _Fear & Greed Index_ component
- Added the activity count to the delete menu item of the activities table
- Added the activity count to the deletion confirmation dialog of the activities table
- Improved the style of the type filter in the activities table component (experimental) - Improved the style of the type filter in the activities table component (experimental)
- Improved the performance of the property service by caching the properties in memory - Improved the performance of the property service by caching the properties in memory
- Improved the language localization for German (`de`) - Improved the language localization for German (`de`)

11
libs/ui/src/lib/activities-table/activities-table.component.html

@ -84,14 +84,19 @@
<button <button
class="align-items-center d-flex" class="align-items-center d-flex"
mat-menu-item mat-menu-item
[disabled]=" [disabled]="!canDeleteActivities()"
dataSource()?.data.length === 0 || !hasPermissionToDeleteActivity
"
(click)="onDeleteActivities()" (click)="onDeleteActivities()"
> >
<span class="align-items-center d-flex"> <span class="align-items-center d-flex">
<ion-icon class="mr-2" name="trash-outline" /> <ion-icon class="mr-2" name="trash-outline" />
@if (canDeleteActivities()) {
<span i18n
>Delete {{ totalItems > 1 ? totalItems : '' }}
{totalItems, plural, =1 {Activity} other {Activities}}</span
>
} @else {
<span i18n>Delete Activities</span> <span i18n>Delete Activities</span>
}
</span> </span>
</button> </button>
</mat-menu> </mat-menu>

12
libs/ui/src/lib/activities-table/activities-table.component.ts

@ -282,6 +282,13 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit {
); );
} }
public canDeleteActivities() {
return (
(this.dataSource()?.data.length ?? 0) > 0 &&
this.hasPermissionToDeleteActivity
);
}
public isExcludedFromAnalysis(activity: Activity) { public isExcludedFromAnalysis(activity: Activity) {
return ( return (
(activity.account && isAccountExcluded(activity.account)) ?? (activity.account && isAccountExcluded(activity.account)) ??
@ -314,7 +321,10 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit {
this.activitiesDeleted.emit(); this.activitiesDeleted.emit();
}, },
confirmType: ConfirmationDialogType.Warn, confirmType: ConfirmationDialogType.Warn,
title: $localize`Do you really want to delete these activities?` title:
this.totalItems === 1
? $localize`Do you really want to delete this activity?`
: $localize`Do you really want to delete these ${this.totalItems}:count: activities?`
}); });
} }

Loading…
Cancel
Save