Merge branch 'RED-10264-bp' into 'release/4.951.x'
RED-10264: remove includeUnprocessed from all manual change calls See merge request redactmanager/red-ui!644
This commit is contained in:
commit
491977cb49
@ -114,7 +114,6 @@ 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 allFileAnnotations = this._fileDataService.annotations();
|
||||||
const includeUnprocessed = annotations.every(annotation => this.#includeUnprocessed(annotation, true));
|
|
||||||
const data = {
|
const data = {
|
||||||
annotations,
|
annotations,
|
||||||
allFileAnnotations,
|
allFileAnnotations,
|
||||||
@ -170,7 +169,6 @@ export class AnnotationActionsService {
|
|||||||
dossierId,
|
dossierId,
|
||||||
file().id,
|
file().id,
|
||||||
this.#getChangedFields(annotations, result),
|
this.#getChangedFields(annotations, result),
|
||||||
includeUnprocessed,
|
|
||||||
result.option === RedactOrHintOptions.IN_DOCUMENT || !!result.pageNumbers.length,
|
result.option === RedactOrHintOptions.IN_DOCUMENT || !!result.pageNumbers.length,
|
||||||
)
|
)
|
||||||
.pipe(log()),
|
.pipe(log()),
|
||||||
@ -269,7 +267,6 @@ export class AnnotationActionsService {
|
|||||||
|
|
||||||
async acceptResize(annotation: AnnotationWrapper, permissions: AnnotationPermissions): Promise<void> {
|
async acceptResize(annotation: AnnotationWrapper, permissions: AnnotationPermissions): Promise<void> {
|
||||||
const textAndPositions = await this.#extractTextAndPositions(annotation.id);
|
const textAndPositions = await this.#extractTextAndPositions(annotation.id);
|
||||||
const includeUnprocessed = this.#includeUnprocessed(annotation);
|
|
||||||
if (annotation.isRecommendation) {
|
if (annotation.isRecommendation) {
|
||||||
const recommendation = {
|
const recommendation = {
|
||||||
...annotation,
|
...annotation,
|
||||||
@ -320,7 +317,7 @@ export class AnnotationActionsService {
|
|||||||
await this.cancelResize(annotation);
|
await this.cancelResize(annotation);
|
||||||
|
|
||||||
const { fileId, dossierId } = this._state;
|
const { fileId, dossierId } = this._state;
|
||||||
const request = this._manualRedactionService.resize([resizeRequest], dossierId, fileId, includeUnprocessed);
|
const request = this._manualRedactionService.resize([resizeRequest], dossierId, fileId);
|
||||||
return this.#processObsAndEmit(request);
|
return this.#processObsAndEmit(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,7 +474,6 @@ export class AnnotationActionsService {
|
|||||||
|
|
||||||
#removeRedaction(redactions: AnnotationWrapper[], dialogResult: RemoveRedactionResult) {
|
#removeRedaction(redactions: AnnotationWrapper[], dialogResult: RemoveRedactionResult) {
|
||||||
const removeFromDictionary = dialogResult.option.value === RemoveRedactionOptions.IN_DOSSIER;
|
const removeFromDictionary = dialogResult.option.value === RemoveRedactionOptions.IN_DOSSIER;
|
||||||
const includeUnprocessed = redactions.every(redaction => this.#includeUnprocessed(redaction, true));
|
|
||||||
const body = this.#getRemoveRedactionBody(redactions, dialogResult);
|
const body = this.#getRemoveRedactionBody(redactions, dialogResult);
|
||||||
// todo: might not be correct, probably shouldn't get to this point if they are not all the same
|
// todo: might not be correct, probably shouldn't get to this point if they are not all the same
|
||||||
const isHint = redactions.every(r => r.isHint);
|
const isHint = redactions.every(r => r.isHint);
|
||||||
@ -505,7 +501,6 @@ export class AnnotationActionsService {
|
|||||||
fileId,
|
fileId,
|
||||||
removeFromDictionary,
|
removeFromDictionary,
|
||||||
isHint,
|
isHint,
|
||||||
includeUnprocessed,
|
|
||||||
dialogResult.bulkLocal,
|
dialogResult.bulkLocal,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -521,7 +516,6 @@ export class AnnotationActionsService {
|
|||||||
fileId,
|
fileId,
|
||||||
removeFromDictionary,
|
removeFromDictionary,
|
||||||
isHint,
|
isHint,
|
||||||
includeUnprocessed,
|
|
||||||
dialogResult.bulkLocal || !!dialogResult.pageNumbers.length,
|
dialogResult.bulkLocal || !!dialogResult.pageNumbers.length,
|
||||||
),
|
),
|
||||||
).then();
|
).then();
|
||||||
@ -580,20 +574,6 @@ export class AnnotationActionsService {
|
|||||||
return { changes: changedFields.join(', ') };
|
return { changes: changedFields.join(', ') };
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO this is temporary, based on RED-8950. Should be removed when a better solution will be found
|
|
||||||
#includeUnprocessed(annotation: AnnotationWrapper, isRemoveOrRecategorize = false) {
|
|
||||||
const processed = annotation.entry.manualChanges.at(-1)?.processed;
|
|
||||||
if (!processed) {
|
|
||||||
const autoAnalysisDisabled = this._state.file().excludedFromAutomaticAnalysis;
|
|
||||||
const addedLocallyWhileDisabled = annotation.manual;
|
|
||||||
if (autoAnalysisDisabled) {
|
|
||||||
return addedLocallyWhileDisabled;
|
|
||||||
}
|
|
||||||
return isRemoveOrRecategorize && addedLocallyWhileDisabled;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#getRemoveRedactionBody(
|
#getRemoveRedactionBody(
|
||||||
redactions: AnnotationWrapper[],
|
redactions: AnnotationWrapper[],
|
||||||
dialogResult: RemoveRedactionResult,
|
dialogResult: RemoveRedactionResult,
|
||||||
|
|||||||
@ -75,13 +75,10 @@ export class ManualRedactionService extends GenericService<IManualAddResponse> {
|
|||||||
body: List<IRecategorizationRequest> | IBulkRecategorizationRequest,
|
body: List<IRecategorizationRequest> | IBulkRecategorizationRequest,
|
||||||
dossierId: string,
|
dossierId: string,
|
||||||
fileId: string,
|
fileId: string,
|
||||||
successMessageParameters?: {
|
successMessageParameters?: { [p: string]: string },
|
||||||
[key: string]: string;
|
|
||||||
},
|
|
||||||
includeUnprocessed = false,
|
|
||||||
bulkLocal = false,
|
bulkLocal = false,
|
||||||
) {
|
) {
|
||||||
return this.#recategorize(body, dossierId, fileId, includeUnprocessed, bulkLocal).pipe(
|
return this.#recategorize(body, dossierId, fileId, bulkLocal).pipe(
|
||||||
this.#showToast('recategorize-annotation', false, successMessageParameters),
|
this.#showToast('recategorize-annotation', false, successMessageParameters),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -117,10 +114,9 @@ export class ManualRedactionService extends GenericService<IManualAddResponse> {
|
|||||||
fileId: string,
|
fileId: string,
|
||||||
removeFromDictionary = false,
|
removeFromDictionary = false,
|
||||||
isHint = false,
|
isHint = false,
|
||||||
includeUnprocessed = false,
|
|
||||||
bulkLocal = false,
|
bulkLocal = false,
|
||||||
) {
|
) {
|
||||||
return this.#remove(body, dossierId, fileId, includeUnprocessed, bulkLocal).pipe(
|
return this.#remove(body, dossierId, fileId, bulkLocal).pipe(
|
||||||
this.#showToast(!isHint ? 'remove' : 'remove-hint', removeFromDictionary),
|
this.#showToast(!isHint ? 'remove' : 'remove-hint', removeFromDictionary),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -154,36 +150,23 @@ export class ManualRedactionService extends GenericService<IManualAddResponse> {
|
|||||||
return this._post(body, `${this.#bulkRedaction}/force/${dossierId}/${fileId}`).pipe(this.#log('Force redaction', body));
|
return this._post(body, `${this.#bulkRedaction}/force/${dossierId}/${fileId}`).pipe(this.#log('Force redaction', body));
|
||||||
}
|
}
|
||||||
|
|
||||||
resize(body: List<IResizeRequest>, dossierId: string, fileId: string, includeUnprocessed = false) {
|
resize(body: List<IResizeRequest>, dossierId: string, fileId: string) {
|
||||||
return this._post(body, `${this.#bulkRedaction}/resize/${dossierId}/${fileId}?includeUnprocessed=${includeUnprocessed}`).pipe(
|
return this._post(body, `${this.#bulkRedaction}/resize/${dossierId}/${fileId}`).pipe(this.#log('Resize', body));
|
||||||
this.#log('Resize', body),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#recategorize(
|
#recategorize(
|
||||||
body: List<IRecategorizationRequest> | IBulkRecategorizationRequest,
|
body: List<IRecategorizationRequest> | IBulkRecategorizationRequest,
|
||||||
dossierId: string,
|
dossierId: string,
|
||||||
fileId: string,
|
fileId: string,
|
||||||
includeUnprocessed = false,
|
|
||||||
bulkLocal = false,
|
bulkLocal = false,
|
||||||
) {
|
) {
|
||||||
const bulkPath = bulkLocal ? this.#bulkLocal : this.#bulkRedaction;
|
const bulkPath = bulkLocal ? this.#bulkLocal : this.#bulkRedaction;
|
||||||
return this._post(body, `${bulkPath}/recategorize/${dossierId}/${fileId}?includeUnprocessed=${includeUnprocessed}`).pipe(
|
return this._post(body, `${bulkPath}/recategorize/${dossierId}/${fileId}`).pipe(this.#log('Recategorize', body));
|
||||||
this.#log('Recategorize', body),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#remove(
|
#remove(body: List<IRemoveRedactionRequest> | IBulkLocalRemoveRequest, dossierId: string, fileId: string, bulkLocal = false) {
|
||||||
body: List<IRemoveRedactionRequest> | IBulkLocalRemoveRequest,
|
|
||||||
dossierId: string,
|
|
||||||
fileId: string,
|
|
||||||
includeUnprocessed = false,
|
|
||||||
bulkLocal = false,
|
|
||||||
) {
|
|
||||||
const bulkPath = bulkLocal ? this.#bulkLocal : this.#bulkRedaction;
|
const bulkPath = bulkLocal ? this.#bulkLocal : this.#bulkRedaction;
|
||||||
return this._post(body, `${bulkPath}/remove/${dossierId}/${fileId}?includeUnprocessed=${includeUnprocessed}`).pipe(
|
return this._post(body, `${bulkPath}/remove/${dossierId}/${fileId}`).pipe(this.#log('Remove', body));
|
||||||
this.#log('Remove', body),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#log(action: string, body: unknown) {
|
#log(action: string, body: unknown) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user