bugfixing

This commit is contained in:
Timo 2020-12-03 12:46:38 +02:00
parent eb63ec6895
commit 9f756e3547
8 changed files with 22 additions and 28 deletions

View File

@ -24,7 +24,7 @@
<div class="breakdown-container">
<div>
<div *ngFor="let val of parsedConfig" [class.active]="val.checked" [class.filter-disabled]="!filter" (click)="toggleFilter.emit(val.key)">
<div *ngFor="let val of parsedConfig" [class.active]="val.checked" [class.filter-disabled]="!filter" (click)="selectValue(val)">
<redaction-status-bar
[small]="true"
[labelClass]="'no-wrap'"

View File

@ -32,6 +32,7 @@ export class SimpleDoughnutChartComponent implements OnChanges {
public cx = 0;
public cy = 0;
public size = 0;
public parsedConfig: { color: Color; active?: boolean; checked: boolean; label: string; value: number; key?: string }[];
constructor() {}
@ -40,6 +41,10 @@ export class SimpleDoughnutChartComponent implements OnChanges {
this.cx = this.radius + this.strokeWidth / 2;
this.cy = this.radius + this.strokeWidth / 2;
this.size = this.strokeWidth + this.radius * 2;
this.parsedConfig = this.config.map((el) => ({
...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];
}

View File

@ -164,7 +164,7 @@
<div class="right-container">
<redaction-project-listing-details
[projectsChartData]="projectsChartData"
[documentsChartData]="translateChartService.translateStatus(documentsChartData)"
[documentsChartData]="documentsChartData"
[filters]="detailsContainerFilters"
(filtersChanged)="filtersChanged($event)"
></redaction-project-listing-details>

View File

@ -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() {

View File

@ -15,11 +15,13 @@
icon="red:assign"
></redaction-circle-button>
<!-- <div [matTooltip]="reanalyseTooltip | translate" matTooltipPosition="above">-->
<!-- <button (click)="reanalyse()" [disabled]="reanalyseDisabled" class="dark" color="accent" mat-icon-button>-->
<!-- <mat-icon svgIcon="red:refresh"></mat-icon>-->
<!-- </button>-->
<!-- </div>-->
<redaction-circle-button
(action)="reanalyse()"
*ngIf="canReanalyse"
tooltip="project-overview.bulk.reanalyse"
type="dark-bg"
icon="red:assign"
></redaction-circle-button>
<redaction-circle-button
(action)="approveDocuments()"

View File

@ -52,7 +52,7 @@ export class BulkActionsComponent {
return this.selectedFiles.reduce((acc, file) => 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();

View File

@ -55,7 +55,7 @@
<div *ngIf="hasFiles" class="mt-24">
<redaction-simple-doughnut-chart
(toggleFilter)="toggleFilter('statusFilters', $event)"
[config]="translateChartService.translateStatus(documentsChartData)"
[config]="documentsChartData"
[filter]="filters.statusFilters"
[radius]="63"
[strokeWidth]="15"

View File

@ -62,6 +62,7 @@ export class ProjectDetailsComponent implements OnInit {
this.documentsChartData.push({ value: groups[key].length, color: key, label: key, key: key });
}
this.documentsChartData.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]);
this.documentsChartData = this.translateChartService.translateStatus(this.documentsChartData);
this._changeDetectorRef.detectChanges();
}
}