From 123154ba101e8611bfdcee2f4780b3702ee7c1ab Mon Sep 17 00:00:00 2001 From: Abu Sadaf <116058905+sadaf895@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:57:01 +0530 Subject: [PATCH] feat(core): make subtitle and explanation for all dashboard widgets overwritable via config (#2656) closes #2594 --- .../important-notes-dashboard.component.html | 4 ++-- .../important-notes-dashboard.component.ts | 5 +++++ src/app/core/config/config-fix.ts | 1 - .../birthday-dashboard/birthday-dashboard.component.html | 4 ++-- .../birthday-dashboard/birthday-dashboard.component.ts | 4 ++++ .../entity-count-dashboard.component.html | 3 ++- .../entity-count-dashboard.component.ts | 4 ++++ .../progress-dashboard/progress-dashboard.component.html | 3 ++- .../progress-dashboard/progress-dashboard.component.ts | 5 +++++ .../shortcut-dashboard/shortcut-dashboard.component.html | 7 ++----- .../shortcut-dashboard/shortcut-dashboard.component.ts | 5 +++++ .../todos/todos-dashboard/todos-dashboard.component.html | 4 ++-- .../todos/todos-dashboard/todos-dashboard.component.ts | 6 +++++- 13 files changed, 40 insertions(+), 15 deletions(-) diff --git a/src/app/child-dev-project/notes/dashboard-widgets/important-notes-dashboard/important-notes-dashboard.component.html b/src/app/child-dev-project/notes/dashboard-widgets/important-notes-dashboard/important-notes-dashboard.component.html index f89fb3b836..c92ba45aac 100644 --- a/src/app/child-dev-project/notes/dashboard-widgets/important-notes-dashboard/important-notes-dashboard.component.html +++ b/src/app/child-dev-project/notes/dashboard-widgets/important-notes-dashboard/important-notes-dashboard.component.html @@ -1,7 +1,7 @@
diff --git a/src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard/birthday-dashboard.component.ts b/src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard/birthday-dashboard.component.ts index 6e736f5a4c..a96942312e 100644 --- a/src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard/birthday-dashboard.component.ts +++ b/src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard/birthday-dashboard.component.ts @@ -55,6 +55,10 @@ export class BirthdayDashboardComponent entries: EntityWithBirthday[]; + @Input() subtitle: string = + $localize`:dashboard widget subtitle:Upcoming Birthdays`; + @Input() explanation: string; + constructor(private entityMapper: EntityMapperService) { super(); this.today = new Date(); diff --git a/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.html b/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.html index 81b163166e..ffd4212140 100644 --- a/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.html +++ b/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.html @@ -2,7 +2,8 @@ [icon]="entityIcon" theme="child" [title]="totalEntities" - [subtitle]="label" + [subtitle]="subtitle ?? label" + [explanation]="explanation" [entries]="entityGroupCounts[groupBy[currentGroupIndex]]" [paginationPageSize]="4" > diff --git a/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts b/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts index 0b10131ed6..a395342e34 100644 --- a/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts +++ b/src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts @@ -121,6 +121,10 @@ export class EntityCountDashboardComponent label: string; entityIcon: IconName; + @Input() subtitle: string; + @Input() explanation: string = + $localize`:dashboard widget explanation:Counting all "active" records. If configured, you can view different disaggregations by using the arrows below.`; + constructor( private entityMapper: EntityMapperService, private router: Router, diff --git a/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.html b/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.html index d06224038c..87c0d173cd 100644 --- a/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.html +++ b/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.html @@ -2,7 +2,8 @@
diff --git a/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.ts b/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.ts index 841f74e859..62049eaeb2 100644 --- a/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.ts +++ b/src/app/features/dashboard-widgets/progress-dashboard-widget/progress-dashboard/progress-dashboard.component.ts @@ -43,6 +43,11 @@ export class ProgressDashboardComponent @Input() dashboardConfigId = ""; data: ProgressDashboardConfig; + @Input() subtitle: string = + $localize`:dashboard widget subtitle: Progress Overview`; + @Input() explanation: string = + $localize`:dashboard widget explanation: Shows the progress of different parts of project tasks. You can use this to track any kind of targets.`; + constructor( private entityMapper: EntityMapperService, private dialog: MatDialog, diff --git a/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.html b/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.html index d98bf1f2fe..c408e91aca 100644 --- a/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.html +++ b/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.html @@ -1,11 +1,8 @@
diff --git a/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.ts b/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.ts index 738c19e6ea..623d2483ed 100644 --- a/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.ts +++ b/src/app/features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard/shortcut-dashboard.component.ts @@ -44,6 +44,11 @@ export class ShortcutDashboardComponent { } _shortcuts: MenuItem[] = []; + @Input() subtitle: string = + $localize`:dashboard widget subtitle:Quick Actions`; + @Input() explanation: string = + $localize`:dashboard widget explanation:Shortcuts to quickly navigate to common actions`; + constructor( private routePermissionsService: RoutePermissionsService, private locationStrategy: LocationStrategy, diff --git a/src/app/features/todos/todos-dashboard/todos-dashboard.component.html b/src/app/features/todos/todos-dashboard/todos-dashboard.component.html index a53b962f9e..c664e5e65b 100644 --- a/src/app/features/todos/todos-dashboard/todos-dashboard.component.html +++ b/src/app/features/todos/todos-dashboard/todos-dashboard.component.html @@ -1,7 +1,7 @@