added filter sorting and fixed hitbox of select oval
This commit is contained in:
parent
c8f90d44c5
commit
d14de42536
@ -3,14 +3,6 @@ import { FileStatusWrapper } from '../../../screens/file/model/file-status.wrapp
|
||||
import { ProjectWrapper } from '../../../state/model/project.wrapper';
|
||||
import { PermissionsService } from '../../service/permissions.service';
|
||||
|
||||
export const RedactionFilterSorter = {
|
||||
analysis: 0,
|
||||
hint: 1,
|
||||
redaction: 2,
|
||||
suggestion: 3,
|
||||
none: 4
|
||||
};
|
||||
|
||||
export function processFilters(oldFilters: FilterModel[], newFilters: FilterModel[]) {
|
||||
copySettings(oldFilters, newFilters);
|
||||
if (newFilters) {
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
export const RedactionFilterSorter = {
|
||||
analysis: 0,
|
||||
hint: 1,
|
||||
redaction: 2,
|
||||
suggestion: 3,
|
||||
none: 4
|
||||
};
|
||||
10
apps/red-ui/src/app/common/sorters/status-sorter.ts
Normal file
10
apps/red-ui/src/app/common/sorters/status-sorter.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export const StatusSorter = {
|
||||
UNPROCESSED: 0,
|
||||
REPROCESS: 2,
|
||||
PROCESSING: 2,
|
||||
ERROR: 1,
|
||||
UNASSIGNED: 10,
|
||||
UNDER_REVIEW: 4,
|
||||
UNDER_APPROVAL: 5,
|
||||
APPROVED: 6
|
||||
};
|
||||
13
apps/red-ui/src/app/common/sorters/super-type-sorter.ts
Normal file
13
apps/red-ui/src/app/common/sorters/super-type-sorter.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export const SuperTypeSorter = {
|
||||
'add-dictionary': 2,
|
||||
'remove-dictionary': 3,
|
||||
'suggestion-add-dictionary': 7,
|
||||
'suggestion-remove-dictionary': 8,
|
||||
'suggestion-add': 5,
|
||||
'suggestion-remove': 6,
|
||||
ignore: 50,
|
||||
redaction: 1,
|
||||
manual: 2,
|
||||
hint: 10,
|
||||
'declined-suggestion': 20
|
||||
};
|
||||
@ -3,20 +3,6 @@ import { UserWrapper } from '../../../user/user.service';
|
||||
import { FileStatusWrapper } from './file-status.wrapper';
|
||||
import { humanize } from '../../../utils/functions';
|
||||
|
||||
export const SuperTypeSorter = {
|
||||
'add-dictionary': 2,
|
||||
'remove-dictionary': 3,
|
||||
'suggestion-add-dictionary': 7,
|
||||
'suggestion-remove-dictionary': 8,
|
||||
'suggestion-add': 5,
|
||||
'suggestion-remove': 6,
|
||||
ignore: 50,
|
||||
redaction: 1,
|
||||
manual: 2,
|
||||
hint: 10,
|
||||
'declined-suggestion': 20
|
||||
};
|
||||
|
||||
export class AnnotationWrapper {
|
||||
superType:
|
||||
| 'add-dictionary'
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AppStateService } from '../../../state/app-state.service';
|
||||
import { AnnotationWrapper, SuperTypeSorter } from '../model/annotation.wrapper';
|
||||
import { AnnotationWrapper } from '../model/annotation.wrapper';
|
||||
import { FilterModel } from '../../../common/filter/model/filter.model';
|
||||
import { handleCheckedValue } from '../../../common/filter/utils/filter-utils';
|
||||
import { SuperTypeSorter } from '../../../common/sorters/super-type-sorter';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
||||
@ -13,8 +13,7 @@ import {
|
||||
getFilteredEntities,
|
||||
processFilters,
|
||||
projectMemberChecker,
|
||||
projectStatusChecker,
|
||||
RedactionFilterSorter
|
||||
projectStatusChecker
|
||||
} from '../../common/filter/utils/filter-utils';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { SortingOption, SortingService } from '../../utils/sorting.service';
|
||||
@ -23,6 +22,8 @@ import { ProjectWrapper } from '../../state/model/project.wrapper';
|
||||
import { Subscription, timer } from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { TranslateChartService } from '../../utils/translate-chart.service';
|
||||
import { RedactionFilterSorter } from '../../common/sorters/redaction-filter-sorter';
|
||||
import { StatusSorter } from '../../common/sorters/status-sorter';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-listing-screen',
|
||||
@ -205,6 +206,7 @@ export class ProjectListingScreenComponent implements OnInit, OnDestroy {
|
||||
label: humanize(status)
|
||||
});
|
||||
});
|
||||
statusFilters.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]);
|
||||
this.statusFilters = processFilters(this.statusFilters, statusFilters);
|
||||
|
||||
const peopleFilters = [];
|
||||
|
||||
@ -14,13 +14,15 @@ import { FilterModel } from '../../common/filter/model/filter.model';
|
||||
import * as moment from 'moment';
|
||||
import { ProjectDetailsComponent } from './project-details/project-details.component';
|
||||
import { FileStatusWrapper } from '../file/model/file-status.wrapper';
|
||||
import { annotationFilterChecker, getFilteredEntities, keyChecker, processFilters, RedactionFilterSorter } from '../../common/filter/utils/filter-utils';
|
||||
import { annotationFilterChecker, getFilteredEntities, keyChecker, processFilters } from '../../common/filter/utils/filter-utils';
|
||||
import { SortingOption, SortingService } from '../../utils/sorting.service';
|
||||
import { PermissionsService } from '../../common/service/permissions.service';
|
||||
import { UserService } from '../../user/user.service';
|
||||
import { FileStatus } from '@redaction/red-ui-http';
|
||||
import { Subscription, timer } from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { RedactionFilterSorter } from '../../common/sorters/redaction-filter-sorter';
|
||||
import { StatusSorter } from '../../common/sorters/status-sorter';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-overview-screen',
|
||||
@ -229,6 +231,8 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
label: humanize(status)
|
||||
});
|
||||
});
|
||||
console.log(statusFilters);
|
||||
statusFilters.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]);
|
||||
this.statusFilters = processFilters(this.statusFilters, statusFilters);
|
||||
|
||||
const peopleFilters = [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user