layouting stuff
This commit is contained in:
parent
5f95429427
commit
b6d8f343e6
@ -3,6 +3,13 @@ import { FileStatusWrapper } from '../../../screens/file/model/file-status.wrapp
|
||||
import * as moment from 'moment';
|
||||
import { ProjectWrapper } from '../../../state/app-state.service';
|
||||
|
||||
export const RedactionFilterSorter = {
|
||||
hints: 1,
|
||||
redactions: 2,
|
||||
requests: 3,
|
||||
none: 4
|
||||
};
|
||||
|
||||
export function handleCheckedValue(filter: FilterModel) {
|
||||
if (filter.filters && filter.filters.length) {
|
||||
filter.checked = filter.filters.reduce((acc, next) => acc && next.checked, true);
|
||||
|
||||
@ -47,6 +47,10 @@ export class FileStatusWrapper {
|
||||
return this.fileStatus.hasRequests;
|
||||
}
|
||||
|
||||
get hasNone() {
|
||||
return !this.hasRedactions && !this.hasHints && !this.hasRequests;
|
||||
}
|
||||
|
||||
get lastUpdated() {
|
||||
return this.fileStatus.lastUpdated;
|
||||
}
|
||||
|
||||
@ -14,7 +14,8 @@ import {
|
||||
dueDateChecker,
|
||||
getFilteredEntities,
|
||||
projectMemberChecker,
|
||||
projectStatusChecker
|
||||
projectStatusChecker,
|
||||
RedactionFilterSorter
|
||||
} from '../../common/filter/utils/filter-utils';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@ -171,6 +172,7 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
if (file.hasHints) allDistinctNeedsWork.add('hints');
|
||||
if (file.hasRedactions) allDistinctNeedsWork.add('redactions');
|
||||
if (file.hasRequests) allDistinctNeedsWork.add('requests');
|
||||
if (file.hasNone) allDistinctNeedsWork.add('none');
|
||||
});
|
||||
});
|
||||
|
||||
@ -198,13 +200,17 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
});
|
||||
});
|
||||
|
||||
this.needsWorkFilters = [];
|
||||
const needsWorkFilters = [];
|
||||
allDistinctNeedsWork.forEach((type) => {
|
||||
this.needsWorkFilters.push({
|
||||
needsWorkFilters.push({
|
||||
key: type,
|
||||
label: this._translateService.instant('filter.' + type)
|
||||
});
|
||||
});
|
||||
needsWorkFilters.sort(
|
||||
(a, b) => RedactionFilterSorter[a.key] - RedactionFilterSorter[b.key]
|
||||
);
|
||||
this.needsWorkFilters = needsWorkFilters;
|
||||
}
|
||||
|
||||
public filtersChanged() {
|
||||
|
||||
@ -256,7 +256,10 @@
|
||||
: 'report.unavailable-single'
|
||||
) | translate
|
||||
"
|
||||
*ngIf="appStateService.isActiveProjectOwnerAndManager"
|
||||
*ngIf="
|
||||
appStateService.isActiveProjectOwnerAndManager &&
|
||||
!isError(fileStatus)
|
||||
"
|
||||
[matTooltipPosition]="'above'"
|
||||
>
|
||||
<button
|
||||
@ -272,6 +275,7 @@
|
||||
(click)="assignReviewer($event, fileStatus)"
|
||||
*ngIf="
|
||||
appStateService.isActiveProjectMember &&
|
||||
!isError(fileStatus) &&
|
||||
!fileStatus.isApprovedOrUnderApproval
|
||||
"
|
||||
[matTooltip]="'project-overview.assign.action' | translate"
|
||||
@ -327,6 +331,20 @@
|
||||
>
|
||||
<mat-icon svgIcon="red:undo"></mat-icon>
|
||||
</button>
|
||||
<redaction-status-bar
|
||||
class="mr-8"
|
||||
*ngIf="
|
||||
!isPending(fileStatus) &&
|
||||
!isProcessing(fileStatus) &&
|
||||
!isError(fileStatus)
|
||||
"
|
||||
[config]="[
|
||||
{
|
||||
color: fileStatus.status,
|
||||
length: 1
|
||||
}
|
||||
]"
|
||||
></redaction-status-bar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -25,7 +25,8 @@ import { FileStatusWrapper } from '../file/model/file-status.wrapper';
|
||||
import {
|
||||
annotationFilterChecker,
|
||||
getFilteredEntities,
|
||||
keyChecker
|
||||
keyChecker,
|
||||
RedactionFilterSorter
|
||||
} from '../../common/filter/utils/filter-utils';
|
||||
|
||||
@Component({
|
||||
@ -280,6 +281,7 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
if (file.hasHints) allDistinctNeedsWork.add('hints');
|
||||
if (file.hasRedactions) allDistinctNeedsWork.add('redactions');
|
||||
if (file.hasRequests) allDistinctNeedsWork.add('requests');
|
||||
if (file.hasNone) allDistinctNeedsWork.add('none');
|
||||
});
|
||||
|
||||
this.statusFilters = [];
|
||||
@ -298,13 +300,17 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
});
|
||||
|
||||
this.needsWorkFilters = [];
|
||||
const needsWorkFilters = [];
|
||||
allDistinctNeedsWork.forEach((type) => {
|
||||
this.needsWorkFilters.push({
|
||||
needsWorkFilters.push({
|
||||
key: type,
|
||||
label: this._translateService.instant('filter.' + type)
|
||||
});
|
||||
});
|
||||
needsWorkFilters.sort(
|
||||
(a, b) => RedactionFilterSorter[a.key] - RedactionFilterSorter[b.key]
|
||||
);
|
||||
this.needsWorkFilters = needsWorkFilters;
|
||||
}
|
||||
|
||||
filtersChanged() {
|
||||
|
||||
@ -306,7 +306,8 @@
|
||||
"filter": {
|
||||
"hints": "Hints",
|
||||
"redactions": "Redactions",
|
||||
"requests": "Requests"
|
||||
"requests": "Requests",
|
||||
"none": "No Annotations"
|
||||
},
|
||||
"annotation-filter": {
|
||||
"super-type": {
|
||||
|
||||
@ -185,6 +185,10 @@ body {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.mr-8 {
|
||||
margin-right: 8px !important;
|
||||
}
|
||||
|
||||
.empty-state-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user