Merge branch 'VM/RED-10256' into 'master'
RED-10256 - Bulk-local: Changes should not be filtered + Remove for image-based redactions Closes RED-10256 See merge request redactmanager/red-ui!648
This commit is contained in:
commit
7f72ef0021
@ -46,13 +46,12 @@ export class RemoveAnnotationDialogComponent extends IqserDialogComponent<
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
readonly options: DetailsRadioOption<RemoveAnnotationOption>[];
|
||||
readonly redactedTexts: string[];
|
||||
readonly isImage = this.data.redactions.reduce((acc, next) => acc && next.isImage, true);
|
||||
|
||||
form!: UntypedFormGroup;
|
||||
|
||||
constructor(private readonly _formBuilder: FormBuilder) {
|
||||
super();
|
||||
this.options = getRemoveRedactionOptions(this.data, this.data.applyToAllDossiers, this.isImage, true);
|
||||
this.options = getRemoveRedactionOptions(this.data, this.data.applyToAllDossiers, true);
|
||||
this.redactedTexts = this.data.redactions.map(annotation => annotation.value);
|
||||
this.form = this.#getForm();
|
||||
}
|
||||
|
||||
@ -66,7 +66,6 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
||||
readonly recommendation = this.data.redactions.every(redaction => redaction.isRecommendation);
|
||||
readonly hint = this.data.redactions.every(redaction => redaction.isHint);
|
||||
readonly annotationsType = this.hint ? 'hint' : this.recommendation ? 'recommendation' : 'redaction';
|
||||
readonly isImage = this.data.redactions.reduce((acc, next) => acc && next.isImage, true);
|
||||
readonly optionByType = {
|
||||
recommendation: {
|
||||
main: this._userPreferences.getRemoveRecommendationDefaultOption(),
|
||||
@ -108,7 +107,6 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
||||
: getRemoveRedactionOptions(
|
||||
this.data,
|
||||
this.isSystemDefault || this.isExtraOptionSystemDefault ? this.#applyToAllDossiers : this.extraOptionPreference,
|
||||
this.isImage,
|
||||
);
|
||||
readonly skipped = this.data.redactions.some(annotation => annotation.isSkipped);
|
||||
readonly redactedTexts = this.data.redactions.map(annotation => annotation.value);
|
||||
|
||||
@ -166,12 +166,12 @@ export const getResizeRedactionOptions = (
|
||||
export const getRemoveRedactionOptions = (
|
||||
data: RemoveRedactionData,
|
||||
applyToAllDossiers: boolean,
|
||||
isImage: boolean,
|
||||
isDocumine: boolean = false,
|
||||
): DetailsRadioOption<RemoveRedactionOption>[] => {
|
||||
const translations = isDocumine ? removeAnnotationTranslations : removeRedactionTranslations;
|
||||
const { permissions, redactions, isApprover, falsePositiveContext } = data;
|
||||
const isBulk = redactions.length > 1;
|
||||
const isImage = redactions.reduce((acc, next) => acc && next.isImage, true);
|
||||
|
||||
const options: DetailsRadioOption<RemoveRedactionOption>[] = [];
|
||||
if (permissions.canRemoveOnlyHere && !isImage) {
|
||||
@ -187,12 +187,15 @@ export const getRemoveRedactionOptions = (
|
||||
value: RemoveRedactionOptions.ONLY_HERE,
|
||||
});
|
||||
|
||||
options.push({
|
||||
label: removeRedactionTranslations.IN_DOCUMENT.label,
|
||||
description: removeRedactionTranslations.IN_DOCUMENT.description,
|
||||
icon: DOCUMENT_ICON,
|
||||
value: RemoveRedactionOptions.IN_DOCUMENT,
|
||||
});
|
||||
const isHint = redactions.reduce((acc, next) => acc && next.isHint, true);
|
||||
if (!isHint) {
|
||||
options.push({
|
||||
label: removeRedactionTranslations.IN_DOCUMENT.label,
|
||||
description: removeRedactionTranslations.IN_DOCUMENT.description,
|
||||
icon: DOCUMENT_ICON,
|
||||
value: RemoveRedactionOptions.IN_DOCUMENT,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (permissions.canRemoveFromDictionary) {
|
||||
options.push({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user