From 6affd59ca98d7e1c01ebf6ad5d1d32829b9d1a2c Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 15 Sep 2023 18:06:42 +0300 Subject: [PATCH] DM-473 no line breaks or hyphens removal needed --- .../manual-annotation-dialog.component.ts | 2 -- .../modules/file-preview/file-preview-screen.component.ts | 3 +-- apps/red-ui/src/app/utils/functions.ts | 8 -------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 53595cb9b..829047265 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -9,7 +9,6 @@ import { ActiveDossiersService } from '@services/dossiers/active-dossiers.servic import { DictionaryService } from '@services/entity-services/dictionary.service'; import { JustificationsService } from '@services/entity-services/justifications.service'; import { Roles } from '@users/roles'; -import { removeHyphensAndSpecialChars } from '@utils/functions'; import { firstValueFrom } from 'rxjs'; import { ManualRedactionService } from '../../services/manual-redaction.service'; @@ -186,7 +185,6 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme addRedactionRequest.value = addRedactionRequest.rectangle ? this.form.get('classification').value : this.form.get('selectedText').value; - addRedactionRequest.value = removeHyphensAndSpecialChars(addRedactionRequest.value); } #selectReason() { diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index 27edbab0c..cf56904e0 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -52,7 +52,7 @@ import JSZip from 'jszip'; import { NGXLogger } from 'ngx-logger'; import { combineLatest, first, firstValueFrom, of, pairwise } from 'rxjs'; import { catchError, filter, map, startWith, switchMap, tap } from 'rxjs/operators'; -import { byId, byPage, download, handleFilterDelta, hasChanges, removeHyphensAndSpecialChars } from '../../utils'; +import { byId, byPage, download, handleFilterDelta, hasChanges } from '../../utils'; import { AnnotationDrawService } from '../pdf-viewer/services/annotation-draw.service'; import { REDAnnotationManager } from '../pdf-viewer/services/annotation-manager.service'; import { REDDocumentViewer } from '../pdf-viewer/services/document-viewer.service'; @@ -533,7 +533,6 @@ export class FilePreviewScreenComponent } const hint = manualRedactionEntryWrapper.type === ManualRedactionEntryTypes.HINT; - result.redaction.value = removeHyphensAndSpecialChars(result.redaction.value); const add$ = this._manualRedactionService.addAnnotation([result.redaction], this.dossierId, this.fileId, { hint, dictionaryLabel: result.dictionary?.label, diff --git a/apps/red-ui/src/app/utils/functions.ts b/apps/red-ui/src/app/utils/functions.ts index df12eb1d3..06fd984ca 100644 --- a/apps/red-ui/src/app/utils/functions.ts +++ b/apps/red-ui/src/app/utils/functions.ts @@ -133,11 +133,3 @@ export function calcTextWidthInPixels(text: string): number { return width; } - -export function removeHyphensAndSpecialChars(text: string): string { - return text?.replace( - // eslint-disable-next-line no-control-regex,max-len - /([^\s\d-]{2,})[-\u00AD]\u000A\u000D|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]/gi, - '$1', - ); -}