RED-5856 - Error in info text for remove hint and force hint action

This commit is contained in:
Valentin Mihai 2023-01-02 20:55:34 +02:00
parent 8677aabd9a
commit 1286770c45
8 changed files with 107 additions and 8 deletions

View File

@ -93,6 +93,7 @@ export class AnnotationActionsService {
annotations.map(a => ({ ...request, annotationId: a.id })),
dossierId,
fileId,
annotations[0].isIgnoredHint,
),
);
});
@ -132,7 +133,9 @@ export class AnnotationActionsService {
removeFromDictionary,
comment: result.comment,
}));
this.#processObsAndEmit(this._manualRedactionService.removeOrSuggestRemove(body, dossierId, fileId, removeFromDictionary));
this.#processObsAndEmit(
this._manualRedactionService.removeOrSuggestRemove(body, dossierId, fileId, removeFromDictionary, annotations[0].isHint),
);
});
}

View File

@ -109,12 +109,16 @@ export class ManualRedactionService extends GenericService<IManualAddResponse> {
return of(undefined);
}
bulkForce(requests: List<ILegalBasisChangeRequest>, dossierId: string, fileId: string) {
bulkForce(requests: List<ILegalBasisChangeRequest>, dossierId: string, fileId: string, isIgnoredHint = false) {
if (this._permissionsService.isApprover(this.#dossier(dossierId))) {
return this.forceRedaction(requests, dossierId, fileId).pipe(this.#showToast('force-redaction'));
return this.forceRedaction(requests, dossierId, fileId).pipe(
this.#showToast(!isIgnoredHint ? 'force-redaction' : 'force-hint'),
);
}
return this.forceRequest(requests, dossierId, fileId).pipe(this.#showToast('request-force-redaction'));
return this.forceRequest(requests, dossierId, fileId).pipe(
this.#showToast(!isIgnoredHint ? 'request-force-redaction' : 'request-force-hint'),
);
}
undoRequest(annotationIds: List, dossierId: string, fileId: string, modifyDictionary = false) {
@ -137,12 +141,20 @@ export class ManualRedactionService extends GenericService<IManualAddResponse> {
return this.requestResize(requests, dossierId, fileId);
}
removeOrSuggestRemove(body: List<IRemoveRedactionRequest>, dossierId: string, fileId: string, removeFromDictionary = false) {
removeOrSuggestRemove(
body: List<IRemoveRedactionRequest>,
dossierId: string,
fileId: string,
removeFromDictionary = false,
isHint = false,
) {
if (this._permissionsService.isApprover(this.#dossier(dossierId))) {
return this.remove(body, dossierId, fileId).pipe(this.#showToast('remove', removeFromDictionary));
return this.remove(body, dossierId, fileId).pipe(this.#showToast(!isHint ? 'remove' : 'remove-hint', removeFromDictionary));
}
return this.requestRemoveRedaction(body, dossierId, fileId).pipe(this.#showToast('request-remove', removeFromDictionary));
return this.requestRemoveRedaction(body, dossierId, fileId).pipe(
this.#showToast(!isHint ? 'request-remove' : 'request-remove-hint', removeFromDictionary),
);
}
getTitle(type: ManualRedactionEntryType, dossier: Dossier) {

View File

@ -60,6 +60,10 @@ export const manualRedactionActionsTranslations: Record<ManualRedactionActions,
error: _('annotation-actions.message.manual-redaction.force-redaction.error'),
success: _('annotation-actions.message.manual-redaction.force-redaction.success'),
},
'force-hint': {
error: _('annotation-actions.message.manual-redaction.force-hint.error'),
success: _('annotation-actions.message.manual-redaction.force-hint.success'),
},
'recategorize-image': {
error: _('annotation-actions.message.manual-redaction.recategorize-image.error'),
success: _('annotation-actions.message.manual-redaction.recategorize-image.success'),
@ -72,6 +76,10 @@ export const manualRedactionActionsTranslations: Record<ManualRedactionActions,
error: _('annotation-actions.message.manual-redaction.request-force-redaction.error'),
success: _('annotation-actions.message.manual-redaction.request-force-redaction.success'),
},
'request-force-hint': {
error: _('annotation-actions.message.manual-redaction.request-force-hint.error'),
success: _('annotation-actions.message.manual-redaction.request-force-hint.success'),
},
'request-image-recategorization': {
error: _('annotation-actions.message.manual-redaction.request-image-recategorization.error'),
success: _('annotation-actions.message.manual-redaction.request-image-recategorization.success'),
@ -88,8 +96,16 @@ export const manualRedactionActionsTranslations: Record<ManualRedactionActions,
error: _('annotation-actions.message.manual-redaction.remove.error'),
success: _('annotation-actions.message.manual-redaction.remove.success'),
},
'remove-hint': {
error: _('annotation-actions.message.manual-redaction.remove-hint.error'),
success: _('annotation-actions.message.manual-redaction.remove-hint.success'),
},
'request-remove': {
error: _('annotation-actions.message.manual-redaction.request-remove.error'),
success: _('annotation-actions.message.manual-redaction.request-remove.success'),
},
'request-remove-hint': {
error: _('annotation-actions.message.manual-redaction.request-remove-hint.error'),
success: _('annotation-actions.message.manual-redaction.request-remove-hint.success'),
},
} as const;

View File

@ -256,6 +256,10 @@
"error": "Fehler beim Ablehnen des Vorschlags: {error}",
"success": "Vorschlag abgelehnt"
},
"force-hint": {
"error": "",
"success": ""
},
"force-redaction": {
"error": "Die Schwärzung konnte nicht gespeichert werden!",
"success": "Schwärzung eingefügt!"
@ -264,6 +268,10 @@
"error": "Rekategorisierung des Bildes gescheitert: {error}",
"success": "Bild wurde einer neuen Kategorie zugeordnet."
},
"remove-hint": {
"error": "",
"success": ""
},
"remove": {
"error": "Fehler beim Entfernen der Schwärzung: {error}",
"success": "Schwärzung entfernt!"
@ -272,6 +280,10 @@
"error": "Fehler beim Vorschlagen der Änderung der Begründung:",
"success": "Die Änderung der in der Anmerkung genannten Begründung wurde beantragt."
},
"request-force-hint": {
"error": "",
"success": ""
},
"request-force-redaction": {
"error": "Fehler beim Speichern des Schwärzungsvorschlags: {error}",
"success": "Vorschlag einer Schwärzung gespeichert"
@ -280,6 +292,10 @@
"error": "Fehler beim Vorschlagen der Neukategorisierung des Bilds: {error}",
"success": "Bild-Neuklassifizierung angefordert."
},
"request-remove-hint": {
"error": "",
"success": ""
},
"request-remove": {
"error": "Fehler beim Erstellen des Vorschlags für das Entfernen der Schwärzung: {error}",
"success": "Entfernen der Schwärzung wurde vorgeschlagen!"

View File

@ -256,6 +256,10 @@
"error": "Failed to decline suggestion: {error}",
"success": "Suggestion declined."
},
"force-hint": {
"error": "Failed to save hint: {error}",
"success": "Hint added!"
},
"force-redaction": {
"error": "Failed to save redaction: {error}",
"success": "Redaction added!"
@ -264,6 +268,10 @@
"error": "Failed to recategorize image: {error}",
"success": "Image recategorized."
},
"remove-hint": {
"error": "Failed to remove hint: {error}",
"success": "Hint removed!"
},
"remove": {
"error": "Failed to remove redaction: {error}",
"success": "Redaction removed!"
@ -272,6 +280,10 @@
"error": "Failed to request annotation reason change: {error}",
"success": "Annotation reason change requested."
},
"request-force-hint": {
"error": "Failed to save hint suggestion: {error}",
"success": "Hint suggestion saved"
},
"request-force-redaction": {
"error": "Failed to save redaction suggestion: {error}",
"success": "Redaction suggestion saved"
@ -280,6 +292,10 @@
"error": "Failed to request image recategorization: {error}",
"success": "Image recategorization requested."
},
"request-remove-hint": {
"error": "Failed to request removal of hint: {error}",
"success": "Requested to remove hint!"
},
"request-remove": {
"error": "Failed to request removal of redaction: {error}",
"success": "Requested to remove redaction!"

View File

@ -256,6 +256,10 @@
"error": "Fehler beim Ablehnen des Vorschlags: {error}",
"success": "Vorschlag abgelehnt"
},
"force-hint": {
"error": "",
"success": ""
},
"force-redaction": {
"error": "Die Schwärzung konnte nicht gespeichert werden!",
"success": "Schwärzung eingefügt!"
@ -264,6 +268,10 @@
"error": "Rekategorisierung des Bildes gescheitert: {error}",
"success": "Bild wurde einer neuen Kategorie zugeordnet."
},
"remove-hint": {
"error": "",
"success": ""
},
"remove": {
"error": "Fehler beim Entfernen der Schwärzung: {error}",
"success": "Schwärzung entfernt!"
@ -272,6 +280,10 @@
"error": "Fehler beim Vorschlagen der Änderung der Begründung:",
"success": "Die Änderung der in der Anmerkung genannten Begründung wurde beantragt."
},
"request-force-hint": {
"error": "",
"success": ""
},
"request-force-redaction": {
"error": "Fehler beim Speichern des Schwärzungsvorschlags: {error}",
"success": "Vorschlag einer Schwärzung gespeichert"
@ -280,6 +292,10 @@
"error": "Fehler beim Vorschlagen der Neukategorisierung des Bilds: {error}",
"success": "Bild-Neuklassifizierung angefordert."
},
"request-remove-hint": {
"error": "",
"success": ""
},
"request-remove": {
"error": "Fehler beim Erstellen des Vorschlags für das Entfernen der Schwärzung: {error}",
"success": "Entfernen der Schwärzung wurde vorgeschlagen!"

View File

@ -256,6 +256,10 @@
"error": "Failed to decline suggestion: {error}",
"success": "Suggestion declined."
},
"force-hint": {
"error": "Failed to save hint: {error}",
"success": "Hint added!"
},
"force-redaction": {
"error": "Failed to save component: {error}",
"success": "Component added!"
@ -264,6 +268,10 @@
"error": "Failed to recategorize image: {error}",
"success": "Image recategorized."
},
"remove-hint": {
"error": "Failed to remove hint: {error}",
"success": "Hint removed!"
},
"remove": {
"error": "Failed to remove component: {error}",
"success": "Component removed!"
@ -272,6 +280,10 @@
"error": "Failed to request annotation reason change: {error}",
"success": "Annotation reason change requested."
},
"request-force-hint": {
"error": "Failed to save hint suggestion: {error}",
"success": "Hint suggestion saved"
},
"request-force-redaction": {
"error": "Failed to save component suggestion: {error}",
"success": "Component suggestion saved"
@ -280,6 +292,10 @@
"error": "Failed to request image recategorization: {error}",
"success": "Image recategorization requested."
},
"request-remove-hint": {
"error": "Failed to request removal of hint: {error}",
"success": "Requested to remove hint!"
},
"request-remove": {
"error": "Failed to request removal of component: {error}",
"success": "Requested to remove component!"

View File

@ -6,16 +6,20 @@ export type ManualRedactionActions =
| 'add'
| 'approve'
| 'remove'
| 'remove-hint'
| 'change-legal-basis'
| 'decline'
| 'request-remove'
| 'request-remove-hint'
| 'request-change-legal-basis'
| 'recategorize-image'
| 'request-image-recategorization'
| 'suggest'
| 'undo'
| 'force-redaction'
| 'request-force-redaction';
| 'force-hint'
| 'request-force-redaction'
| 'request-force-hint';
export const AnnotationIconTypes = {
square: 'square',