From 9f756e3547d7ca4d84bbd4fe3ccf22d936bdce0d Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 3 Dec 2020 12:46:38 +0200 Subject: [PATCH] bugfixing --- .../simple-doughnut-chart.component.html | 2 +- .../simple-doughnut-chart.component.ts | 16 +++++++++------- .../project-listing-screen.component.html | 2 +- .../project-listing-screen.component.ts | 1 + .../bulk-actions/bulk-actions.component.html | 12 +++++++----- .../bulk-actions/bulk-actions.component.ts | 14 +------------- .../project-details.component.html | 2 +- .../project-details/project-details.component.ts | 1 + 8 files changed, 22 insertions(+), 28 deletions(-) diff --git a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html b/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html index ad26509e7..3be8e3cd5 100644 --- a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html +++ b/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html @@ -24,7 +24,7 @@
-
+
({ + ...el, + checked: this.filter?.find((f) => f.key === el.key)?.checked + })); } get circumference() { @@ -84,17 +89,14 @@ export class SimpleDoughnutChartComponent implements OnChanges { return `rotate(${this.chartData[index].degrees}, ${this.cx}, ${this.cy})`; } - public get parsedConfig() { - return this.config.map((el) => ({ - ...el, - checked: this.filter?.find((f) => f.key === el.key)?.checked - })); - } - public getLabel(config: DoughnutChartConfig): string { return this.totalType === 'sum' ? `${config.value} ${config.label}` : `${config.label} (${config.value} ${this.counterText})`; } + selectValue(val: any) { + this.toggleFilter.emit(val.key); + } + exists(index: number) { return !!this.chartData[index]; } diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html index 14c16704e..a592b970a 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html @@ -164,7 +164,7 @@
diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts index 578d4510d..283736669 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts @@ -110,6 +110,7 @@ export class ProjectListingScreenComponent implements OnInit, OnDestroy { }); } this.documentsChartData.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]); + this.documentsChartData = this.translateChartService.translateStatus(this.documentsChartData); } public get user() { diff --git a/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html b/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html index b00f8dcd2..7664cc0e8 100644 --- a/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html +++ b/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html @@ -15,11 +15,13 @@ icon="red:assign" > - - - - - + acc && this._permissionsService.canAssignReviewer(file), true); } - public get reanalyseDisabled() { + public get canReanalyse() { return !this.selectedFiles.reduce((acc, file) => acc && this._permissionsService.canReanalyseFile(file), true); } @@ -60,18 +60,6 @@ export class BulkActionsComponent { return this.selectedFiles.map((file) => file.fileStatus.status); } - public get reanalyseTooltip() { - if (!this.reanalyseDisabled) { - return 'project-overview.bulk.reanalyse'; - } - - // if (!this._hasOutdatedDocuments) { - // return 'project-overview.bulk.reanalyse-error-outdated'; - // } - - return 'project-overview.bulk.reanalyse-error-outdated'; - } - public delete() { this._dialogService.openDeleteFilesDialog(null, this._appStateService.activeProject.project.projectId, this.selectedFileIds, () => { this.reload.emit(); diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html b/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html index 0ab5f52af..0482e19ae 100644 --- a/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html +++ b/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html @@ -55,7 +55,7 @@
StatusSorter[a.key] - StatusSorter[b.key]); + this.documentsChartData = this.translateChartService.translateStatus(this.documentsChartData); this._changeDetectorRef.detectChanges(); } }