Auto i18n and better handling for false positives

This commit is contained in:
Timo 2020-12-15 15:23:42 +02:00
parent 85696e64e2
commit 9b0e1b6bae
6 changed files with 35 additions and 6 deletions

View File

@ -143,7 +143,11 @@ export class DialogService {
const ref = this._dialog.open(ConfirmationDialogComponent, {
...dialogConfig,
data: new ConfirmationDialogInput({
question: removeFromDictionary ? 'confirmation-dialog.remove-from-dictionary.question' : 'confirmation-dialog.remove-only-here.question',
question: annotation.isManual
? 'confirmation-dialog.remove-manual-redaction.question'
: removeFromDictionary
? 'confirmation-dialog.remove-from-dictionary.question'
: 'confirmation-dialog.remove-only-here.question',
translateParams: { entry: annotation.value, dictionary: annotation.dictionary }
})
});

View File

@ -39,7 +39,7 @@ export class AnnotationWrapper {
}
get isFalsePositive() {
return this.dictionary === 'false_positive';
return this.dictionary === 'false_positive' && (this.superType === 'ignore' || this.superType === 'hint' || this.superType === 'redaction');
}
get isManual() {

View File

@ -67,7 +67,9 @@ export class FileDataModel {
pairs.push({
redactionLogEntry: rdl,
// only not declined
manualRedactionEntry: this.manualRedactions.entriesToAdd.find((eta) => (eta.id === rdl.id || eta.reason === rdl.id) && this._dateValid(eta)),
manualRedactionEntry: this.manualRedactions.entriesToAdd.find(
(eta) => (eta.id === rdl.id || eta.reason === rdl.id) && this._validateEntry(eta)
),
// only not declined
idRemoval: this.manualRedactions.idsToRemove.find((idr) => idr.id === rdl.id && this._dateValid(idr)),
comments: this.manualRedactions.comments[rdl.id]
@ -93,6 +95,10 @@ export class FileDataModel {
return pairs;
}
private _validateEntry(entry: ManualRedactionEntry): boolean {
return this._dateValid(entry) || entry.type === 'manual';
}
private _dateValid(entry: ManualRedactionEntry | IdRemoval): boolean {
return new Date(entry.processedDate).getTime() > new Date(this.fileStatus.lastProcessed).getTime() || !entry.processedDate;
}

View File

@ -47,7 +47,7 @@
"report": {
"unavailable": "Der Redaktionsbericht ist erst verfügbar, wenn alle Dateien genehmigt wurden.",
"unavailable-single": "Der Redaktionsbericht ist erst verfügbar, wenn diese Datei genehmigt wurde.",
"action": "Redaktionsbericht herunterladen"
"action": { "label": "Redaktionsbericht herunterladen", "efsa": "Mit EFSA-Vorlage herunterladen", "syngenta": "Mit Syngenta-Vorlage herunterladen" }
},
"project-listing": {
"search": "Projektname...",
@ -70,6 +70,7 @@
"due-date": "Geburtstermin",
"template": "Projektvorlage"
},
"errors": { "project-already-exists": "Projekt mit diesem Namen existiert bereits!", "generic": "Projekt konnte nicht gespeichert werden" },
"actions": { "save": "speichern", "save-and-add-members": "Team speichern und bearbeiten" }
},
"header": "Projekte",
@ -95,6 +96,7 @@
"collapse": "Details ausblenden"
},
"project-overview": {
"no-data": { "title": "Es liegen noch keine Dokumente vor.", "action": "Dokument hochladen" },
"search": "Dokumentname...",
"header-actions": {
"edit": "Bearbeiten",
@ -108,7 +110,6 @@
"under-approval": "Zur Genehmigung",
"approve": "Genehmigen",
"under-review": "Wird überprüft",
"no-files": "Projekt ist leer!",
"no-files-match": "Keine Datei entspricht Ihren aktuellen Filtern",
"upload-files": "Legen Sie Dateien überall zum Hochladen ab!",
"upload-files-btn": "Daten hochladen",
@ -323,7 +324,9 @@
"dictionary": "Zum Wörterbuch hinzufügen",
"redaction": "Manuelle Redaktion",
"request-dictionary": "Anfrage zum Wörterbuch hinzufügen",
"request-redaction": "Redaktion anfordern"
"request-redaction": "Redaktion anfordern",
"false-positive": "Falsch positiv setzen",
"request-false-positive": "Falsch positiv anfordern"
},
"add-redaction": { "success": "Redaktionsvorschlag hinzugefügt!", "failed": "Manuelle Redaktion konnte nicht hinzugefügt werden: {{message}}" },
"actions": { "save": "speichern" },
@ -332,6 +335,7 @@
"rectangle": "Benutzerdefiniertes Rechteck",
"dictionary": "Wörterbuch",
"reason": "Grund",
"reason-placeholder": "Wähle einen Grund ...",
"legalBasis": "Rechtliche Grundlage",
"comment": "Kommentar"
}
@ -344,6 +348,7 @@
},
"confirmation-dialog": {
"delete-file": { "title": "Löschung bestätigen", "question": "Möchten Sie fortfahren?" },
"remove-manual-redaction": { "question": "Möchten Sie diese manuelle Redaktion wirklich entfernen?" },
"remove-from-dictionary": { "question": "Möchten Sie <b>{{entry}} wirklich</b> aus dem <b>{{dictionary}}</b> Wörterbuch entfernen?" },
"remove-only-here": { "question": "Möchten Sie <b>{{entry}}</b> nur hier entfernen?" }
},

View File

@ -510,6 +510,9 @@
"title": "Confirm deletion",
"question": "Do you wish to proceed?"
},
"remove-manual-redaction": {
"question": "Are you sure you wish to remove this manual redaction?"
},
"remove-from-dictionary": {
"question": "Are you sure you want to remove <b>{{entry}}</b> from the <b>{{dictionary}}</b> dictionary?"
},

View File

@ -430,3 +430,14 @@ Accept Recommendation|Empfehlung annehmen
No members yet.
Select from the list below.|Noch keine Mitglieder. Wählen Sie aus der folgenden Liste.
Are you sure you want to remove <b>{{entry}}</b> only here?|Möchten Sie <b>{{entry}}</b> nur hier entfernen?
Download with EFSA Template|Mit EFSA-Vorlage herunterladen
Download with Syngenta Template|Mit Syngenta-Vorlage herunterladen
Project with this name already exists!|Projekt mit diesem Namen existiert bereits!
Failed to save project|Projekt konnte nicht gespeichert werden
There are no documents yet.|Es liegen noch keine Dokumente vor.
No members yet.
Select from the list below.|Noch keine Mitglieder. Wählen Sie aus der folgenden Liste.
Set false positive|Falsch positiv setzen
Request false positive|Falsch positiv anfordern
Select a reason ...|Wähle einen Grund ...
Are you sure you wish to remove this manual redaction?|Möchten Sie diese manuelle Redaktion wirklich entfernen?