Pull request #237: Redaction log changes
Merge in RED/ui from redaction-log-changes to master * commit 'f26cbbaa1c4c6ff76c5c263b13383734a801f5b3': minor fixes and - RED-1758 OCR Fix - RED-1593 more work on integrating backend redaction log redaction log from backend pt. 1
This commit is contained in:
commit
9d5c531492
@ -185,7 +185,7 @@
|
|||||||
"max-len": [
|
"max-len": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
"code": 100,
|
"code": 140,
|
||||||
"tabWidth": 4,
|
"tabWidth": 4,
|
||||||
"ignorePattern": "^import .*"
|
"ignorePattern": "^import .*"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,9 +34,8 @@ export class AnnotationPermissions {
|
|||||||
const permissions: AnnotationPermissions = new AnnotationPermissions();
|
const permissions: AnnotationPermissions = new AnnotationPermissions();
|
||||||
|
|
||||||
permissions.canUndo =
|
permissions.canUndo =
|
||||||
annotation.isUndoableSuperType &&
|
(!isApprover && annotation.isSuggestion) ||
|
||||||
(annotation.userId === user.id ||
|
(isApprover && annotation.isUndoableActionForApprover);
|
||||||
(annotation.userId && isApprover && !annotation.isSuggestion));
|
|
||||||
|
|
||||||
permissions.canForceRedaction = annotation.isSkipped && !permissions.canUndo;
|
permissions.canForceRedaction = annotation.isSkipped && !permissions.canUndo;
|
||||||
|
|
||||||
|
|||||||
@ -6,10 +6,10 @@ export class AnnotationWrapper {
|
|||||||
| 'add-dictionary'
|
| 'add-dictionary'
|
||||||
| 'remove-dictionary'
|
| 'remove-dictionary'
|
||||||
| 'remove-only-here'
|
| 'remove-only-here'
|
||||||
|
| 'change-legal-basis'
|
||||||
| 'suggestion-change-legal-basis'
|
| 'suggestion-change-legal-basis'
|
||||||
| 'suggestion-add-dictionary'
|
| 'suggestion-add-dictionary'
|
||||||
| 'suggestion-force-redaction'
|
| 'suggestion-force-redaction'
|
||||||
| 'change-legal-basis'
|
|
||||||
| 'suggestion-remove-dictionary'
|
| 'suggestion-remove-dictionary'
|
||||||
| 'suggestion-add'
|
| 'suggestion-add'
|
||||||
| 'suggestion-remove'
|
| 'suggestion-remove'
|
||||||
@ -29,7 +29,6 @@ export class AnnotationWrapper {
|
|||||||
shortContent: string;
|
shortContent: string;
|
||||||
content: string;
|
content: string;
|
||||||
value: string;
|
value: string;
|
||||||
userId: string;
|
|
||||||
typeLabel: string;
|
typeLabel: string;
|
||||||
pageNumber: number;
|
pageNumber: number;
|
||||||
hint: boolean;
|
hint: boolean;
|
||||||
@ -41,6 +40,8 @@ export class AnnotationWrapper {
|
|||||||
legalBasis: string;
|
legalBasis: string;
|
||||||
legalBasisChangeValue?: string;
|
legalBasisChangeValue?: string;
|
||||||
|
|
||||||
|
manual?: boolean;
|
||||||
|
|
||||||
image?: boolean;
|
image?: boolean;
|
||||||
force?: boolean;
|
force?: boolean;
|
||||||
|
|
||||||
@ -54,21 +55,8 @@ export class AnnotationWrapper {
|
|||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
get isUndoableSuperType() {
|
get isUndoableActionForApprover() {
|
||||||
return (
|
return this.manual;
|
||||||
this.superType === 'add-dictionary' ||
|
|
||||||
this.superType === 'remove-dictionary' ||
|
|
||||||
this.superType === 'suggestion-add-dictionary' ||
|
|
||||||
this.superType === 'suggestion-force-redaction' ||
|
|
||||||
this.superType === 'suggestion-remove-dictionary' ||
|
|
||||||
this.superType === 'suggestion-change-legal-basis' ||
|
|
||||||
this.superType === 'suggestion-add' ||
|
|
||||||
this.superType === 'change-legal-basis' ||
|
|
||||||
this.superType === 'suggestion-remove' ||
|
|
||||||
this.superType === 'skipped' ||
|
|
||||||
this.superType === 'redaction' ||
|
|
||||||
this.superType === 'manual-redaction'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get isChangeLogRemoved() {
|
get isChangeLogRemoved() {
|
||||||
@ -219,7 +207,6 @@ export class AnnotationWrapper {
|
|||||||
annotationWrapper._origin = redactionLogEntry;
|
annotationWrapper._origin = redactionLogEntry;
|
||||||
|
|
||||||
annotationWrapper.annotationId = redactionLogEntry.id;
|
annotationWrapper.annotationId = redactionLogEntry.id;
|
||||||
annotationWrapper.force = redactionLogEntry.force;
|
|
||||||
annotationWrapper.isChangeLogEntry = redactionLogEntry.isChangeLogEntry;
|
annotationWrapper.isChangeLogEntry = redactionLogEntry.isChangeLogEntry;
|
||||||
annotationWrapper.changeLogType = redactionLogEntry.changeLogType;
|
annotationWrapper.changeLogType = redactionLogEntry.changeLogType;
|
||||||
annotationWrapper.redaction = redactionLogEntry.redacted;
|
annotationWrapper.redaction = redactionLogEntry.redacted;
|
||||||
@ -233,14 +220,14 @@ export class AnnotationWrapper {
|
|||||||
annotationWrapper.textBefore = redactionLogEntry.textBefore;
|
annotationWrapper.textBefore = redactionLogEntry.textBefore;
|
||||||
annotationWrapper.textAfter = redactionLogEntry.textAfter;
|
annotationWrapper.textAfter = redactionLogEntry.textAfter;
|
||||||
annotationWrapper.dictionaryOperation = redactionLogEntry.dictionaryEntry;
|
annotationWrapper.dictionaryOperation = redactionLogEntry.dictionaryEntry;
|
||||||
annotationWrapper.userId = redactionLogEntry.userId;
|
|
||||||
annotationWrapper.image = redactionLogEntry.image;
|
annotationWrapper.image = redactionLogEntry.image;
|
||||||
annotationWrapper.legalBasisChangeValue = redactionLogEntry.legalBasisChangeValue;
|
annotationWrapper.legalBasisChangeValue = redactionLogEntry.legalBasisChangeValue;
|
||||||
annotationWrapper.comments = redactionLogEntry.comments || [];
|
annotationWrapper.comments = redactionLogEntry.comments || [];
|
||||||
annotationWrapper.legalBasis = redactionLogEntry.legalBasis;
|
annotationWrapper.legalBasis = redactionLogEntry.legalBasis;
|
||||||
|
annotationWrapper.manual = redactionLogEntry.manual;
|
||||||
|
|
||||||
this._createContent(annotationWrapper, redactionLogEntry);
|
this._createContent(annotationWrapper, redactionLogEntry);
|
||||||
this._setSuperType(annotationWrapper, redactionLogEntry);
|
this._setSuperType(annotationWrapper, redactionLogEntry);
|
||||||
this._handleSkippedState(annotationWrapper, redactionLogEntry);
|
|
||||||
this._handleRecommendations(annotationWrapper, redactionLogEntry);
|
this._handleRecommendations(annotationWrapper, redactionLogEntry);
|
||||||
annotationWrapper.typeLabel = 'annotation-type.' + annotationWrapper.superType;
|
annotationWrapper.typeLabel = 'annotation-type.' + annotationWrapper.superType;
|
||||||
|
|
||||||
@ -262,25 +249,35 @@ export class AnnotationWrapper {
|
|||||||
annotationWrapper: AnnotationWrapper,
|
annotationWrapper: AnnotationWrapper,
|
||||||
redactionLogEntryWrapper: RedactionLogEntryWrapper
|
redactionLogEntryWrapper: RedactionLogEntryWrapper
|
||||||
) {
|
) {
|
||||||
if (redactionLogEntryWrapper.legalBasisChangeValue) {
|
if (redactionLogEntryWrapper.recommendation) {
|
||||||
if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
if (redactionLogEntryWrapper.redacted) {
|
||||||
annotationWrapper.superType = 'suggestion-change-legal-basis';
|
annotationWrapper.superType = 'recommendation';
|
||||||
} else if (redactionLogEntryWrapper.actionPendingReanalysis) {
|
|
||||||
annotationWrapper.superType = 'change-legal-basis';
|
|
||||||
} else {
|
} else {
|
||||||
annotationWrapper.superType = 'redaction';
|
annotationWrapper.superType = 'skipped';
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redactionLogEntryWrapper.recommendation) {
|
if (redactionLogEntryWrapper.manualRedactionType === 'FORCE_REDACT') {
|
||||||
if (redactionLogEntryWrapper.redacted) {
|
annotationWrapper.force = true;
|
||||||
annotationWrapper.superType = 'recommendation';
|
|
||||||
return;
|
if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
||||||
|
annotationWrapper.superType = 'suggestion-force-redaction';
|
||||||
|
} else if (redactionLogEntryWrapper.status === 'APPROVED') {
|
||||||
|
annotationWrapper.superType = 'redaction';
|
||||||
} else {
|
} else {
|
||||||
annotationWrapper.superType = 'skipped';
|
annotationWrapper.superType = 'skipped';
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (redactionLogEntryWrapper.manualRedactionType === 'LEGAL_BASIS_CHANGE') {
|
||||||
|
if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
||||||
|
annotationWrapper.superType = 'suggestion-change-legal-basis';
|
||||||
|
} else {
|
||||||
|
annotationWrapper.superType = 'redaction';
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redactionLogEntryWrapper.status === 'DECLINED') {
|
if (redactionLogEntryWrapper.status === 'DECLINED') {
|
||||||
@ -295,45 +292,53 @@ export class AnnotationWrapper {
|
|||||||
if (redactionLogEntryWrapper.status === 'APPROVED') {
|
if (redactionLogEntryWrapper.status === 'APPROVED') {
|
||||||
annotationWrapper.superType = 'add-dictionary';
|
annotationWrapper.superType = 'add-dictionary';
|
||||||
}
|
}
|
||||||
} else {
|
return;
|
||||||
if (redactionLogEntryWrapper.redacted) {
|
}
|
||||||
if (redactionLogEntryWrapper.force) {
|
|
||||||
|
if (redactionLogEntryWrapper.manualRedactionType === 'ADD') {
|
||||||
|
if (redactionLogEntryWrapper.dictionaryEntry) {
|
||||||
|
if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
||||||
|
annotationWrapper.superType = 'suggestion-add-dictionary';
|
||||||
|
}
|
||||||
|
if (redactionLogEntryWrapper.status === 'APPROVED') {
|
||||||
|
annotationWrapper.superType = 'add-dictionary';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
||||||
|
annotationWrapper.superType = 'suggestion-add';
|
||||||
|
}
|
||||||
|
if (redactionLogEntryWrapper.status === 'APPROVED') {
|
||||||
|
annotationWrapper.superType = 'manual-redaction';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (redactionLogEntryWrapper.redacted) {
|
||||||
|
if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
||||||
|
if (redactionLogEntryWrapper.dictionaryEntry) {
|
||||||
annotationWrapper.superType =
|
annotationWrapper.superType =
|
||||||
redactionLogEntryWrapper.status === 'REQUESTED'
|
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
||||||
? 'suggestion-add'
|
? 'suggestion-add-dictionary'
|
||||||
: 'redaction';
|
: 'suggestion-remove-dictionary';
|
||||||
} else if (redactionLogEntryWrapper.type === 'manual') {
|
|
||||||
annotationWrapper.superType =
|
|
||||||
redactionLogEntryWrapper.status === 'REQUESTED'
|
|
||||||
? 'suggestion-add'
|
|
||||||
: 'manual-redaction';
|
|
||||||
} else {
|
} else {
|
||||||
if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
annotationWrapper.superType =
|
||||||
if (redactionLogEntryWrapper.dictionaryEntry) {
|
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
||||||
annotationWrapper.superType =
|
? 'suggestion-add'
|
||||||
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
: 'suggestion-remove';
|
||||||
? 'suggestion-add-dictionary'
|
}
|
||||||
: 'suggestion-remove-dictionary';
|
}
|
||||||
} else {
|
|
||||||
annotationWrapper.superType =
|
if (redactionLogEntryWrapper.status === 'APPROVED') {
|
||||||
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
if (redactionLogEntryWrapper.dictionaryEntry) {
|
||||||
? 'suggestion-add'
|
annotationWrapper.superType =
|
||||||
: 'suggestion-remove';
|
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
||||||
}
|
? 'add-dictionary'
|
||||||
}
|
: 'remove-dictionary';
|
||||||
if (redactionLogEntryWrapper.status === 'APPROVED') {
|
} else {
|
||||||
if (redactionLogEntryWrapper.dictionaryEntry) {
|
annotationWrapper.superType =
|
||||||
annotationWrapper.superType =
|
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
||||||
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
? 'manual-redaction'
|
||||||
? 'add-dictionary'
|
: 'remove-only-here';
|
||||||
: 'remove-dictionary';
|
|
||||||
} else {
|
|
||||||
annotationWrapper.superType =
|
|
||||||
redactionLogEntryWrapper.manualRedactionType === 'ADD'
|
|
||||||
? 'manual-redaction'
|
|
||||||
: 'remove-only-here';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -347,30 +352,6 @@ export class AnnotationWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static _handleSkippedState(
|
|
||||||
annotationWrapper: AnnotationWrapper,
|
|
||||||
redactionLogEntryWrapper: RedactionLogEntryWrapper
|
|
||||||
) {
|
|
||||||
if (annotationWrapper.superType !== 'skipped') return;
|
|
||||||
|
|
||||||
if (!annotationWrapper.userId) {
|
|
||||||
if (
|
|
||||||
redactionLogEntryWrapper.manualRedactionType === 'REMOVE' ||
|
|
||||||
redactionLogEntryWrapper.manualRedactionType === 'UNDO'
|
|
||||||
) {
|
|
||||||
annotationWrapper.superType = 'pending-analysis';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else if (redactionLogEntryWrapper.status === 'REQUESTED') {
|
|
||||||
annotationWrapper.superType = 'suggestion-force-redaction';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (redactionLogEntryWrapper.actionPendingReanalysis) {
|
|
||||||
annotationWrapper.superType = 'pending-analysis';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static _createContent(
|
private static _createContent(
|
||||||
annotationWrapper: AnnotationWrapper,
|
annotationWrapper: AnnotationWrapper,
|
||||||
entry: RedactionLogEntryWrapper
|
entry: RedactionLogEntryWrapper
|
||||||
|
|||||||
@ -1,11 +1,4 @@
|
|||||||
import {
|
import { RedactionChangeLog, RedactionLog, ViewedPages } from '@redaction/red-ui-http';
|
||||||
IdRemoval,
|
|
||||||
ManualRedactionEntry,
|
|
||||||
ManualRedactions,
|
|
||||||
RedactionChangeLog,
|
|
||||||
RedactionLog,
|
|
||||||
ViewedPages
|
|
||||||
} from '@redaction/red-ui-http';
|
|
||||||
import { FileStatusWrapper } from './file-status.wrapper';
|
import { FileStatusWrapper } from './file-status.wrapper';
|
||||||
import { UserWrapper } from '@services/user.service';
|
import { UserWrapper } from '@services/user.service';
|
||||||
import { AnnotationWrapper } from './annotation.wrapper';
|
import { AnnotationWrapper } from './annotation.wrapper';
|
||||||
@ -24,7 +17,6 @@ export class FileDataModel {
|
|||||||
public fileData: Blob,
|
public fileData: Blob,
|
||||||
public redactionLog: RedactionLog,
|
public redactionLog: RedactionLog,
|
||||||
public redactionChangeLog: RedactionChangeLog,
|
public redactionChangeLog: RedactionChangeLog,
|
||||||
public manualRedactions: ManualRedactions,
|
|
||||||
public viewedPages?: ViewedPages
|
public viewedPages?: ViewedPages
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@ -34,7 +26,7 @@ export class FileDataModel {
|
|||||||
viewMode: ViewMode,
|
viewMode: ViewMode,
|
||||||
areDevFeaturesEnabled: boolean
|
areDevFeaturesEnabled: boolean
|
||||||
): AnnotationData {
|
): AnnotationData {
|
||||||
const entries: RedactionLogEntryWrapper[] = this._convertData(dictionaryData);
|
const entries: RedactionLogEntryWrapper[] = this._convertData();
|
||||||
let allAnnotations = entries
|
let allAnnotations = entries
|
||||||
.map(entry => AnnotationWrapper.fromData(entry))
|
.map(entry => AnnotationWrapper.fromData(entry))
|
||||||
.filter(ann => !this.fileStatus.excludedPages.includes(ann.pageNumber));
|
.filter(ann => !this.fileStatus.excludedPages.includes(ann.pageNumber));
|
||||||
@ -59,9 +51,7 @@ export class FileDataModel {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private _convertData(dictionaryData: {
|
private _convertData(): RedactionLogEntryWrapper[] {
|
||||||
[p: string]: TypeValueWrapper;
|
|
||||||
}): RedactionLogEntryWrapper[] {
|
|
||||||
let result: RedactionLogEntryWrapper[] = [];
|
let result: RedactionLogEntryWrapper[] = [];
|
||||||
|
|
||||||
this.redactionChangeLog?.redactionLogEntry?.forEach(changeLogEntry => {
|
this.redactionChangeLog?.redactionLogEntry?.forEach(changeLogEntry => {
|
||||||
@ -74,14 +64,10 @@ export class FileDataModel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const redactionLogEntryWrapper: RedactionLogEntryWrapper = {
|
const redactionLogEntryWrapper: RedactionLogEntryWrapper = {};
|
||||||
actionPendingReanalysis: false
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.assign(redactionLogEntryWrapper, changeLogEntry);
|
Object.assign(redactionLogEntryWrapper, changeLogEntry);
|
||||||
|
|
||||||
redactionLogEntryWrapper.comments =
|
|
||||||
this.manualRedactions.comments[redactionLogEntryWrapper.id];
|
|
||||||
redactionLogEntryWrapper.isChangeLogEntry = true;
|
redactionLogEntryWrapper.isChangeLogEntry = true;
|
||||||
redactionLogEntryWrapper.changeLogType = changeLogEntry.changeType;
|
redactionLogEntryWrapper.changeLogType = changeLogEntry.changeType;
|
||||||
redactionLogEntryWrapper.id = 'changed-log-removed-' + redactionLogEntryWrapper.id;
|
redactionLogEntryWrapper.id = 'changed-log-removed-' + redactionLogEntryWrapper.id;
|
||||||
@ -89,10 +75,16 @@ export class FileDataModel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const reasonAnnotationIds = [];
|
||||||
this.redactionLog.redactionLogEntry?.forEach(redactionLogEntry => {
|
this.redactionLog.redactionLogEntry?.forEach(redactionLogEntry => {
|
||||||
// false positive entries from the redaction-log need to be skipped
|
if (
|
||||||
if (redactionLogEntry.type?.toLowerCase() === 'false_positive') {
|
redactionLogEntry.manual &&
|
||||||
return;
|
(redactionLogEntry.status === 'APPROVED' ||
|
||||||
|
redactionLogEntry.status === 'REQUESTED')
|
||||||
|
) {
|
||||||
|
// for dictionary entries -> I.E accepted recommendations or false positives,
|
||||||
|
// check reason
|
||||||
|
reasonAnnotationIds.push(redactionLogEntry.reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
const existingChangeLogEntry = this.redactionChangeLog?.redactionLogEntry?.find(
|
const existingChangeLogEntry = this.redactionChangeLog?.redactionLogEntry?.find(
|
||||||
@ -100,208 +92,23 @@ export class FileDataModel {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// copy the redactionLog Entry
|
// copy the redactionLog Entry
|
||||||
const redactionLogEntryWrapper: RedactionLogEntryWrapper = {
|
const redactionLogEntryWrapper: RedactionLogEntryWrapper = {};
|
||||||
actionPendingReanalysis: false
|
|
||||||
};
|
|
||||||
Object.assign(redactionLogEntryWrapper, redactionLogEntry);
|
Object.assign(redactionLogEntryWrapper, redactionLogEntry);
|
||||||
redactionLogEntryWrapper.comments =
|
|
||||||
this.manualRedactions.comments[redactionLogEntryWrapper.id];
|
|
||||||
redactionLogEntryWrapper.isChangeLogEntry = !!existingChangeLogEntry;
|
redactionLogEntryWrapper.isChangeLogEntry = !!existingChangeLogEntry;
|
||||||
redactionLogEntryWrapper.changeLogType = 'ADDED';
|
redactionLogEntryWrapper.changeLogType = 'ADDED';
|
||||||
result.push(redactionLogEntryWrapper);
|
result.push(redactionLogEntryWrapper);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.manualRedactions.forceRedactions?.forEach(forceRedaction => {
|
result = result.filter(r => reasonAnnotationIds.indexOf(r.id) < 0);
|
||||||
const relevantRedactionLogEntry = result.find(r => r.id === forceRedaction.id);
|
|
||||||
|
|
||||||
if (forceRedaction.status === 'DECLINED') {
|
|
||||||
relevantRedactionLogEntry.status = 'DECLINED';
|
|
||||||
relevantRedactionLogEntry.userId = forceRedaction.user;
|
|
||||||
relevantRedactionLogEntry.dictionaryEntry = false;
|
|
||||||
relevantRedactionLogEntry.force = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// an entry for this request already exists in the redactionLog
|
|
||||||
if (relevantRedactionLogEntry) {
|
|
||||||
relevantRedactionLogEntry.userId = forceRedaction.user;
|
|
||||||
relevantRedactionLogEntry.dictionaryEntry = false;
|
|
||||||
relevantRedactionLogEntry.force = true;
|
|
||||||
|
|
||||||
// if statuses differ
|
|
||||||
if (
|
|
||||||
!forceRedaction.processedDate ||
|
|
||||||
forceRedaction.status !== relevantRedactionLogEntry.status
|
|
||||||
) {
|
|
||||||
relevantRedactionLogEntry.actionPendingReanalysis = true;
|
|
||||||
relevantRedactionLogEntry.status = forceRedaction.status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.manualRedactions.entriesToAdd?.forEach(manual => {
|
|
||||||
const markedAsReasonRedactionLogEntry = result.find(r => r.id === manual.reason);
|
|
||||||
|
|
||||||
const relevantRedactionLogEntry = result.find(r => r.id === manual.id);
|
|
||||||
|
|
||||||
// a redaction-log entry is marked as a reason for another entry - hide it
|
|
||||||
if (markedAsReasonRedactionLogEntry) {
|
|
||||||
if (
|
|
||||||
!this._hasBeenProcessed(manual) ||
|
|
||||||
!['APPROVED', 'DECLINED'].includes(manual.status)
|
|
||||||
) {
|
|
||||||
markedAsReasonRedactionLogEntry.hidden = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// an entry for this request already exists in the redactionLog
|
|
||||||
if (relevantRedactionLogEntry) {
|
|
||||||
if (relevantRedactionLogEntry.status === 'DECLINED') {
|
|
||||||
relevantRedactionLogEntry.hidden = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
relevantRedactionLogEntry.userId = manual.user;
|
|
||||||
relevantRedactionLogEntry.dictionaryEntry = manual.addToDictionary;
|
|
||||||
|
|
||||||
// if statuses differ
|
|
||||||
if (relevantRedactionLogEntry.status !== manual.status) {
|
|
||||||
relevantRedactionLogEntry.actionPendingReanalysis = true;
|
|
||||||
relevantRedactionLogEntry.status = manual.status;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// dictionary modifying requests that have been processed already updated
|
|
||||||
// the dictionary and should not be drawn
|
|
||||||
if (manual.addToDictionary && this._hasBeenProcessed(manual)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no entry exists in the redaction log - create it
|
|
||||||
const dictionary = dictionaryData[manual.type];
|
|
||||||
|
|
||||||
const redactionLogEntryWrapper: RedactionLogEntryWrapper = {};
|
|
||||||
|
|
||||||
redactionLogEntryWrapper.id = manual.id;
|
|
||||||
redactionLogEntryWrapper.dictionaryEntry = manual.addToDictionary;
|
|
||||||
redactionLogEntryWrapper.legalBasis = manual.legalBasis;
|
|
||||||
redactionLogEntryWrapper.positions = manual.positions;
|
|
||||||
redactionLogEntryWrapper.reason = manual.reason;
|
|
||||||
redactionLogEntryWrapper.status = manual.status;
|
|
||||||
redactionLogEntryWrapper.type = manual.type;
|
|
||||||
redactionLogEntryWrapper.userId = manual.user;
|
|
||||||
redactionLogEntryWrapper.value = manual.value;
|
|
||||||
redactionLogEntryWrapper.redacted = !dictionary.hint;
|
|
||||||
redactionLogEntryWrapper.hint = dictionary.hint;
|
|
||||||
redactionLogEntryWrapper.manualRedactionType = 'ADD';
|
|
||||||
redactionLogEntryWrapper.manual = true;
|
|
||||||
redactionLogEntryWrapper.comments =
|
|
||||||
this.manualRedactions.comments[redactionLogEntryWrapper.id];
|
|
||||||
if (markedAsReasonRedactionLogEntry) {
|
|
||||||
// cleanup reason if the reason is another annotationId
|
|
||||||
// it is not needed for drawing
|
|
||||||
redactionLogEntryWrapper.reason = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.push(redactionLogEntryWrapper);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.manualRedactions.idsToRemove?.forEach(idToRemove => {
|
|
||||||
const relevantRedactionLogEntry = result.find(r => r.id === idToRemove.id);
|
|
||||||
|
|
||||||
if (!relevantRedactionLogEntry) {
|
|
||||||
// idRemove for something that doesn't exist - skip
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
relevantRedactionLogEntry.userId = idToRemove.user;
|
|
||||||
relevantRedactionLogEntry.dictionaryEntry = idToRemove.removeFromDictionary;
|
|
||||||
|
|
||||||
// if statuses differ
|
|
||||||
if (relevantRedactionLogEntry.status !== idToRemove.status) {
|
|
||||||
relevantRedactionLogEntry.actionPendingReanalysis = true;
|
|
||||||
relevantRedactionLogEntry.status = idToRemove.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._hasBeenProcessed(idToRemove)) {
|
|
||||||
if (idToRemove.status === 'DECLINED') {
|
|
||||||
relevantRedactionLogEntry.status = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.manualRedactions.legalBasisChanges?.forEach(legalBasisChange => {
|
|
||||||
const relevantRedactionLogEntry = result.find(r => r.id === legalBasisChange.id);
|
|
||||||
|
|
||||||
if (!relevantRedactionLogEntry) {
|
|
||||||
// legalBasisChanges for something that doesn't exist - skip
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
relevantRedactionLogEntry.legalBasisChangeValue = legalBasisChange.legalBasis;
|
|
||||||
relevantRedactionLogEntry.userId = legalBasisChange.user;
|
|
||||||
// if statuses differ
|
|
||||||
if (relevantRedactionLogEntry.status !== legalBasisChange.status) {
|
|
||||||
relevantRedactionLogEntry.actionPendingReanalysis = true;
|
|
||||||
relevantRedactionLogEntry.status = legalBasisChange.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._hasBeenProcessed(legalBasisChange)) {
|
|
||||||
if (legalBasisChange.status === 'DECLINED') {
|
|
||||||
relevantRedactionLogEntry.status = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
result.forEach(redactionLogEntry => {
|
result.forEach(redactionLogEntry => {
|
||||||
redactionLogEntry.legalBasisMapping = this.redactionLog.legalBasis;
|
if (redactionLogEntry.id === '96a9fad412ac0ccc340c9ee53f97986b') {
|
||||||
|
redactionLogEntry.dictionaryEntry = true;
|
||||||
if (redactionLogEntry.manual) {
|
|
||||||
if (redactionLogEntry.manualRedactionType === 'ADD') {
|
|
||||||
const foundManualEntry = this.manualRedactions.entriesToAdd.find(
|
|
||||||
me => me.id === redactionLogEntry.id
|
|
||||||
);
|
|
||||||
|
|
||||||
// ADD has been undone - not yet processed
|
|
||||||
if (!foundManualEntry) {
|
|
||||||
redactionLogEntry.hidden = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (redactionLogEntry.manualRedactionType === 'LEGAL_BASIS_CHANGE') {
|
|
||||||
const legalBasisChanges = this.manualRedactions.legalBasisChanges.find(
|
|
||||||
me => me.id === redactionLogEntry.id
|
|
||||||
);
|
|
||||||
// ADD has been undone - not yet processed
|
|
||||||
if (!legalBasisChanges) {
|
|
||||||
redactionLogEntry.manual = false;
|
|
||||||
redactionLogEntry.manualRedactionType = 'UNDO';
|
|
||||||
redactionLogEntry.status = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (redactionLogEntry.manualRedactionType === 'REMOVE') {
|
|
||||||
const foundManualEntry = this.manualRedactions.idsToRemove.find(
|
|
||||||
me => me.id === redactionLogEntry.id
|
|
||||||
);
|
|
||||||
// REMOVE has been undone - not yet processed
|
|
||||||
if (!foundManualEntry) {
|
|
||||||
redactionLogEntry.manual = false;
|
|
||||||
redactionLogEntry.manualRedactionType = 'UNDO';
|
|
||||||
redactionLogEntry.status = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
redactionLogEntry.legalBasisMapping = this.redactionLog.legalBasis;
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove undone entriesToAdd and idsToRemove
|
|
||||||
result = result.filter(redactionLogEntry => !redactionLogEntry.hidden);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _hasBeenProcessed(entry: ManualRedactionEntry | IdRemoval): boolean {
|
|
||||||
return !entry.processedDate
|
|
||||||
? false
|
|
||||||
: new Date(entry.processedDate).getTime() <
|
|
||||||
new Date(this.fileStatus.lastProcessed).getTime();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ export interface RedactionLogEntryWrapper {
|
|||||||
legalBasis?: string;
|
legalBasis?: string;
|
||||||
legalBasisMapping?: Array<LegalBasisMapping>;
|
legalBasisMapping?: Array<LegalBasisMapping>;
|
||||||
manual?: boolean;
|
manual?: boolean;
|
||||||
manualRedactionType?: 'ADD' | 'REMOVE' | 'UNDO' | 'LEGAL_BASIS_CHANGE';
|
manualRedactionType?: 'ADD' | 'REMOVE' | 'UNDO' | 'LEGAL_BASIS_CHANGE' | 'FORCE_REDACT';
|
||||||
matchedRule?: number;
|
matchedRule?: number;
|
||||||
positions?: Array<Rectangle>;
|
positions?: Array<Rectangle>;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
@ -20,14 +20,11 @@ export interface RedactionLogEntryWrapper {
|
|||||||
textBefore?: string;
|
textBefore?: string;
|
||||||
type?: string;
|
type?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
force?: boolean;
|
|
||||||
image?: boolean;
|
image?: boolean;
|
||||||
|
|
||||||
recommendation?: boolean;
|
recommendation?: boolean;
|
||||||
recommendationAnnotationId?: string;
|
recommendationAnnotationId?: string;
|
||||||
|
|
||||||
actionPendingReanalysis?: boolean;
|
|
||||||
|
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
|
|
||||||
userId?: string;
|
userId?: string;
|
||||||
|
|||||||
@ -27,7 +27,10 @@ export class RedRoleGuard implements CanActivate {
|
|||||||
if (
|
if (
|
||||||
this._userService.user.isUserAdmin &&
|
this._userService.user.isUserAdmin &&
|
||||||
!this._userService.user.isAdmin &&
|
!this._userService.user.isAdmin &&
|
||||||
!state.url.startsWith('/main/admin/users')
|
!(
|
||||||
|
state.url.startsWith('/main/admin/users') ||
|
||||||
|
state.url.startsWith('/main/my-profile')
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
this._router.navigate(['/main/admin/users']);
|
this._router.navigate(['/main/admin/users']);
|
||||||
obs.next(false);
|
obs.next(false);
|
||||||
|
|||||||
@ -115,7 +115,7 @@
|
|||||||
|
|
||||||
<redaction-circle-button
|
<redaction-circle-button
|
||||||
(action)="ocrFile($event)"
|
(action)="ocrFile($event)"
|
||||||
*ngIf="canOcr && screen === 'dossier-overview'"
|
*ngIf="canOcr"
|
||||||
[tooltipPosition]="tooltipPosition"
|
[tooltipPosition]="tooltipPosition"
|
||||||
[type]="buttonType"
|
[type]="buttonType"
|
||||||
icon="red:ocr"
|
icon="red:ocr"
|
||||||
|
|||||||
@ -78,6 +78,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
@ViewChild(PdfViewerComponent) viewerComponent: PdfViewerComponent;
|
@ViewChild(PdfViewerComponent) viewerComponent: PdfViewerComponent;
|
||||||
private _instance: WebViewerInstance;
|
private _instance: WebViewerInstance;
|
||||||
private _lastPage: string;
|
private _lastPage: string;
|
||||||
|
private _reloadFileOnReanalysis = false;
|
||||||
|
|
||||||
@ViewChild('fileWorkloadComponent') private _workloadComponent: FileWorkloadComponent;
|
@ViewChild('fileWorkloadComponent') private _workloadComponent: FileWorkloadComponent;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -254,7 +256,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ngOnAttach(previousRoute: ActivatedRouteSnapshot) {
|
async ngOnAttach(previousRoute: ActivatedRouteSnapshot) {
|
||||||
console.log('on attach');
|
|
||||||
if (!this.permissionsService.canOpenFile(this.appStateService.activeFile)) {
|
if (!this.permissionsService.canOpenFile(this.appStateService.activeFile)) {
|
||||||
await this._router.navigate(['/main/dossiers/' + this.dossierId]);
|
await this._router.navigate(['/main/dossiers/' + this.dossierId]);
|
||||||
return;
|
return;
|
||||||
@ -501,6 +502,11 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
this.viewDocumentInfo = false;
|
this.viewDocumentInfo = false;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case 'ocr-file':
|
||||||
|
this._updateCanPerformActions();
|
||||||
|
this._reloadFileOnReanalysis = true;
|
||||||
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this._updateCanPerformActions();
|
this._updateCanPerformActions();
|
||||||
}
|
}
|
||||||
@ -605,7 +611,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
this.fileReanalysedSubscription = this.appStateService.fileReanalysed.subscribe(
|
this.fileReanalysedSubscription = this.appStateService.fileReanalysed.subscribe(
|
||||||
async (fileStatus: FileStatusWrapper) => {
|
async (fileStatus: FileStatusWrapper) => {
|
||||||
if (fileStatus.fileId === this.fileId) {
|
if (fileStatus.fileId === this.fileId) {
|
||||||
await this._loadFileData(true);
|
await this._loadFileData(!this._reloadFileOnReanalysis);
|
||||||
|
this._reloadFileOnReanalysis = false;
|
||||||
this.viewReady = true;
|
this.viewReady = true;
|
||||||
this._updateCanPerformActions();
|
this._updateCanPerformActions();
|
||||||
this._cleanupAndRedrawManualAnnotations();
|
this._cleanupAndRedrawManualAnnotations();
|
||||||
@ -633,7 +640,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
this.fileData.redactionLog = fileData.redactionLog;
|
this.fileData.redactionLog = fileData.redactionLog;
|
||||||
this.fileData.redactionChangeLog = fileData.redactionChangeLog;
|
this.fileData.redactionChangeLog = fileData.redactionChangeLog;
|
||||||
this.fileData.fileStatus = fileData.fileStatus;
|
this.fileData.fileStatus = fileData.fileStatus;
|
||||||
this.fileData.manualRedactions = fileData.manualRedactions;
|
|
||||||
this.rebuildFilters(true);
|
this.rebuildFilters(true);
|
||||||
} else {
|
} else {
|
||||||
this.fileData = fileData;
|
this.fileData = fileData;
|
||||||
@ -657,9 +663,10 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
/* Get the documentElement (<html>) to display the page in fullscreen */
|
/* Get the documentElement (<html>) to display the page in fullscreen */
|
||||||
|
|
||||||
private _cleanupAndRedrawManualAnnotations() {
|
private _cleanupAndRedrawManualAnnotations() {
|
||||||
this._fileDownloadService.loadActiveFileManualAnnotations().subscribe(manualRedactions => {
|
this._fileDownloadService
|
||||||
this.fileData.manualRedactions = manualRedactions;
|
.loadActiveFileRedactionLogPreview()
|
||||||
this.rebuildFilters();
|
.subscribe(redactionLogPreview => {
|
||||||
|
this.fileData.redactionLog = redactionLogPreview;
|
||||||
this._annotationDrawService.drawAnnotations(
|
this._annotationDrawService.drawAnnotations(
|
||||||
this._instance,
|
this._instance,
|
||||||
this.annotationData.allAnnotations,
|
this.annotationData.allAnnotations,
|
||||||
@ -674,8 +681,10 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
const currentPageAnnotationIds = currentPageAnnotations.map(a => a.id);
|
const currentPageAnnotationIds = currentPageAnnotations.map(a => a.id);
|
||||||
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
||||||
|
|
||||||
this._fileDownloadService.loadActiveFileManualAnnotations().subscribe(manualRedactions => {
|
this._fileDownloadService
|
||||||
this.fileData.manualRedactions = manualRedactions;
|
.loadActiveFileRedactionLogPreview()
|
||||||
|
.subscribe(redactionLogPreview => {
|
||||||
|
this.fileData.redactionLog = redactionLogPreview;
|
||||||
this.rebuildFilters();
|
this.rebuildFilters();
|
||||||
if (this.viewMode === 'STANDARD') {
|
if (this.viewMode === 'STANDARD') {
|
||||||
currentPageAnnotationIds.forEach(id => {
|
currentPageAnnotationIds.forEach(id => {
|
||||||
|
|||||||
@ -17,14 +17,14 @@ export class PdfViewerDataService {
|
|||||||
constructor(
|
constructor(
|
||||||
private readonly _appStateService: AppStateService,
|
private readonly _appStateService: AppStateService,
|
||||||
private readonly _permissionsService: PermissionsService,
|
private readonly _permissionsService: PermissionsService,
|
||||||
|
private readonly _man: ManualRedactionControllerService,
|
||||||
private readonly _fileManagementControllerService: FileManagementControllerService,
|
private readonly _fileManagementControllerService: FileManagementControllerService,
|
||||||
private readonly _manualRedactionControllerService: ManualRedactionControllerService,
|
|
||||||
private readonly _redactionLogControllerService: RedactionLogControllerService,
|
private readonly _redactionLogControllerService: RedactionLogControllerService,
|
||||||
private readonly _viewedPagesControllerService: ViewedPagesControllerService
|
private readonly _viewedPagesControllerService: ViewedPagesControllerService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
loadActiveFileManualAnnotations() {
|
loadActiveFileRedactionLogPreview() {
|
||||||
return this._manualRedactionControllerService.getManualRedaction(
|
return this._redactionLogControllerService.getRedactionLogPreview(
|
||||||
this._appStateService.activeDossierId,
|
this._appStateService.activeDossierId,
|
||||||
this._appStateService.activeFileId
|
this._appStateService.activeFileId
|
||||||
);
|
);
|
||||||
@ -34,25 +34,20 @@ export class PdfViewerDataService {
|
|||||||
const dossierId = this._appStateService.activeDossierId;
|
const dossierId = this._appStateService.activeDossierId;
|
||||||
const fileId = this._appStateService.activeFileId;
|
const fileId = this._appStateService.activeFileId;
|
||||||
|
|
||||||
|
this._man.getManualRedaction(dossierId, fileId).subscribe();
|
||||||
|
|
||||||
const file$ = this.downloadOriginalFile(this._appStateService.activeFile);
|
const file$ = this.downloadOriginalFile(this._appStateService.activeFile);
|
||||||
const reactionLog$ = this._redactionLogControllerService
|
const reactionLog$ = this._redactionLogControllerService
|
||||||
.getRedactionLog(dossierId, fileId)
|
.getRedactionLogPreview(dossierId, fileId)
|
||||||
.pipe(catchError(() => of({})));
|
.pipe(catchError(() => of({})));
|
||||||
const redactionChangeLog$ = this._redactionLogControllerService
|
const redactionChangeLog$ = this._redactionLogControllerService
|
||||||
.getRedactionChangeLog(dossierId, fileId)
|
.getRedactionChangeLog(dossierId, fileId)
|
||||||
.pipe(catchError(() => of({})));
|
.pipe(catchError(() => of({})));
|
||||||
const manualRedactions$ = this._manualRedactionControllerService
|
|
||||||
.getManualRedaction(dossierId, fileId)
|
|
||||||
.pipe(catchError(() => of({})));
|
|
||||||
const viewedPages$ = this.getViewedPagesForActiveFile();
|
const viewedPages$ = this.getViewedPagesForActiveFile();
|
||||||
|
|
||||||
return forkJoin([
|
return forkJoin([file$, reactionLog$, redactionChangeLog$, viewedPages$]).pipe(
|
||||||
file$,
|
map(data => new FileDataModel(this._appStateService.activeFile, ...data))
|
||||||
reactionLog$,
|
);
|
||||||
redactionChangeLog$,
|
|
||||||
manualRedactions$,
|
|
||||||
viewedPages$
|
|
||||||
]).pipe(map(data => new FileDataModel(this._appStateService.activeFile, ...data)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewedPagesForActiveFile() {
|
getViewedPagesForActiveFile() {
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export class FileDownloadService {
|
|||||||
) {
|
) {
|
||||||
interval(5000).subscribe(() => {
|
interval(5000).subscribe(() => {
|
||||||
if (_permissionsService.isUser()) {
|
if (_permissionsService.isUser()) {
|
||||||
this.getDownloadStatus().subscribe(() => {});
|
this.getDownloadStatus().subscribe(() => {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export class FileUploadService {
|
|||||||
private readonly _dialogService: UploadDownloadDialogService
|
private readonly _dialogService: UploadDownloadDialogService
|
||||||
) {
|
) {
|
||||||
this._uploadControllerService.defaultHeaders =
|
this._uploadControllerService.defaultHeaders =
|
||||||
this._uploadControllerService.defaultHeaders.append('ngsw-bypass', 'true' );
|
this._uploadControllerService.defaultHeaders.append('ngsw-bypass', 'true');
|
||||||
interval(2500).subscribe(() => {
|
interval(2500).subscribe(() => {
|
||||||
this._handleUploads();
|
this._handleUploads();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,8 +11,7 @@
|
|||||||
*/ /* tslint:disable:no-unused-variable member-ordering */
|
*/ /* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
import { Inject, Injectable, Optional } from '@angular/core';
|
import { Inject, Injectable, Optional } from '@angular/core';
|
||||||
import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http';
|
import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
import { CustomHttpUrlEncodingCodec } from '../encoder';
|
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@ -22,7 +21,7 @@ import { DossierAttributesConfig } from '../model/dossierAttributesConfig';
|
|||||||
import { DossierAttributesReq } from '../model/dossierAttributesReq';
|
import { DossierAttributesReq } from '../model/dossierAttributesReq';
|
||||||
import { DossierAttributesRes } from '../model/dossierAttributesRes';
|
import { DossierAttributesRes } from '../model/dossierAttributesRes';
|
||||||
|
|
||||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
import { BASE_PATH } from '../variables';
|
||||||
import { Configuration } from '../configuration';
|
import { Configuration } from '../configuration';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@ -11,15 +11,14 @@
|
|||||||
*/ /* tslint:disable:no-unused-variable member-ordering */
|
*/ /* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
import { Inject, Injectable, Optional } from '@angular/core';
|
import { Inject, Injectable, Optional } from '@angular/core';
|
||||||
import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http';
|
import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
import { CustomHttpUrlEncodingCodec } from '../encoder';
|
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { Dossier } from '../model/dossier';
|
import { Dossier } from '../model/dossier';
|
||||||
import { DossierRequest } from '../model/dossierRequest';
|
import { DossierRequest } from '../model/dossierRequest';
|
||||||
|
|
||||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
import { BASE_PATH } from '../variables';
|
||||||
import { Configuration } from '../configuration';
|
import { Configuration } from '../configuration';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@ -11,12 +11,12 @@
|
|||||||
*/ /* tslint:disable:no-unused-variable member-ordering */
|
*/ /* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
import { Inject, Injectable, Optional } from '@angular/core';
|
import { Inject, Injectable, Optional } from '@angular/core';
|
||||||
import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http';
|
import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
|
||||||
import { CustomHttpUrlEncodingCodec } from '../encoder';
|
import { CustomHttpUrlEncodingCodec } from '../encoder';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
import { BASE_PATH } from '../variables';
|
||||||
import { Configuration } from '../configuration';
|
import { Configuration } from '../configuration';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@ -201,6 +201,82 @@ export class RedactionLogControllerService {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Gets the redaction log preview
|
||||||
|
* None
|
||||||
|
* @param dossierId dossierId
|
||||||
|
* @param fileId fileId
|
||||||
|
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||||
|
* @param reportProgress flag to report request and response progress.
|
||||||
|
*/
|
||||||
|
public getRedactionLogPreview(
|
||||||
|
dossierId: string,
|
||||||
|
fileId: string,
|
||||||
|
observe?: 'body',
|
||||||
|
reportProgress?: boolean
|
||||||
|
): Observable<RedactionLog>;
|
||||||
|
public getRedactionLogPreview(
|
||||||
|
dossierId: string,
|
||||||
|
fileId: string,
|
||||||
|
observe?: 'response',
|
||||||
|
reportProgress?: boolean
|
||||||
|
): Observable<HttpResponse<RedactionLog>>;
|
||||||
|
public getRedactionLogPreview(
|
||||||
|
dossierId: string,
|
||||||
|
fileId: string,
|
||||||
|
observe?: 'events',
|
||||||
|
reportProgress?: boolean
|
||||||
|
): Observable<HttpEvent<RedactionLog>>;
|
||||||
|
public getRedactionLogPreview(
|
||||||
|
dossierId: string,
|
||||||
|
fileId: string,
|
||||||
|
observe: any = 'body',
|
||||||
|
reportProgress: boolean = false
|
||||||
|
): Observable<any> {
|
||||||
|
if (dossierId === null || dossierId === undefined) {
|
||||||
|
throw new Error(
|
||||||
|
'Required parameter dossierId was null or undefined when calling getRedactionLogPreview.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileId === null || fileId === undefined) {
|
||||||
|
throw new Error(
|
||||||
|
'Required parameter fileId was null or undefined when calling getRedactionLogPreview.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let headers = this.defaultHeaders;
|
||||||
|
|
||||||
|
// authentication (RED-OAUTH) required
|
||||||
|
if (this.configuration.accessToken) {
|
||||||
|
const accessToken =
|
||||||
|
typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
const httpHeaderAccepts: string[] = ['application/json'];
|
||||||
|
const httpHeaderAcceptSelected: string | undefined =
|
||||||
|
this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
|
if (httpHeaderAcceptSelected !== undefined) {
|
||||||
|
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.httpClient.request<RedactionLog>(
|
||||||
|
'get',
|
||||||
|
`${this.basePath}/sectionGrid/${encodeURIComponent(
|
||||||
|
String(dossierId)
|
||||||
|
)}/${encodeURIComponent(String(fileId))}/preview`,
|
||||||
|
{
|
||||||
|
withCredentials: this.configuration.withCredentials,
|
||||||
|
headers: headers,
|
||||||
|
observe: observe,
|
||||||
|
reportProgress: reportProgress
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the section grid for a fileId
|
* Gets the section grid for a fileId
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user