DM-337 - Add/Remove annotations dialog in DocuMine
This commit is contained in:
parent
38469c392d
commit
11cd73e3bd
@ -19,6 +19,8 @@ export class AddAnnotationDialogComponent
|
||||
dictionaries: Dictionary[] = [];
|
||||
form!: UntypedFormGroup;
|
||||
|
||||
#applyToAllDossiers: boolean;
|
||||
|
||||
readonly #dossier: Dossier;
|
||||
readonly #isRss = this._iqserPermissionsService.has(Roles.getRss);
|
||||
|
||||
@ -30,6 +32,7 @@ export class AddAnnotationDialogComponent
|
||||
) {
|
||||
super();
|
||||
this.#dossier = _activeDossiersService.find(this.data.dossierId);
|
||||
this.#applyToAllDossiers = !!this.data.applyToAllDossiers;
|
||||
this.form = this.#getForm();
|
||||
}
|
||||
|
||||
@ -79,5 +82,6 @@ export class AddAnnotationDialogComponent
|
||||
addRedactionRequest.comment = commentValue ? { text: commentValue } : null;
|
||||
addRedactionRequest.section = null;
|
||||
addRedactionRequest.value = this.form.get('selectedText').value;
|
||||
addRedactionRequest.addToAllDossiers = this.data.isApprover && addRedactionRequest.addToDictionary && this.#applyToAllDossiers;
|
||||
}
|
||||
}
|
||||
|
||||
@ -860,20 +860,13 @@ export class FilePreviewScreenComponent
|
||||
|
||||
#getRedactTextDialogData(manualRedactionEntryWrapper: ManualRedactionEntryWrapper, file: File): RedactTextData {
|
||||
const dossierTemplate = this._dossierTemplatesService.find(this.state.dossierTemplateId);
|
||||
const isApprover = this.permissionsService.isApprover(this.state.dossier());
|
||||
const applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault;
|
||||
|
||||
const data = {
|
||||
return {
|
||||
manualRedactionEntryWrapper,
|
||||
dossierId: this.dossierId,
|
||||
file,
|
||||
};
|
||||
if (this.#isDocumine) {
|
||||
return data;
|
||||
}
|
||||
|
||||
const isApprover = this.permissionsService.isApprover(this.state.dossier());
|
||||
const applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault;
|
||||
return {
|
||||
...data,
|
||||
applyToAllDossiers: isApprover ? applyDictionaryUpdatesToAllDossiersByDefault : false,
|
||||
isApprover,
|
||||
};
|
||||
|
||||
@ -4,17 +4,15 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { DetailsRadioOption } from '@iqser/common-ui';
|
||||
import { RemoveRedactionOption } from './dialog-options';
|
||||
|
||||
export interface AddAnnotationData {
|
||||
export interface RedactTextData {
|
||||
manualRedactionEntryWrapper: ManualRedactionEntryWrapper;
|
||||
dossierId: string;
|
||||
file: File;
|
||||
}
|
||||
|
||||
export interface RedactTextData extends AddAnnotationData {
|
||||
applyToAllDossiers?: boolean;
|
||||
isApprover?: boolean;
|
||||
}
|
||||
|
||||
export type AddAnnotationData = RedactTextData;
|
||||
export type AddHintData = RedactTextData;
|
||||
|
||||
export interface RedactTextResult {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user