added sorting for filters and status
This commit is contained in:
parent
b707583863
commit
72f9d1b8f0
@ -1,6 +1,5 @@
|
||||
<div class="file-actions">
|
||||
<button
|
||||
#reanalyseTooltip="matTooltip"
|
||||
(click)="reanalyseFile($event, fileStatus)"
|
||||
*ngIf="permissionsService.canReanalyseFile(fileStatus) && screen === 'file-preview'"
|
||||
[matTooltip]="'file-preview.reanalyse-notification' | translate"
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
export const StatusSorter = {
|
||||
UNPROCESSED: 0,
|
||||
REPROCESS: 2,
|
||||
PROCESSING: 2,
|
||||
ERROR: 1,
|
||||
ERROR: 0,
|
||||
UNPROCESSED: 1,
|
||||
REPROCESS: 5,
|
||||
PROCESSING: 5,
|
||||
|
||||
UNASSIGNED: 10,
|
||||
UNDER_REVIEW: 4,
|
||||
UNDER_APPROVAL: 5,
|
||||
APPROVED: 6
|
||||
UNDER_REVIEW: 15,
|
||||
UNDER_APPROVAL: 20,
|
||||
APPROVED: 25
|
||||
};
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { FileStatus } from '@redaction/red-ui-http';
|
||||
import { StatusSorter } from '../../../common/sorters/status-sorter';
|
||||
|
||||
export class FileStatusWrapper {
|
||||
constructor(public fileStatus: FileStatus, public reviewerName: string) {}
|
||||
@ -95,6 +96,10 @@ export class FileStatusWrapper {
|
||||
return [FileStatus.StatusEnum.REPROCESS, FileStatus.StatusEnum.PROCESSING].includes(this.status);
|
||||
}
|
||||
|
||||
get statusSort() {
|
||||
return StatusSorter[this.status];
|
||||
}
|
||||
|
||||
get isWorkable() {
|
||||
return !this.isProcessing && !this.isPending && !this.isError;
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ export class AnnotationProcessingService {
|
||||
return { key: dc, checked: false, filters: [] };
|
||||
})
|
||||
};
|
||||
filter.filters.sort((a, b) => a.key.localeCompare(b.key));
|
||||
handleCheckedValue(filter);
|
||||
if (filter.checked || filter.indeterminate) {
|
||||
filter.expanded = true;
|
||||
|
||||
@ -93,6 +93,7 @@ export class ProjectListingScreenComponent implements OnInit, OnDestroy {
|
||||
key: key
|
||||
});
|
||||
}
|
||||
this.documentsChartData.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]);
|
||||
}
|
||||
|
||||
public get user() {
|
||||
|
||||
@ -23,11 +23,11 @@
|
||||
<mat-icon svgIcon="red:assign"></mat-icon>
|
||||
</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>
|
||||
<!-- <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>-->
|
||||
|
||||
<button
|
||||
(click)="approveDocuments()"
|
||||
|
||||
@ -7,6 +7,7 @@ import { Router } from '@angular/router';
|
||||
import { FilterModel } from '../../../common/filter/model/filter.model';
|
||||
import { PermissionsService } from '../../../common/service/permissions.service';
|
||||
import { TranslateChartService } from '../../../utils/translate-chart.service';
|
||||
import { StatusSorter } from '../../../common/sorters/status-sorter';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-details',
|
||||
@ -72,6 +73,7 @@ export class ProjectDetailsComponent implements OnInit {
|
||||
for (const key of Object.keys(groups)) {
|
||||
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._changeDetectorRef.detectChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
class="flex-end"
|
||||
column="status"
|
||||
column="statusSort"
|
||||
label="project-overview.table-col-names.status"
|
||||
></redaction-table-col-name>
|
||||
|
||||
|
||||
@ -146,12 +146,12 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
if (this.areAllFilesSelected) {
|
||||
this.selectedFileIds = [];
|
||||
} else {
|
||||
this.selectedFileIds = this.appStateService.activeProject.files.map((file) => file.fileId);
|
||||
this.selectedFileIds = this.displayedFiles.map((file) => file.fileId);
|
||||
}
|
||||
}
|
||||
|
||||
public get areAllFilesSelected() {
|
||||
return this.appStateService.activeProject.files.length !== 0 && this.selectedFileIds.length === this.appStateService.activeProject.files.length;
|
||||
return this.appStateService.activeProject.files.length !== 0 && this.selectedFileIds.length === this.displayedFiles.length;
|
||||
}
|
||||
|
||||
public get areSomeFilesSelected() {
|
||||
@ -221,12 +221,15 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
if (allDistinctPeople.has(undefined) || allDistinctPeople.has(null)) {
|
||||
allDistinctPeople.delete(undefined);
|
||||
allDistinctPeople.delete(null);
|
||||
allDistinctPeople.add(null);
|
||||
peopleFilters.push({
|
||||
key: null,
|
||||
label: this._translateService.instant('initials-avatar.unassigned')
|
||||
});
|
||||
}
|
||||
allDistinctPeople.forEach((userId) => {
|
||||
peopleFilters.push({
|
||||
key: userId,
|
||||
label: userId ? this.userService.getNameForId(userId) : this._translateService.instant('initials-avatar.unassigned')
|
||||
label: this.userService.getNameForId(userId)
|
||||
});
|
||||
});
|
||||
this.peopleFilters = processFilters(this.peopleFilters, peopleFilters);
|
||||
@ -271,6 +274,7 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
];
|
||||
this.displayedFiles = getFilteredEntities(this.appStateService.activeProject.files, filters);
|
||||
this.selectedFileIds = this.displayedFiles.map((d) => d.fileId).filter((x) => this.selectedFileIds.includes(x));
|
||||
this.detailsContainerFilters = {
|
||||
needsWorkFilters: this.needsWorkFilters.map((f) => ({ ...f })),
|
||||
statusFilters: this.statusFilters.map((f) => ({ ...f }))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user