From dab5101b88d87fa08a8934cc4486a3b1b7274324 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 22 Feb 2023 11:02:24 +0200 Subject: [PATCH] RED-6154 - add an unique id for each button/action in the UI --- .../components/base-screen/base-screen.component.html | 2 +- .../dashboard-screen/dashboard-screen.component.html | 4 ++-- .../components/donut-chart/donut-chart.component.html | 1 + .../dossiers-type-switch.component.html | 9 ++++++++- .../src/lib/dossier-templates/dashboard-stats.model.ts | 6 ++++-- libs/red-domain/src/lib/shared/charts.ts | 1 + 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index b35ce4371..4fffdc4e0 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -27,7 +27,7 @@ [placeholder]="'search.placeholder' | translate" > - + diff --git a/apps/red-ui/src/app/modules/dashboard/dashboard-screen/dashboard-screen.component.html b/apps/red-ui/src/app/modules/dashboard/dashboard-screen/dashboard-screen.component.html index bd997523f..f95bbf6ad 100644 --- a/apps/red-ui/src/app/modules/dashboard/dashboard-screen/dashboard-screen.component.html +++ b/apps/red-ui/src/app/modules/dashboard/dashboard-screen/dashboard-screen.component.html @@ -10,8 +10,8 @@
diff --git a/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html b/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html index d4956da47..ade5095d8 100644 --- a/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html +++ b/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html @@ -36,6 +36,7 @@ *ngFor="let val of config" [class.active]="filterChecked$(val.key) | async" [class.filter-disabled]="!val.key || !(filters$ | async).length" + [id]="val.id" > - @@ -9,6 +15,7 @@ [routerLink]="['..', ARCHIVE_ROUTE]" [iqserHelpMode]="'dossier_list'" class="red-tab" + id="archived-button" > {{ 'dossiers-type-switch.archive' | translate }} diff --git a/libs/red-domain/src/lib/dossier-templates/dashboard-stats.model.ts b/libs/red-domain/src/lib/dossier-templates/dashboard-stats.model.ts index 4f2d6fee9..a70f48b9f 100644 --- a/libs/red-domain/src/lib/dossier-templates/dashboard-stats.model.ts +++ b/libs/red-domain/src/lib/dossier-templates/dashboard-stats.model.ts @@ -60,7 +60,8 @@ export class DashboardStats implements IListable, IDashboardStats { } get #dossiersChartConfig(): DonutChartConfig[] { - return this.dossierCountByStatus.map(d => ({ + return this.dossierCountByStatus.map((d, index) => ({ + id: `dossier-chart-filter-${index}`, value: d.count, color: '#e2e4e9', label: 'dossier-state.placeholder', @@ -69,7 +70,8 @@ export class DashboardStats implements IListable, IDashboardStats { } get #documentsChartConfig(): DonutChartConfig[] { - const configArray: DonutChartConfig[] = this.fileCountPerWorkflowStatus.map(d => ({ + const configArray: DonutChartConfig[] = this.fileCountPerWorkflowStatus.map((d, index) => ({ + id: `document-chart-filter-${index}`, value: d.count, color: d.workflowStatus, label: d.workflowStatus, diff --git a/libs/red-domain/src/lib/shared/charts.ts b/libs/red-domain/src/lib/shared/charts.ts index 6865ae089..b696e3d3f 100644 --- a/libs/red-domain/src/lib/shared/charts.ts +++ b/libs/red-domain/src/lib/shared/charts.ts @@ -6,4 +6,5 @@ export interface DonutChartConfig { label: string; key?: string; active?: boolean; + id?: string; }