- {{ annotation.superType | humanize }}
+ {{ annotation.typeLabel | translate }}
: {{ annotation.dictionary | humanize }}
diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts
index 0cce2eb53..6870bafb3 100644
--- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts
+++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts
@@ -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)
);
diff --git a/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts b/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts
index 26d7d6ef7..cb2441843 100644
--- a/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts
+++ b/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts
@@ -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 } = 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 } = 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 + '"';
}
}
diff --git a/apps/red-ui/src/app/screens/file/model/file-data.model.ts b/apps/red-ui/src/app/screens/file/model/file-data.model.ts
index 28cea8793..d3bde71c3 100644
--- a/apps/red-ui/src/app/screens/file/model/file-data.model.ts
+++ b/apps/red-ui/src/app/screens/file/model/file-data.model.ts
@@ -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;
});
diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
index 3c9f78d16..da8548eea 100644
--- a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
+++ b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
@@ -12,7 +12,7 @@
>
();
// 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')
});
});
diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json
index 4204989e2..68f7191bf 100644
--- a/apps/red-ui/src/assets/i18n/en.json
+++ b/apps/red-ui/src/assets/i18n/en.json
@@ -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"
}
}
diff --git a/apps/red-ui/src/assets/styles/red-tooltips.scss b/apps/red-ui/src/assets/styles/red-tooltips.scss
index 7a0fecf62..b78bc6630 100644
--- a/apps/red-ui/src/assets/styles/red-tooltips.scss
+++ b/apps/red-ui/src/assets/styles/red-tooltips.scss
@@ -25,6 +25,10 @@
border-top: solid 6px $accent;
}
+ &.small {
+ max-width: 180px;
+ }
+
&.warn {
background-color: $yellow-2;
text-align: initial;