From d3e45f5c9868f5ada0af084d93b42f9e92d68c5e Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Mon, 18 Jul 2022 16:32:08 +0300 Subject: [PATCH] RED-4590 - sonar fixes --- src/lib/help-mode/help-button/help-button.component.scss | 0 src/lib/help-mode/help-button/help-button.component.ts | 1 - src/lib/listing/page-header/page-header.component.ts | 2 +- src/lib/listing/services/listing.service.ts | 2 +- src/lib/listing/table/table.component.scss | 0 src/lib/listing/table/table.component.ts | 1 - .../full-page-loading-indicator.component.scss | 0 .../full-page-loading-indicator.component.ts | 1 - src/lib/misc/hidden-action/hidden-action.component.scss | 0 src/lib/misc/hidden-action/hidden-action.component.ts | 1 - src/lib/misc/side-nav/side-nav.component.scss | 0 src/lib/misc/side-nav/side-nav.component.ts | 1 - src/lib/misc/toast/toast.component.scss | 0 src/lib/misc/toast/toast.component.ts | 1 - src/lib/utils/functions.ts | 4 ++-- 15 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 src/lib/help-mode/help-button/help-button.component.scss delete mode 100644 src/lib/listing/table/table.component.scss delete mode 100644 src/lib/loading/full-page-loading-indicator/full-page-loading-indicator.component.scss delete mode 100644 src/lib/misc/hidden-action/hidden-action.component.scss delete mode 100644 src/lib/misc/side-nav/side-nav.component.scss delete mode 100644 src/lib/misc/toast/toast.component.scss diff --git a/src/lib/help-mode/help-button/help-button.component.scss b/src/lib/help-mode/help-button/help-button.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/help-mode/help-button/help-button.component.ts b/src/lib/help-mode/help-button/help-button.component.ts index 8883d9d..5fe7bac 100644 --- a/src/lib/help-mode/help-button/help-button.component.ts +++ b/src/lib/help-mode/help-button/help-button.component.ts @@ -5,7 +5,6 @@ import { HelpModeService } from '../index'; @Component({ selector: 'iqser-help-button', templateUrl: './help-button.component.html', - styleUrls: ['./help-button.component.scss'], }) export class HelpButtonComponent implements OnInit, OnDestroy { @Input() helpButtonKey?: string; diff --git a/src/lib/listing/page-header/page-header.component.ts b/src/lib/listing/page-header/page-header.component.ts index 1801d3d..bd2023e 100644 --- a/src/lib/listing/page-header/page-header.component.ts +++ b/src/lib/listing/page-header/page-header.component.ts @@ -55,7 +55,7 @@ export class PageHeaderComponent { this.searchService.reset(); } - trackByLabel(index: number, item: K): string | undefined { + trackByLabel(_index: number, item: K): string | undefined { return item.label; } } diff --git a/src/lib/listing/services/listing.service.ts b/src/lib/listing/services/listing.service.ts index b784702..dd1bedc 100644 --- a/src/lib/listing/services/listing.service.ts +++ b/src/lib/listing/services/listing.service.ts @@ -117,7 +117,7 @@ export class ListingService { if (currentEntityIdx === -1) { return this.setSelected([...this.selected, entity]); } - this.setSelected(this.selected.filter((el, idx) => idx !== currentEntityIdx)); + this.setSelected(this.selected.filter((_el, idx) => idx !== currentEntityIdx)); } deselect(entities: E | E[]) { diff --git a/src/lib/listing/table/table.component.scss b/src/lib/listing/table/table.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/listing/table/table.component.ts b/src/lib/listing/table/table.component.ts index 6997e91..27ae052 100644 --- a/src/lib/listing/table/table.component.ts +++ b/src/lib/listing/table/table.component.ts @@ -24,7 +24,6 @@ const SCROLLBAR_WIDTH = 11; @Component({ selector: 'iqser-table [tableColumnConfigs] [itemSize]', templateUrl: './table.component.html', - styleUrls: ['./table.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class TableComponent extends AutoUnsubscribe implements OnChanges { diff --git a/src/lib/loading/full-page-loading-indicator/full-page-loading-indicator.component.scss b/src/lib/loading/full-page-loading-indicator/full-page-loading-indicator.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/loading/full-page-loading-indicator/full-page-loading-indicator.component.ts b/src/lib/loading/full-page-loading-indicator/full-page-loading-indicator.component.ts index e87160b..8eb1469 100644 --- a/src/lib/loading/full-page-loading-indicator/full-page-loading-indicator.component.ts +++ b/src/lib/loading/full-page-loading-indicator/full-page-loading-indicator.component.ts @@ -4,7 +4,6 @@ import { LoadingService } from '../loading.service'; @Component({ selector: 'iqser-full-page-loading-indicator', templateUrl: './full-page-loading-indicator.component.html', - styleUrls: ['./full-page-loading-indicator.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class FullPageLoadingIndicatorComponent { diff --git a/src/lib/misc/hidden-action/hidden-action.component.scss b/src/lib/misc/hidden-action/hidden-action.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/misc/hidden-action/hidden-action.component.ts b/src/lib/misc/hidden-action/hidden-action.component.ts index 76eaba4..4f6123f 100644 --- a/src/lib/misc/hidden-action/hidden-action.component.ts +++ b/src/lib/misc/hidden-action/hidden-action.component.ts @@ -4,7 +4,6 @@ import { BehaviorSubject } from 'rxjs'; @Component({ selector: 'iqser-hidden-action', templateUrl: './hidden-action.component.html', - styleUrls: ['./hidden-action.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class HiddenActionComponent { diff --git a/src/lib/misc/side-nav/side-nav.component.scss b/src/lib/misc/side-nav/side-nav.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/misc/side-nav/side-nav.component.ts b/src/lib/misc/side-nav/side-nav.component.ts index d37f895..15139d5 100644 --- a/src/lib/misc/side-nav/side-nav.component.ts +++ b/src/lib/misc/side-nav/side-nav.component.ts @@ -4,7 +4,6 @@ import { Required } from '../../utils'; @Component({ selector: 'iqser-side-nav', templateUrl: './side-nav.component.html', - styleUrls: ['./side-nav.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class SideNavComponent { diff --git a/src/lib/misc/toast/toast.component.scss b/src/lib/misc/toast/toast.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/misc/toast/toast.component.ts b/src/lib/misc/toast/toast.component.ts index 6700a56..0714632 100644 --- a/src/lib/misc/toast/toast.component.ts +++ b/src/lib/misc/toast/toast.component.ts @@ -4,7 +4,6 @@ import { ToasterActions, ToasterOptions } from '../../services'; @Component({ templateUrl: './toast.component.html', - styleUrls: ['./toast.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class ToastComponent extends Toast { diff --git a/src/lib/utils/functions.ts b/src/lib/utils/functions.ts index e1da318..f7c5408 100644 --- a/src/lib/utils/functions.ts +++ b/src/lib/utils/functions.ts @@ -34,7 +34,7 @@ export function toNumber(str: string): number { } export function trackByFactory() { - return (index: number, item: T): string => item.id; + return (_index: number, item: T): string => item.id; } export function hasFormChanged(form: UntypedFormGroup, initialFormValue: Record): boolean { @@ -107,7 +107,7 @@ export function deepDiffObj(base: Record, object: Record { + forOwn(base, (_value: any, key: string) => { if (!has(object, key)) { res[key] = undefined; }