made filters pretty
This commit is contained in:
parent
d23c50b0cc
commit
506cc9ddfe
@ -52,8 +52,20 @@ export const keyChecker = (key: string) => (entity: any, filter: FilterModel) =>
|
||||
entity[key] === filter.key;
|
||||
|
||||
export const annotationFilterChecker = (f: FileStatusWrapper, filter: FilterModel) => {
|
||||
const getter = 'has' + filter.key[0].toUpperCase() + filter.key.slice(1);
|
||||
return f[getter];
|
||||
switch (filter.key) {
|
||||
case 'suggestion': {
|
||||
return f.hasRequests;
|
||||
}
|
||||
case 'redaction': {
|
||||
return f.hasRedactions;
|
||||
}
|
||||
case 'hint': {
|
||||
return f.hasHints;
|
||||
}
|
||||
case 'none': {
|
||||
return f.hasNone;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const projectStatusChecker = (pw: ProjectWrapper, filter: FilterModel) =>
|
||||
|
||||
@ -16,10 +16,10 @@
|
||||
}
|
||||
|
||||
.request {
|
||||
transform: rotate(45deg);
|
||||
transform: scale(0.8) rotate(45deg);
|
||||
|
||||
span {
|
||||
transform: rotate(-45deg);
|
||||
transform: scale(1.6) rotate(-45deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
<redaction-filter
|
||||
(filtersChanged)="filtersChanged()"
|
||||
[filterLabel]="'filters.needs-work'"
|
||||
[filterTemplate]="needsWorkTemplate"
|
||||
[filters]="needsWorkFilters"
|
||||
[hasArrow]="false"
|
||||
[icon]="'red:needs-work'"
|
||||
@ -243,3 +244,13 @@
|
||||
*ngIf="!appStateService.hasProjects"
|
||||
(addProjectRequest)="openAddProjectDialog()"
|
||||
></redaction-project-listing-empty>
|
||||
|
||||
<ng-template #needsWorkTemplate let-filter="filter">
|
||||
<ng-container>
|
||||
<redaction-annotation-icon
|
||||
*ngIf="filter.key !== 'none'"
|
||||
[typeValue]="appStateService.getDictionaryTypeValue(filter.key)"
|
||||
></redaction-annotation-icon>
|
||||
{{ filter.label | translate }}
|
||||
</ng-container>
|
||||
</ng-template>
|
||||
|
||||
@ -168,9 +168,9 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
|
||||
// Needs work
|
||||
entry.files.forEach((file) => {
|
||||
if (file.hasHints) allDistinctNeedsWork.add('hints');
|
||||
if (file.hasRedactions) allDistinctNeedsWork.add('redactions');
|
||||
if (file.hasRequests) allDistinctNeedsWork.add('requests');
|
||||
if (file.hasHints) allDistinctNeedsWork.add('hint');
|
||||
if (file.hasRedactions) allDistinctNeedsWork.add('redaction');
|
||||
if (file.hasRequests) allDistinctNeedsWork.add('suggestion');
|
||||
if (file.hasNone) allDistinctNeedsWork.add('none');
|
||||
});
|
||||
});
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
(click)="toggleFilter('needsWorkFilters', filter.key)"
|
||||
>
|
||||
<redaction-annotation-icon
|
||||
[typeValue]="appStateService.getDictionaryTypeValue(filter.key.slice(0, -1))"
|
||||
[typeValue]="appStateService.getDictionaryTypeValue(filter.key)"
|
||||
></redaction-annotation-icon>
|
||||
{{ 'project-overview.legend.' + filter.key | translate }}
|
||||
</div>
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
<redaction-filter
|
||||
(filtersChanged)="filtersChanged()"
|
||||
[filterLabel]="'filters.needs-work'"
|
||||
[filterTemplate]="needsWorkTemplate"
|
||||
[filters]="needsWorkFilters"
|
||||
[hasArrow]="false"
|
||||
[icon]="'red:needs-work'"
|
||||
@ -361,3 +362,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<ng-template #needsWorkTemplate let-filter="filter">
|
||||
<ng-container>
|
||||
<redaction-annotation-icon
|
||||
*ngIf="filter.key !== 'none'"
|
||||
[typeValue]="appStateService.getDictionaryTypeValue(filter.key)"
|
||||
></redaction-annotation-icon>
|
||||
{{ filter.label | translate }}
|
||||
</ng-container>
|
||||
</ng-template>
|
||||
|
||||
@ -283,9 +283,9 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
|
||||
// Needs work
|
||||
this.appStateService.activeProject.files.forEach((file) => {
|
||||
if (file.hasHints) allDistinctNeedsWork.add('hints');
|
||||
if (file.hasRedactions) allDistinctNeedsWork.add('redactions');
|
||||
if (file.hasRequests) allDistinctNeedsWork.add('requests');
|
||||
if (file.hasHints) allDistinctNeedsWork.add('hint');
|
||||
if (file.hasRedactions) allDistinctNeedsWork.add('redaction');
|
||||
if (file.hasRequests) allDistinctNeedsWork.add('suggestion');
|
||||
if (file.hasNone) allDistinctNeedsWork.add('none');
|
||||
});
|
||||
|
||||
|
||||
@ -240,9 +240,9 @@
|
||||
"upload-document": "Upload Document",
|
||||
"no-project": "Requested project: {{projectId}} does not exist! <a href='/ui/projects'>Back to Project Listing. <a/>",
|
||||
"legend": {
|
||||
"hints": "Hints only",
|
||||
"redactions": "Redacted",
|
||||
"requests": "Redaction requests"
|
||||
"hint": "Hints only",
|
||||
"redaction": "Redacted",
|
||||
"suggestion": "Suggested Redaction"
|
||||
}
|
||||
},
|
||||
"file-preview": {
|
||||
@ -308,9 +308,9 @@
|
||||
"content": "Content",
|
||||
"page": "Page",
|
||||
"filter": {
|
||||
"hints": "Hints",
|
||||
"redactions": "Redactions",
|
||||
"requests": "Requests",
|
||||
"hint": "Hints only",
|
||||
"redaction": "Redacted",
|
||||
"suggestion": "Suggested Redaction",
|
||||
"none": "No Annotations"
|
||||
},
|
||||
"annotation-filter": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user