From 97c6e331e244e845588d7d20f2c0ede44d7767d6 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Mon, 18 Jul 2022 16:34:55 +0300 Subject: [PATCH] RED-4590 - sonar fixes --- .../digital-signature-screen.component.scss | 2 +- .../combo-chart/combo-series-vertical.component.ts | 2 +- .../app/modules/dossier-overview/config.service.ts | 2 -- .../file-workload/file-workload.component.ts | 2 +- .../import-redactions-dialog.html | 14 -------------- .../services/annotation-actions.service.ts | 3 ++- .../services/manual-redaction.service.ts | 3 ++- .../modules/file-preview/services/stamp.service.ts | 2 +- .../dictionary-manager.component.html | 4 +--- .../dictionary-manager.component.scss | 3 --- .../src/app/modules/shared/pipes/name.pipe.ts | 2 +- .../trash/trash-screen/trash-screen.component.scss | 0 .../trash/trash-screen/trash-screen.component.ts | 1 - .../file-drop/file-drop.component.scss | 0 .../file-drop/file-drop.component.ts | 1 - .../src/app/utils/missing-translations-handler.ts | 1 - libs/common-ui | 2 +- 17 files changed, 11 insertions(+), 33 deletions(-) delete mode 100644 apps/red-ui/src/app/modules/trash/trash-screen/trash-screen.component.scss delete mode 100644 apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.scss diff --git a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.scss index 4526cdf81..d309c5343 100644 --- a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.scss @@ -18,5 +18,5 @@ form { /* target the input field inexplicably to throw Chrome's AI off. * feel free to use a more complicated selector */ input[name='keySecret']:not(:placeholder-shown) { - font-family: 'secret'; + font-family: 'secret', serif; } diff --git a/apps/red-ui/src/app/modules/admin/screens/license/combo-chart/combo-series-vertical.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/combo-chart/combo-series-vertical.component.ts index ee6c92cb5..b8d9fe052 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/combo-chart/combo-series-vertical.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/combo-chart/combo-series-vertical.component.ts @@ -193,7 +193,7 @@ export class ComboSeriesVerticalComponent implements OnChanges { return item !== undefined; } - trackBy(index, bar): string { + trackBy(_index, bar): string { return bar.label; } } diff --git a/apps/red-ui/src/app/modules/dossier-overview/config.service.ts b/apps/red-ui/src/app/modules/dossier-overview/config.service.ts index f7431de14..bad395ced 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/config.service.ts +++ b/apps/red-ui/src/app/modules/dossier-overview/config.service.ts @@ -181,7 +181,6 @@ export class ConfigService { ) { const allDistinctWorkflowFileStatuses = new Set(); const allDistinctPeople = new Set(); - const allDistinctAddedDates = new Set(); const allDistinctNeedsWork = new Set(); const allDistinctProcessingTypes = new Set(); @@ -192,7 +191,6 @@ export class ConfigService { entities.forEach(file => { allDistinctPeople.add(file.assignee); allDistinctWorkflowFileStatuses.add(file.workflowStatus); - allDistinctAddedDates.add(dayjs(file.added).format('DD/MM/YYYY')); if (file.analysisRequired) { allDistinctNeedsWork.add('analysis'); diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts index 2c1970eff..8bdc43a74 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts @@ -166,7 +166,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy } get #allPages() { - return Array.from({ length: this.file?.numberOfPages }, (x, i) => i + 1); + return Array.from({ length: this.file?.numberOfPages }, (_x, i) => i + 1); } private static _scrollToFirstElement(elements: HTMLElement[], mode: 'always' | 'if-needed' = 'if-needed') { diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/import-redactions-dialog/import-redactions-dialog.html b/apps/red-ui/src/app/modules/file-preview/dialogs/import-redactions-dialog/import-redactions-dialog.html index d027d32c3..a17b8e19f 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/import-redactions-dialog/import-redactions-dialog.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/import-redactions-dialog/import-redactions-dialog.html @@ -4,20 +4,6 @@
- - - - - - - - - - - - - -
diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts index 5742f1896..3c401d655 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts @@ -211,7 +211,8 @@ export class AnnotationActionsService { return this.convertRecommendationToAnnotation($event, [recommendation]); } - const text = annotation.rectangle ? annotation.value : annotation.isImage ? 'Image' : textAndPositions.text; + const isImageText = annotation.isImage ? 'Image' : textAndPositions.text; + const text = annotation.rectangle ? annotation.value : isImageText; const data = { annotation, text }; this._dialogService.openDialog('resizeAnnotation', $event, data, (result: { comment: string; updateDictionary: boolean }) => { diff --git a/apps/red-ui/src/app/modules/file-preview/services/manual-redaction.service.ts b/apps/red-ui/src/app/modules/file-preview/services/manual-redaction.service.ts index 051596419..e69f7dc7e 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/manual-redaction.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/manual-redaction.service.ts @@ -22,7 +22,8 @@ import { type ManualRedactionEntryType } from '@models/file/manual-redaction-ent import { NGXLogger } from 'ngx-logger'; function getResponseType(error: boolean, isConflict: boolean) { - return error ? (isConflict ? 'conflictError' : 'error') : 'success'; + const isConflictError = isConflict ? 'conflictError' : 'error'; + return error ? isConflictError : 'success'; } function getDictionaryMessage(action: DictionaryActions, error = false, isConflict = false): string { diff --git a/apps/red-ui/src/app/modules/file-preview/services/stamp.service.ts b/apps/red-ui/src/app/modules/file-preview/services/stamp.service.ts index b1ad58a52..d1ced1889 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/stamp.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/stamp.service.ts @@ -80,7 +80,7 @@ export class StampService { watermark.orientation, watermark.opacity, watermark.hexColor, - Array.from({ length: await document.getPageCount() }, (x, i) => i + 1), + Array.from({ length: await document.getPageCount() }, (_x, i) => i + 1), this._licenseService.activeLicenseKey, ); } diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html index cadf3b027..b7990b39f 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html @@ -16,9 +16,7 @@
-
- {{ currentMatch + '/' + findMatches.length }} -
+ {{ currentMatch + '/' + findMatches.length }} diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss index 59033e579..33e59516e 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss @@ -72,9 +72,6 @@ form { display: flex; justify-content: center; align-items: center; - - .search-match-text { - } } mat-icon { diff --git a/apps/red-ui/src/app/modules/shared/pipes/name.pipe.ts b/apps/red-ui/src/app/modules/shared/pipes/name.pipe.ts index aba1521d5..fd4c06bb3 100644 --- a/apps/red-ui/src/app/modules/shared/pipes/name.pipe.ts +++ b/apps/red-ui/src/app/modules/shared/pipes/name.pipe.ts @@ -10,7 +10,7 @@ function getInitials(name: string) { const splittedName = name.split(' ').filter(value => value !== ' ' && value !== ''); return splittedName - .filter((value, index) => index < 2) + .filter((_value, index) => index < 2) .map(str => str[0]) .join(''); } diff --git a/apps/red-ui/src/app/modules/trash/trash-screen/trash-screen.component.scss b/apps/red-ui/src/app/modules/trash/trash-screen/trash-screen.component.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/red-ui/src/app/modules/trash/trash-screen/trash-screen.component.ts b/apps/red-ui/src/app/modules/trash/trash-screen/trash-screen.component.ts index a5b277f3e..2a4b16926 100644 --- a/apps/red-ui/src/app/modules/trash/trash-screen/trash-screen.component.ts +++ b/apps/red-ui/src/app/modules/trash/trash-screen/trash-screen.component.ts @@ -17,7 +17,6 @@ import { TrashDialogService } from '../services/trash-dialog.service'; @Component({ templateUrl: './trash-screen.component.html', - styleUrls: ['./trash-screen.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, providers: listingProvidersFactory({ entitiesService: TrashService, diff --git a/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.scss b/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.ts b/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.ts index 29b4dc609..aa5f4f56a 100644 --- a/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.ts +++ b/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.ts @@ -9,7 +9,6 @@ import { DOSSIER_ID } from '../../../tokens'; @Component({ templateUrl: './file-drop.component.html', - styleUrls: ['./file-drop.component.scss'], }) export class FileDropComponent { constructor( diff --git a/apps/red-ui/src/app/utils/missing-translations-handler.ts b/apps/red-ui/src/app/utils/missing-translations-handler.ts index 0e642ca73..ebeb631a9 100644 --- a/apps/red-ui/src/app/utils/missing-translations-handler.ts +++ b/apps/red-ui/src/app/utils/missing-translations-handler.ts @@ -3,7 +3,6 @@ import { MissingTranslationHandler, MissingTranslationHandlerParams } from '@ngx export class REDMissingTranslationHandler implements MissingTranslationHandler { handle(params: MissingTranslationHandlerParams): any { const missingKey = params.key; - // console.error('Missing translation: ' + missingKey); return `?${missingKey}?`; } } diff --git a/libs/common-ui b/libs/common-ui index 477e8ea5a..d3e45f5c9 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 477e8ea5ae97244703dbfe04a4ee98daa8d5f185 +Subproject commit d3e45f5c9868f5ada0af084d93b42f9e92d68c5e