RED-6435: Removed add to dict character limit

This commit is contained in:
Adina Țeudan 2023-11-14 17:45:19 +02:00
parent 52dfb13a15
commit 19c3154130
5 changed files with 9 additions and 45 deletions

View File

@ -12,7 +12,6 @@ import { DossierDictionariesMapService } from '@services/entity-services/dossier
import { List } from '@iqser/common-ui/lib/utils';
import { IMAGE_CATEGORIES } from '../../modules/file-preview/utils/constants';
const MIN_WORD_LENGTH = 2;
const IMAGE_TYPES = ['image', 'formula', 'ocr'];
@Injectable({
@ -100,20 +99,13 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
) {
const entriesToAdd: Array<string> = [];
const initialEntriesSet = new Set(initialEntries);
let hasInvalidRows = false;
for (let i = 0; i < entries.length; i++) {
const entry = entries.at(i);
if (!entry.trim() || initialEntriesSet.has(entry)) {
continue;
}
hasInvalidRows ||= entry.length < MIN_WORD_LENGTH;
entriesToAdd.push(entry);
}
if (hasInvalidRows) {
this._toaster.error(_('dictionary-overview.error.entries-too-short'));
throw new Error('Entries too short');
}
const deletedEntries: Array<string> = [];
const entriesSet = new Set(entries);
for (let i = 0; i < initialEntries.length; i++) {
@ -260,7 +252,15 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
}
}
if (!manualTypeExists) {
dictionaries.push(new Dictionary({ hexColor: FALLBACK_COLOR, type: SuperTypes.ManualRedaction }, true));
dictionaries.push(
new Dictionary(
{
hexColor: FALLBACK_COLOR,
type: SuperTypes.ManualRedaction,
},
true,
),
);
}
return dictionaries;

View File

@ -763,7 +763,6 @@
"download": "Download current entries",
"error": {
"400": "Cannot update dictionary because at least one of the newly added words where recognized as a general term that appear too often in texts.",
"entries-too-short": "Einige Einträge im Wörterbuch unterschreiten die Mindestlänge von 2 Zeichen. Diese sind rot markiert.",
"generic": "Es ist ein Fehler aufgetreten ... Das Wörterbuch konnte nicht aktualisiert werden!"
},
"revert-changes": "Rückgängig machen",
@ -1787,14 +1786,6 @@
"copyright-claim-text": "Copyright © 2020 - {currentYear} knecon",
"copyright-claim-title": "Copyright",
"custom-app-title": "Name der Anwendung",
"email-report": "E-Mail-Bericht",
"email": {
"body": {
"analyzed": "Im aktuellen Lizenzzeitraum insgesamt analysierte Seiten: {pages}.",
"licensed": "Lizenzierte Seiten: {pages}."
},
"title": "Lizenzbericht {licenseCustomer}"
},
"end-user-license-text": "Die Nutzung dieses Produkts unterliegt den Bedingungen der Endbenutzer-Lizenzvereinbarung für den RedactManager, sofern darin nichts anderweitig festgelegt.",
"end-user-license-title": "Endbenutzer-Lizenzvereinbarung",
"licensing-details": {

View File

@ -763,7 +763,6 @@
"download": "Download current entries",
"error": {
"400": "Cannot update dictionary because at least one of the newly added words where recognized as a general term that appear too often in texts.",
"entries-too-short": "Some entries of the dictionary are below the minimum length of 2. These are highlighted with red!",
"generic": "Something went wrong... Dictionary update failed!"
},
"revert-changes": "Revert",
@ -1787,14 +1786,6 @@
"copyright-claim-text": "Copyright © 2020 - {currentYear} knecon",
"copyright-claim-title": "Copyright Claim",
"custom-app-title": "Custom Application Title",
"email-report": "Email Report",
"email": {
"body": {
"analyzed": "Total Analyzed Pages in current license period: {pages}.",
"licensed": "Licensed Pages: {pages}."
},
"title": "License Report {licenseCustomer}"
},
"end-user-license-text": "The use of this product is subject to the terms of the RedactManager End User License Agreement, unless otherwise specified therein.",
"end-user-license-title": "End User License Agreement",
"licensing-details": {

View File

@ -763,7 +763,6 @@
"download": "",
"error": {
"400": "",
"entries-too-short": "Einige Einträge im Wörterbuch unterschreiten die Mindestlänge von 2 Zeichen. Diese sind rot markiert.",
"generic": "Es ist ein Fehler aufgetreten ... Das Wörterbuch konnte nicht aktualisiert werden!"
},
"revert-changes": "Rückgängig machen",
@ -1787,14 +1786,6 @@
"copyright-claim-text": "Copyright © 2020 - {currentYear} knecon AG (powered by IQSER)",
"copyright-claim-title": "Copyright",
"custom-app-title": "Name der Anwendung",
"email-report": "E-Mail-Bericht",
"email": {
"body": {
"analyzed": "Im aktuellen Lizenzzeitraum insgesamt analysierte Seiten: {pages}.",
"licensed": "Lizenzierte Seiten: {pages}."
},
"title": "Lizenzbericht {licenseCustomer}"
},
"end-user-license-text": "Die Nutzung dieses Produkts unterliegt den Bedingungen der Endbenutzer-Lizenzvereinbarung für den RedactManager, sofern darin nichts anderweitig festgelegt.",
"end-user-license-title": "Endbenutzer-Lizenzvereinbarung",
"licensing-details": {

View File

@ -763,7 +763,6 @@
"download": "Download current entries",
"error": {
"400": "Cannot update dictionary because at least one of the newly added words where recognized as a general term that appear too often in texts.",
"entries-too-short": "Some entries of the dictionary are below the minimum length of 2. These are highlighted with red!",
"generic": "Something went wrong... Dictionary update failed!"
},
"revert-changes": "Revert",
@ -1787,14 +1786,6 @@
"copyright-claim-text": "Copyright © 2020 - {currentYear} knecon",
"copyright-claim-title": "Copyright Claim",
"custom-app-title": "Custom Application Title",
"email-report": "Email Report",
"email": {
"body": {
"analyzed": "Total Analyzed Pages in current license period: {pages}.",
"licensed": "Licensed Pages: {pages}."
},
"title": "License Report {licenseCustomer}"
},
"end-user-license-text": "The use of this product is subject to the terms of the DocuMine End User License Agreement, unless otherwise specified therein.",
"end-user-license-title": "End User License Agreement",
"licensing-details": {