Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1233761ac3 | ||
|
|
fd3b99a785 | ||
|
|
f9361a2e82 | ||
|
|
4acb4d4eb7 | ||
|
|
7d4d2889da |
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mat-mdc-menu-item.notification {
|
.mat-mdc-menu-item.notification {
|
||||||
padding: 8px 26px 10px 8px;
|
padding: 8px 26px 10px 8px !important;
|
||||||
margin: 2px 0 0 0;
|
margin: 2px 0 0 0;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@ -588,4 +588,16 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On
|
|||||||
this.displayedPages.every((value, index) => value === newDisplayedPages[index])
|
this.displayedPages.every((value, index) => value === newDisplayedPages[index])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HostListener('click', ['$event'])
|
||||||
|
clickInsideWorkloadView($event: MouseEvent) {
|
||||||
|
$event?.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@HostListener('document: click')
|
||||||
|
clickOutsideWorkloadView() {
|
||||||
|
if (this.multiSelectService.active()) {
|
||||||
|
this.multiSelectService.deactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ import {
|
|||||||
import { DetailsRadioComponent } from '@common-ui/inputs/details-radio/details-radio.component';
|
import { DetailsRadioComponent } from '@common-ui/inputs/details-radio/details-radio.component';
|
||||||
import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option';
|
import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option';
|
||||||
import { validatePageRange } from '../../utils/form-validators';
|
import { validatePageRange } from '../../utils/form-validators';
|
||||||
import { parseRectanglePosition, parseSelectedPageNumbers } from '../../utils/enhance-manual-redaction-request.utils';
|
import { parseRectanglePosition, parseSelectedPageNumbers, prefillPageRange } from '../../utils/enhance-manual-redaction-request.utils';
|
||||||
|
|
||||||
interface TypeSelectOptions {
|
interface TypeSelectOptions {
|
||||||
type: string;
|
type: string;
|
||||||
@ -103,6 +103,14 @@ export class EditRedactionDialogComponent
|
|||||||
private readonly _dictionaryService: DictionaryService,
|
private readonly _dictionaryService: DictionaryService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
if (this.allRectangles) {
|
||||||
|
prefillPageRange(
|
||||||
|
this.data.annotations[0],
|
||||||
|
this.data.allFileAnnotations,
|
||||||
|
this.options as DetailsRadioOption<RectangleRedactOption>[],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get displayedDictionaryLabel() {
|
get displayedDictionaryLabel() {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dialog-content {
|
.dialog-content {
|
||||||
height: 650px;
|
height: 610px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ import {
|
|||||||
} from '../../utils/dialog-types';
|
} from '../../utils/dialog-types';
|
||||||
import { isJustOne } from '@common-ui/utils';
|
import { isJustOne } from '@common-ui/utils';
|
||||||
import { validatePageRange } from '../../utils/form-validators';
|
import { validatePageRange } from '../../utils/form-validators';
|
||||||
import { parseRectanglePosition, parseSelectedPageNumbers } from '../../utils/enhance-manual-redaction-request.utils';
|
import { parseRectanglePosition, parseSelectedPageNumbers, prefillPageRange } from '../../utils/enhance-manual-redaction-request.utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './remove-redaction-dialog.component.html',
|
templateUrl: './remove-redaction-dialog.component.html',
|
||||||
@ -140,6 +140,14 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
|||||||
private readonly _userPreferences: UserPreferenceService,
|
private readonly _userPreferences: UserPreferenceService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
if (this.#allRectangles) {
|
||||||
|
prefillPageRange(
|
||||||
|
this.data.redactions[0],
|
||||||
|
this.data.allFileRedactions,
|
||||||
|
this.options as DetailsRadioOption<RectangleRedactOption>[],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get hasFalsePositiveOption() {
|
get hasFalsePositiveOption() {
|
||||||
|
|||||||
@ -253,6 +253,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.pdf.instance.UI.hotkeys.off('esc');
|
this.pdf.instance.UI.hotkeys.off('esc');
|
||||||
|
this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick);
|
||||||
super.ngOnDestroy();
|
super.ngOnDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,6 +278,15 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bind()
|
||||||
|
handleViewerClick() {
|
||||||
|
this._ngZone.run(() => {
|
||||||
|
if (this._multiSelectService.active()) {
|
||||||
|
this._multiSelectService.deactivate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async ngOnAttach(previousRoute: ActivatedRouteSnapshot) {
|
async ngOnAttach(previousRoute: ActivatedRouteSnapshot) {
|
||||||
if (!this.state.file().canBeOpened) {
|
if (!this.state.file().canBeOpened) {
|
||||||
return this.#navigateToDossier();
|
return this.#navigateToDossier();
|
||||||
@ -307,6 +317,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
this.#restoreOldFilters();
|
this.#restoreOldFilters();
|
||||||
this.pdf.instance.UI.hotkeys.on('esc', this.handleEscInsideViewer);
|
this.pdf.instance.UI.hotkeys.on('esc', this.handleEscInsideViewer);
|
||||||
this._viewerHeaderService.resetLayers();
|
this._viewerHeaderService.resetLayers();
|
||||||
|
this.pdf.instance.UI.iframeWindow.document.addEventListener('click', this.handleViewerClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
async openRectangleAnnotationDialog(manualRedactionEntryWrapper: ManualRedactionEntryWrapper) {
|
async openRectangleAnnotationDialog(manualRedactionEntryWrapper: ManualRedactionEntryWrapper) {
|
||||||
|
|||||||
@ -95,7 +95,7 @@ export class AnnotationActionsService {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const addAnnotationRequest = annotations.map(a => ({
|
const addAnnotationRequest = annotations.map(a => ({
|
||||||
comment: { text: request.comment },
|
comment: request.comment,
|
||||||
legalBasis: request.legalBasis,
|
legalBasis: request.legalBasis,
|
||||||
reason: request.reason,
|
reason: request.reason,
|
||||||
positions: a.positions,
|
positions: a.positions,
|
||||||
@ -113,9 +113,11 @@ export class AnnotationActionsService {
|
|||||||
|
|
||||||
async editRedaction(annotations: AnnotationWrapper[]) {
|
async editRedaction(annotations: AnnotationWrapper[]) {
|
||||||
const { dossierId, file } = this._state;
|
const { dossierId, file } = this._state;
|
||||||
|
const allFileAnnotations = this._fileDataService.annotations();
|
||||||
const includeUnprocessed = annotations.every(annotation => this.#includeUnprocessed(annotation, true));
|
const includeUnprocessed = annotations.every(annotation => this.#includeUnprocessed(annotation, true));
|
||||||
const data = {
|
const data = {
|
||||||
annotations,
|
annotations,
|
||||||
|
allFileAnnotations,
|
||||||
dossierId,
|
dossierId,
|
||||||
file: file(),
|
file: file(),
|
||||||
};
|
};
|
||||||
@ -184,9 +186,11 @@ export class AnnotationActionsService {
|
|||||||
const dossierTemplate = this._dossierTemplatesService.find(this._state.dossierTemplateId);
|
const dossierTemplate = this._dossierTemplatesService.find(this._state.dossierTemplateId);
|
||||||
const isApprover = this._permissionsService.isApprover(this._state.dossier());
|
const isApprover = this._permissionsService.isApprover(this._state.dossier());
|
||||||
const { file } = this._state;
|
const { file } = this._state;
|
||||||
|
const allFileRedactions = this._fileDataService.annotations();
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
redactions,
|
redactions,
|
||||||
|
allFileRedactions,
|
||||||
file: file(),
|
file: file(),
|
||||||
dossier: this._state.dossier(),
|
dossier: this._state.dossier(),
|
||||||
falsePositiveContext: redactions.map(r => this.#getFalsePositiveText(r)),
|
falsePositiveContext: redactions.map(r => this.#getFalsePositiveText(r)),
|
||||||
|
|||||||
@ -64,6 +64,7 @@ export interface RedactTextData {
|
|||||||
|
|
||||||
export interface EditRedactionData {
|
export interface EditRedactionData {
|
||||||
annotations: AnnotationWrapper[];
|
annotations: AnnotationWrapper[];
|
||||||
|
allFileAnnotations?: AnnotationWrapper[];
|
||||||
dossierId: string;
|
dossierId: string;
|
||||||
file: File;
|
file: File;
|
||||||
isApprover?: boolean;
|
isApprover?: boolean;
|
||||||
@ -135,6 +136,7 @@ export interface RemoveRedactionPermissions {
|
|||||||
|
|
||||||
export interface RemoveRedactionData {
|
export interface RemoveRedactionData {
|
||||||
redactions: AnnotationWrapper[];
|
redactions: AnnotationWrapper[];
|
||||||
|
allFileRedactions?: AnnotationWrapper[];
|
||||||
dossier: Dossier;
|
dossier: Dossier;
|
||||||
file?: File;
|
file?: File;
|
||||||
falsePositiveContext: string[];
|
falsePositiveContext: string[];
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Dictionary, File, IAddRedactionRequest, IEntityLogEntryPosition, SuperType } from '@red/domain';
|
import { Dictionary, File, IAddRedactionRequest, IEntityLogEntryPosition, SuperType } from '@red/domain';
|
||||||
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
||||||
import { LegalBasisOption } from './dialog-types';
|
import { LegalBasisOption, RectangleRedactOption, RectangleRedactOptions } from './dialog-types';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
|
import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option';
|
||||||
|
|
||||||
export interface EnhanceRequestData {
|
export interface EnhanceRequestData {
|
||||||
readonly type: SuperType | null;
|
readonly type: SuperType | null;
|
||||||
@ -79,3 +80,60 @@ export const parseRectanglePosition = (annotation: AnnotationWrapper) => {
|
|||||||
pageNumber: position.page,
|
pageNumber: position.page,
|
||||||
} as IEntityLogEntryPosition;
|
} as IEntityLogEntryPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const prefillPageRange = (
|
||||||
|
annotation: AnnotationWrapper,
|
||||||
|
allFileAnnotations: AnnotationWrapper[],
|
||||||
|
options: DetailsRadioOption<RectangleRedactOption>[],
|
||||||
|
) => {
|
||||||
|
const option = options.find(o => o.value === RectangleRedactOptions.MULTIPLE_PAGES);
|
||||||
|
const pages = extractPages(annotation, allFileAnnotations);
|
||||||
|
option.additionalInput.value = toRangeString(pages);
|
||||||
|
};
|
||||||
|
|
||||||
|
const extractPages = (annotation: AnnotationWrapper, allFileAnnotations: AnnotationWrapper[]): number[] => {
|
||||||
|
return allFileAnnotations.reduce((pages, a) => {
|
||||||
|
const position = a.positions[0];
|
||||||
|
const annotationPosition = annotation.positions[0];
|
||||||
|
if (
|
||||||
|
position.height === annotationPosition.height &&
|
||||||
|
position.width === annotationPosition.width &&
|
||||||
|
position.topLeft.x === annotationPosition.topLeft.x &&
|
||||||
|
position.topLeft.y === annotationPosition.topLeft.y
|
||||||
|
) {
|
||||||
|
pages.push(position.page);
|
||||||
|
}
|
||||||
|
return pages;
|
||||||
|
}, []);
|
||||||
|
};
|
||||||
|
|
||||||
|
const toRangeString = (pages: number[]): string => {
|
||||||
|
if (pages.length === 0) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
let ranges = [];
|
||||||
|
let start = pages[0];
|
||||||
|
let end = pages[0];
|
||||||
|
|
||||||
|
for (let i = 1; i < pages.length; i++) {
|
||||||
|
if (pages[i] === end + 1) {
|
||||||
|
end = pages[i];
|
||||||
|
} else {
|
||||||
|
if (start === end) {
|
||||||
|
ranges.push(`${start}`);
|
||||||
|
} else {
|
||||||
|
ranges.push(`${start}-${end}`);
|
||||||
|
}
|
||||||
|
start = end = pages[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (start === end) {
|
||||||
|
ranges.push(`${start}`);
|
||||||
|
} else {
|
||||||
|
ranges.push(`${start}-${end}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ranges.join(',');
|
||||||
|
};
|
||||||
|
|||||||
@ -2134,7 +2134,7 @@
|
|||||||
"type": "Typ",
|
"type": "Typ",
|
||||||
"type-placeholder": "Typ auswählen...",
|
"type-placeholder": "Typ auswählen...",
|
||||||
"unchanged": "Ungeändert",
|
"unchanged": "Ungeändert",
|
||||||
"value": ""
|
"value": "Wert"
|
||||||
},
|
},
|
||||||
"title": "Text schwärzen"
|
"title": "Text schwärzen"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2134,7 +2134,7 @@
|
|||||||
"type": "Type",
|
"type": "Type",
|
||||||
"type-placeholder": "Select type...",
|
"type-placeholder": "Select type...",
|
||||||
"unchanged": "",
|
"unchanged": "",
|
||||||
"value": ""
|
"value": "Wert"
|
||||||
},
|
},
|
||||||
"title": "Redact text"
|
"title": "Redact text"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit e88929f0d48e54298d85ef05ea467980be11524b
|
Subproject commit ba85260cc4a3e780a37b3f41be26b83d045a1dcb
|
||||||
Loading…
x
Reference in New Issue
Block a user