fixed various issues
This commit is contained in:
parent
1199fe4542
commit
ef0ef6f0ac
@ -26,7 +26,7 @@
|
||||
mat-icon-button
|
||||
#reanalyseTooltip="matTooltip"
|
||||
[matTooltip]="'file-preview.reanalyse-notification' | translate"
|
||||
matTooltipClass="warn"
|
||||
matTooltipClass="warn small"
|
||||
>
|
||||
<mat-icon svgIcon="red:refresh"></mat-icon>
|
||||
</button>
|
||||
|
||||
@ -86,9 +86,10 @@ export class FileActionsComponent implements OnInit, AfterViewInit {
|
||||
|
||||
setFileUnderReview($event: MouseEvent, fileStatus: FileStatusWrapper) {
|
||||
$event.stopPropagation();
|
||||
this._fileActionService.setFileUnderReview(fileStatus).subscribe(() => {
|
||||
this.reloadProjects('set-review');
|
||||
});
|
||||
// this._fileActionService.setFileUnderReview(fileStatus).subscribe(() => {
|
||||
// this.reloadProjects('set-review');
|
||||
// });
|
||||
this._fileActionService.assignProjectReviewer(fileStatus, () => this.actionPerformed.emit('assign-reviewer'));
|
||||
}
|
||||
|
||||
reloadProjects(action: string) {
|
||||
|
||||
@ -71,14 +71,14 @@ export class PermissionsService {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
}
|
||||
return fileStatus.status === 'UNDER_APPROVAL';
|
||||
return fileStatus.status === 'UNDER_APPROVAL' && this.isManagerAndOwner();
|
||||
}
|
||||
|
||||
canSetUnderApproval(fileStatus?: FileStatusWrapper) {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
}
|
||||
return fileStatus.status === 'UNDER_REVIEW';
|
||||
return fileStatus.status === 'UNDER_REVIEW' && this.isReviewerOrOwner(fileStatus);
|
||||
}
|
||||
|
||||
isManagerAndOwner(project?: Project, user?: UserWrapper) {
|
||||
@ -112,7 +112,7 @@ export class PermissionsService {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
}
|
||||
return !fileStatus.isError && !fileStatus.isProcessing && this.isReviewerOrOwner(fileStatus);
|
||||
return !fileStatus.isError && !fileStatus.isProcessing; //&& this.isReviewerOrOwner(fileStatus);
|
||||
}
|
||||
|
||||
canShowRedactionReportDownloadBtn(fileStatus?: FileStatusWrapper) {
|
||||
@ -123,7 +123,12 @@ export class PermissionsService {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
}
|
||||
return this.isProjectMember() && !fileStatus.isError && !fileStatus.isApprovedOrUnderApproval;
|
||||
return (
|
||||
this.isProjectMember() &&
|
||||
!fileStatus.isError &&
|
||||
!fileStatus.isApprovedOrUnderApproval &&
|
||||
(this.isManagerAndOwner() || !this.isFileReviewer(fileStatus))
|
||||
);
|
||||
}
|
||||
|
||||
canUndoApproval(fileStatus: FileStatusWrapper) {
|
||||
@ -137,10 +142,15 @@ export class PermissionsService {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
}
|
||||
return fileStatus.status === 'UNDER_APPROVAL' && this.isManagerAndOwner();
|
||||
return fileStatus.status === 'UNDER_APPROVAL' && this.isProjectMember();
|
||||
}
|
||||
|
||||
canMarkPagesAsViewed() {
|
||||
return this.isReviewerOrOwner();
|
||||
canMarkPagesAsViewed(fileStatus?: FileStatusWrapper) {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this._appStateService.activeFile;
|
||||
}
|
||||
return (
|
||||
(fileStatus.status === 'UNDER_REVIEW' && this.isFileReviewer(fileStatus)) || (fileStatus.status === 'UNDER_APPROVAL' && this.isManagerAndOwner())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,56 +1,62 @@
|
||||
<div [class.visible]="menuOpen" *ngIf="canPerformAnnotationActions" class="annotation-actions">
|
||||
<div [class.visible]="menuType" *ngIf="canPerformAnnotationActions" class="annotation-actions">
|
||||
<button
|
||||
(click)="openAcceptSuggestionMenu($event)"
|
||||
(click)="openMenu($event, 'APPROVE')"
|
||||
*ngIf="canAcceptSuggestion"
|
||||
[class.active]="menuOpen"
|
||||
[class.active]="menuType"
|
||||
[matMenuTriggerFor]="menu"
|
||||
class="confirm"
|
||||
mat-icon-button
|
||||
>
|
||||
<mat-icon svgIcon="red:check-alt"></mat-icon>
|
||||
</button>
|
||||
<mat-menu #menu="matMenu" (closed)="onSuggestionMenuClose()" xPosition="before">
|
||||
<div (click)="acceptSuggestion($event, annotation, true)" mat-menu-item>
|
||||
<redaction-annotation-icon [typeValue]="suggestionType"></redaction-annotation-icon>
|
||||
<div
|
||||
[translate]="
|
||||
annotation.superType === 'suggestion'
|
||||
? 'file-preview.tabs.annotations.accept-suggestion.add-to-dict'
|
||||
: 'file-preview.tabs.annotations.accept-suggestion.remove-from-dict'
|
||||
"
|
||||
></div>
|
||||
</div>
|
||||
<div (click)="acceptSuggestion($event, annotation, false)" mat-menu-item>
|
||||
<redaction-annotation-icon
|
||||
[typeValue]="suggestionType"
|
||||
[color]="'#5B97DB'"
|
||||
></redaction-annotation-icon>
|
||||
<div translate="file-preview.tabs.annotations.accept-suggestion.only-here"></div>
|
||||
</div>
|
||||
<mat-menu #menu="matMenu" (closed)="onMenuClosed()" xPosition="before">
|
||||
<ng-container *ngIf="menuType === 'APPROVE'">
|
||||
<div (click)="acceptSuggestion($event, annotation, true)" mat-menu-item>
|
||||
<redaction-annotation-icon [typeValue]="suggestionType" [color]="'#5B97DB'"></redaction-annotation-icon>
|
||||
<div
|
||||
[translate]="
|
||||
annotation.superType === 'suggestion'
|
||||
? 'file-preview.tabs.annotations.accept-suggestion.add-to-dict'
|
||||
: 'file-preview.tabs.annotations.accept-suggestion.remove-from-dict'
|
||||
"
|
||||
></div>
|
||||
</div>
|
||||
<div (click)="acceptSuggestion($event, annotation, false)" mat-menu-item>
|
||||
<redaction-annotation-icon [typeValue]="suggestionType"></redaction-annotation-icon>
|
||||
<div translate="file-preview.tabs.annotations.accept-suggestion.only-here"></div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="menuType === 'SUGGEST-REMOVE'">
|
||||
<div (click)="suggestRemoveAnnotation($event, annotation, true)" mat-menu-item>
|
||||
<redaction-annotation-icon [typeValue]="suggestionType" [color]="'#5B97DB'"></redaction-annotation-icon>
|
||||
<div [translate]="'file-preview.tabs.annotations.remove-annotation.remove-from-dict'"></div>
|
||||
</div>
|
||||
<div (click)="suggestRemoveAnnotation($event, annotation, false)" mat-menu-item>
|
||||
<redaction-annotation-icon [typeValue]="suggestionType"></redaction-annotation-icon>
|
||||
<div translate="file-preview.tabs.annotations.remove-annotation.only-here"></div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</mat-menu>
|
||||
<button
|
||||
(click)="undoDirectAction($event, annotation)"
|
||||
*ngIf="annotation.canUndo"
|
||||
mat-icon-button
|
||||
>
|
||||
<button (click)="undoDirectAction($event, annotation)" *ngIf="annotation.canUndo" mat-icon-button>
|
||||
<mat-icon svgIcon="red:undo"></mat-icon>
|
||||
</button>
|
||||
<button
|
||||
(click)="rejectSuggestion($event, annotation)"
|
||||
*ngIf="
|
||||
!annotation.canUndo &&
|
||||
(annotation.superType === 'suggestion' || annotation.superType === 'suggestion-remove')
|
||||
"
|
||||
*ngIf="!annotation.canUndo && (annotation.superType === 'suggestion' || annotation.superType === 'suggestion-remove')"
|
||||
mat-icon-button
|
||||
>
|
||||
<mat-icon svgIcon="red:close"></mat-icon>
|
||||
</button>
|
||||
<button (click)="suggestRemoveAnnotation($event, annotation, true)" *ngIf="!annotation.canUndo && annotation.superType === 'hint'" mat-icon-button>
|
||||
<mat-icon svgIcon="red:trash"></mat-icon>
|
||||
</button>
|
||||
|
||||
<button
|
||||
(click)="suggestRemoveAnnotation($event, annotation)"
|
||||
*ngIf="
|
||||
!annotation.canUndo &&
|
||||
(annotation.superType === 'redaction' || annotation.superType === 'hint')
|
||||
"
|
||||
(click)="openMenu($event, 'SUGGEST-REMOVE')"
|
||||
*ngIf="!annotation.canUndo && annotation.superType === 'redaction'"
|
||||
[class.active]="menuType"
|
||||
[matMenuTriggerFor]="menu"
|
||||
class="confirm"
|
||||
mat-icon-button
|
||||
>
|
||||
<mat-icon svgIcon="red:trash"></mat-icon>
|
||||
|
||||
@ -18,7 +18,7 @@ export class AnnotationActionsComponent implements OnInit {
|
||||
@Output() annotationsChanged = new EventEmitter();
|
||||
|
||||
suggestionType: TypeValue;
|
||||
menuOpen: boolean;
|
||||
menuType: 'APPROVE' | 'SUGGEST-REMOVE';
|
||||
|
||||
constructor(
|
||||
public appStateService: AppStateService,
|
||||
@ -44,9 +44,9 @@ export class AnnotationActionsComponent implements OnInit {
|
||||
this._processObsAndEmit(this._manualAnnotationService.declineOrRemoveRequest(annotation));
|
||||
}
|
||||
|
||||
suggestRemoveAnnotation($event: MouseEvent, annotation: AnnotationWrapper) {
|
||||
suggestRemoveAnnotation($event: MouseEvent, annotation: AnnotationWrapper, removeFromDictionary: boolean) {
|
||||
$event.stopPropagation();
|
||||
this._processObsAndEmit(this._manualAnnotationService.removeOrSuggestRemoveAnnotation(annotation));
|
||||
this._processObsAndEmit(this._manualAnnotationService.removeOrSuggestRemoveAnnotation(annotation, removeFromDictionary));
|
||||
}
|
||||
|
||||
undoDirectAction($event: MouseEvent, annotation: AnnotationWrapper) {
|
||||
@ -65,12 +65,12 @@ export class AnnotationActionsComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
public openAcceptSuggestionMenu($event: MouseEvent) {
|
||||
public openMenu($event: MouseEvent, menuType: 'APPROVE' | 'SUGGEST-REMOVE') {
|
||||
$event.preventDefault();
|
||||
this.menuOpen = true;
|
||||
this.menuType = menuType;
|
||||
}
|
||||
|
||||
public onSuggestionMenuClose() {
|
||||
this.menuOpen = false;
|
||||
public onMenuClosed() {
|
||||
this.menuType = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,11 +88,12 @@
|
||||
>
|
||||
<div class="details">
|
||||
<redaction-annotation-icon
|
||||
[color]="annotation.manualAddToDictionary ? '#5B97DB' : null"
|
||||
[typeValue]="appStateService.getDictionaryTypeValueForAnnotation(annotation)"
|
||||
></redaction-annotation-icon>
|
||||
<div class="flex-1">
|
||||
<div>
|
||||
<strong>{{ annotation.superType | humanize }}</strong>
|
||||
<strong>{{ annotation.typeLabel | translate }}</strong>
|
||||
</div>
|
||||
<div *ngIf="annotation.dictionary">
|
||||
<strong><span translate="dictionary"></span>: </strong>{{ annotation.dictionary | humanize }}
|
||||
|
||||
@ -102,14 +102,14 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this._loadFileData().subscribe(() => {
|
||||
this.canPerformAnnotationActions = this.permissionsService.canPerformAnnotationActions();
|
||||
this.canPerformAnnotationActions = this.permissionsService.canPerformAnnotationActions(this.fileData.fileStatus);
|
||||
});
|
||||
this.appStateService.fileReanalysed.subscribe((fileStatus: FileStatusWrapper) => {
|
||||
if (fileStatus.fileId === this.fileId) {
|
||||
this._loadFileData().subscribe(() => {
|
||||
this.viewReady = true;
|
||||
this.loadingMessage = null;
|
||||
this.canPerformAnnotationActions = this.permissionsService.canPerformAnnotationActions();
|
||||
this.canPerformAnnotationActions = this.permissionsService.canPerformAnnotationActions(this.fileData.fileStatus);
|
||||
this._cleanupAndRedrawManualAnnotations();
|
||||
});
|
||||
}
|
||||
@ -129,7 +129,7 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
const manualRedactionAnnotations = this.fileData.entriesToAdd.map((mr) =>
|
||||
AnnotationWrapper.fromManualRedaction(mr, this.fileData.manualRedactions, this.appStateService.dictionaryData, this.permissionsService.currentUser)
|
||||
);
|
||||
const redactionLogAnnotations = this.fileData.redactionLog.redactionLogEntry.map((rde) =>
|
||||
const redactionLogAnnotations = this.fileData.redactionLogEntry.map((rde) =>
|
||||
AnnotationWrapper.fromRedactionLog(rde, this.fileData.manualRedactions, this.permissionsService.currentUser)
|
||||
);
|
||||
|
||||
|
||||
@ -1,12 +1,4 @@
|
||||
import {
|
||||
Comment,
|
||||
ManualRedactionEntry,
|
||||
ManualRedactions,
|
||||
Point,
|
||||
RedactionLogEntry,
|
||||
TypeValue,
|
||||
User
|
||||
} from '@redaction/red-ui-http';
|
||||
import { Comment, ManualRedactionEntry, ManualRedactions, Point, RedactionLogEntry, TypeValue } from '@redaction/red-ui-http';
|
||||
import { UserWrapper } from '../../../user/user.service';
|
||||
|
||||
export const SuperTypeSorter = {
|
||||
@ -29,22 +21,20 @@ export class AnnotationWrapper {
|
||||
manual: boolean;
|
||||
userId: string;
|
||||
canUndo: boolean;
|
||||
pageNumber;
|
||||
manualAddToDictionary: boolean;
|
||||
typeLabel: string;
|
||||
pageNumber: number;
|
||||
hint: boolean;
|
||||
redaction: boolean;
|
||||
|
||||
static fromRedactionLog(
|
||||
redactionLogEntry: RedactionLogEntry,
|
||||
manualRedactions: ManualRedactions,
|
||||
user: UserWrapper
|
||||
) {
|
||||
static fromRedactionLog(redactionLogEntry: RedactionLogEntry, manualRedactions: ManualRedactions, user: UserWrapper) {
|
||||
const comments: { [key: string]: Array<Comment> } = manualRedactions.comments;
|
||||
const annotationWrapper = new AnnotationWrapper();
|
||||
annotationWrapper.id = redactionLogEntry.id;
|
||||
annotationWrapper.superType = redactionLogEntry.redacted
|
||||
? 'redaction'
|
||||
: redactionLogEntry.hint
|
||||
? 'hint'
|
||||
: 'ignore';
|
||||
annotationWrapper.superType = redactionLogEntry.redacted ? 'redaction' : redactionLogEntry.hint ? 'hint' : 'ignore';
|
||||
|
||||
annotationWrapper.redaction = redactionLogEntry.redacted;
|
||||
annotationWrapper.hint = redactionLogEntry.hint;
|
||||
annotationWrapper.dictionary = redactionLogEntry.type;
|
||||
annotationWrapper.firstTopLeftPoint = redactionLogEntry.positions[0]?.topLeft;
|
||||
annotationWrapper.pageNumber = redactionLogEntry.positions[0]?.page;
|
||||
@ -54,10 +44,10 @@ export class AnnotationWrapper {
|
||||
? AnnotationWrapper.createAnnotationContentForRedactionLogEntry(redactionLogEntry)
|
||||
: null;
|
||||
|
||||
AnnotationWrapper._handleRemoveSuperType(annotationWrapper, manualRedactions, user);
|
||||
annotationWrapper.comments = comments[redactionLogEntry.id]
|
||||
? comments[redactionLogEntry.id]
|
||||
: [];
|
||||
const toRemove = AnnotationWrapper._handleRemoveSuperType(annotationWrapper, manualRedactions, user);
|
||||
annotationWrapper.manualAddToDictionary = toRemove ? toRemove.removeFromDictionary : false;
|
||||
annotationWrapper.comments = comments[redactionLogEntry.id] ? comments[redactionLogEntry.id] : [];
|
||||
AnnotationWrapper._setTypeLabel(annotationWrapper);
|
||||
return annotationWrapper;
|
||||
}
|
||||
|
||||
@ -70,11 +60,10 @@ export class AnnotationWrapper {
|
||||
const comments: { [key: string]: Array<Comment> } = manualRedactions.comments;
|
||||
const annotationWrapper = new AnnotationWrapper();
|
||||
annotationWrapper.id = manualRedactionEntry.id;
|
||||
annotationWrapper.superType = AnnotationWrapper.getManualRedactionSuperType(
|
||||
manualRedactionEntry,
|
||||
dictionaryData
|
||||
);
|
||||
|
||||
annotationWrapper.superType = AnnotationWrapper.getManualRedactionSuperType(manualRedactionEntry, dictionaryData);
|
||||
const dictionary = dictionaryData[manualRedactionEntry.type];
|
||||
annotationWrapper.redaction = !dictionary.hint;
|
||||
annotationWrapper.hint = dictionary.hint;
|
||||
AnnotationWrapper._handleRemoveSuperType(annotationWrapper, manualRedactions, user);
|
||||
annotationWrapper.dictionary = manualRedactionEntry.type;
|
||||
annotationWrapper.firstTopLeftPoint = manualRedactionEntry.positions[0]?.topLeft;
|
||||
@ -83,24 +72,36 @@ export class AnnotationWrapper {
|
||||
? null
|
||||
: AnnotationWrapper.createAnnotationContentForManualRedaction(manualRedactionEntry);
|
||||
annotationWrapper.manual = true;
|
||||
annotationWrapper.comments = comments[manualRedactionEntry.id]
|
||||
? comments[manualRedactionEntry.id]
|
||||
: [];
|
||||
annotationWrapper.comments = comments[manualRedactionEntry.id] ? comments[manualRedactionEntry.id] : [];
|
||||
annotationWrapper.userId = manualRedactionEntry.user;
|
||||
annotationWrapper.canUndo =
|
||||
!manualRedactionEntry.processedDate && manualRedactionEntry.user === user.id;
|
||||
annotationWrapper.canUndo = !manualRedactionEntry.processedDate && manualRedactionEntry.user === user.id;
|
||||
|
||||
annotationWrapper.manualAddToDictionary = manualRedactionEntry.addToDictionary;
|
||||
AnnotationWrapper._setTypeLabel(annotationWrapper);
|
||||
return annotationWrapper;
|
||||
}
|
||||
|
||||
private static _handleRemoveSuperType(
|
||||
annotationWrapper: AnnotationWrapper,
|
||||
manualRedactions: ManualRedactions,
|
||||
user: UserWrapper
|
||||
) {
|
||||
const toRemove = manualRedactions.idsToRemove.find(
|
||||
(trm) => trm.id === annotationWrapper.id
|
||||
);
|
||||
private static _setTypeLabel(annotationWrapper: AnnotationWrapper) {
|
||||
let label = 'annotation-type.' + annotationWrapper.superType;
|
||||
switch (annotationWrapper.superType) {
|
||||
case 'suggestion':
|
||||
case 'suggestion-remove':
|
||||
if (annotationWrapper.hint) {
|
||||
label += '-hint';
|
||||
}
|
||||
if (annotationWrapper.redaction) {
|
||||
label += '-redaction';
|
||||
if (annotationWrapper.manualAddToDictionary) {
|
||||
label += '-dictionary';
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
annotationWrapper.typeLabel = label;
|
||||
}
|
||||
|
||||
private static _handleRemoveSuperType(annotationWrapper: AnnotationWrapper, manualRedactions: ManualRedactions, user: UserWrapper) {
|
||||
const toRemove = manualRedactions.idsToRemove.find((trm) => trm.id === annotationWrapper.id);
|
||||
|
||||
// change super-type based on toRemove
|
||||
annotationWrapper.superType = toRemove
|
||||
@ -113,20 +114,13 @@ export class AnnotationWrapper {
|
||||
|
||||
if (toRemove) {
|
||||
annotationWrapper.canUndo = !toRemove.processedDate && toRemove.user === user.id;
|
||||
console.log(annotationWrapper.canUndo, toRemove.user, user.id);
|
||||
}
|
||||
return toRemove;
|
||||
}
|
||||
|
||||
static getManualRedactionSuperType(
|
||||
manualRedactionEntry: ManualRedactionEntry,
|
||||
dictionaryData: { [p: string]: TypeValue }
|
||||
) {
|
||||
static getManualRedactionSuperType(manualRedactionEntry: ManualRedactionEntry, dictionaryData: { [p: string]: TypeValue }) {
|
||||
const dictionary = dictionaryData[manualRedactionEntry.type];
|
||||
return manualRedactionEntry.status === 'REQUESTED'
|
||||
? 'suggestion'
|
||||
: dictionary.hint
|
||||
? 'hint'
|
||||
: 'redaction';
|
||||
return manualRedactionEntry.status === 'REQUESTED' ? 'suggestion' : dictionary.hint ? 'hint' : 'redaction';
|
||||
}
|
||||
|
||||
constructor() {}
|
||||
@ -151,13 +145,6 @@ export class AnnotationWrapper {
|
||||
|
||||
private static createAnnotationContentForRedactionLogEntry(entry: RedactionLogEntry) {
|
||||
// return "\nRule " + entry.matchedRule + " matched\n\n" + entry.reason + "\n\nLegal basis:" + entry.legalBasis + "\n\nIn section: \"" + entry.section + "\"";
|
||||
return (
|
||||
entry.reason +
|
||||
'\n\nLegal basis:' +
|
||||
entry.legalBasis +
|
||||
'\n\nIn section: "' +
|
||||
entry.section +
|
||||
'"'
|
||||
);
|
||||
return entry.reason + '\n\nLegal basis:' + entry.legalBasis + '\n\nIn section: "' + entry.section + '"';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
import {
|
||||
ManualRedactionEntry,
|
||||
ManualRedactions,
|
||||
RedactionLog,
|
||||
ViewedPages
|
||||
} from '@redaction/red-ui-http';
|
||||
import { ManualRedactionEntry, ManualRedactions, RedactionLog, RedactionLogEntry, ViewedPages } from '@redaction/red-ui-http';
|
||||
import { FileStatusWrapper } from './file-status.wrapper';
|
||||
|
||||
export class FileDataModel {
|
||||
@ -16,14 +11,15 @@ export class FileDataModel {
|
||||
public viewedPages?: ViewedPages
|
||||
) {}
|
||||
|
||||
get redactionLogEntry(): RedactionLogEntry[] {
|
||||
return this.redactionLog.redactionLogEntry.filter((r) => r.status !== 'REQUESTED');
|
||||
}
|
||||
|
||||
get entriesToAdd(): ManualRedactionEntry[] {
|
||||
return this.manualRedactions.entriesToAdd.filter((e) => {
|
||||
const notDeclined = e.status !== 'DECLINED';
|
||||
const notAlreadyDrawn = !this.redactionLog.redactionLogEntry.find((r) => r.id === e.id);
|
||||
const alreadyProcessed =
|
||||
!!e.processedDate &&
|
||||
new Date(e.processedDate).getTime() <
|
||||
new Date(this.fileStatus.lastProcessed).getTime();
|
||||
const notAlreadyDrawn = !this.redactionLogEntry.find((r) => r.id === e.id);
|
||||
const alreadyProcessed = !!e.processedDate && new Date(e.processedDate).getTime() < new Date(this.fileStatus.lastProcessed).getTime();
|
||||
|
||||
return notDeclined && notAlreadyDrawn && !alreadyProcessed;
|
||||
});
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
></redaction-filter>
|
||||
<redaction-filter
|
||||
(filtersChanged)="filtersChanged()"
|
||||
[filterLabel]="'filters.people'"
|
||||
[filterLabel]="'filters.assigned-people'"
|
||||
[filters]="peopleFilters"
|
||||
[hasArrow]="false"
|
||||
[icon]="'red:user'"
|
||||
|
||||
@ -181,7 +181,7 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
const allDistinctNeedsWork = new Set<string>();
|
||||
|
||||
// All people
|
||||
this.appStateService.activeProject.project.memberIds.forEach((memberId) => allDistinctPeople.add(memberId));
|
||||
this.appStateService.activeProject.files.forEach((file) => allDistinctPeople.add(file.currentReviewer));
|
||||
|
||||
// File statuses
|
||||
this.appStateService.activeProject.files.forEach((file) => allDistinctFileStatusWrapper.add(file.status));
|
||||
@ -206,10 +206,15 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
|
||||
this.peopleFilters = [];
|
||||
if (allDistinctPeople.has(undefined) || allDistinctPeople.has(null)) {
|
||||
allDistinctPeople.delete(undefined);
|
||||
allDistinctPeople.delete(null);
|
||||
allDistinctPeople.add(null);
|
||||
}
|
||||
allDistinctPeople.forEach((userId) => {
|
||||
this.peopleFilters.push({
|
||||
key: userId,
|
||||
label: this._userService.getNameForId(userId)
|
||||
label: userId ? this._userService.getNameForId(userId) : this._translateService.instant('initials-avatar.unassigned')
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -84,6 +84,7 @@
|
||||
"filter-by": "Filter:",
|
||||
"status": "Status",
|
||||
"people": "Project Member(s)",
|
||||
"assigned-people": "Assignee(s)",
|
||||
"due-date": "Due Date",
|
||||
"created-on": "Created On",
|
||||
"project": "Project",
|
||||
@ -260,6 +261,10 @@
|
||||
"add-to-dict": "Approve and add to dictionary",
|
||||
"remove-from-dict": "Approve and remove from dictionary",
|
||||
"only-here": "Approve only here"
|
||||
},
|
||||
"remove-annotation": {
|
||||
"remove-from-dict": "Remove from dictionary",
|
||||
"only-here": "Remove only here"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -341,5 +346,18 @@
|
||||
"group": {
|
||||
"redactions": "Redaction Dictionaries",
|
||||
"hints": "Hint Dictionaries"
|
||||
},
|
||||
"annotation-type": {
|
||||
"suggestion": "Suggestion",
|
||||
"suggestion-remove": "Suggestion removal",
|
||||
"suggestion-redaction": "Suggested redaction add",
|
||||
"suggestion-remove-redaction": "Suggested redaction removal",
|
||||
"suggestion-redaction-dictionary": "Suggested dictionary add (redaction)",
|
||||
"suggestion-remove-redaction-dictionary": "Suggested dictionary removal (redaction)",
|
||||
"suggestion-hint": "Suggested dictionary add (hint)",
|
||||
"suggestion-remove-hint": "Suggested dictionary removal (hint)",
|
||||
"ignore": "Ignore",
|
||||
"hint": "Hint",
|
||||
"redaction": "Redaction"
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,10 @@
|
||||
border-top: solid 6px $accent;
|
||||
}
|
||||
|
||||
&.small {
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
&.warn {
|
||||
background-color: $yellow-2;
|
||||
text-align: initial;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user