RED-4590 - sonar fixes

This commit is contained in:
Valentin Mihai 2022-07-18 16:32:08 +03:00
parent 477e8ea5ae
commit d3e45f5c98
15 changed files with 4 additions and 10 deletions

View File

@ -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;

View File

@ -55,7 +55,7 @@ export class PageHeaderComponent<T extends IListable> {
this.searchService.reset();
}
trackByLabel<K extends { label?: string }>(index: number, item: K): string | undefined {
trackByLabel<K extends { label?: string }>(_index: number, item: K): string | undefined {
return item.label;
}
}

View File

@ -117,7 +117,7 @@ export class ListingService<E extends IListable> {
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[]) {

View File

@ -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<T extends IListable> extends AutoUnsubscribe implements OnChanges {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -34,7 +34,7 @@ export function toNumber(str: string): number {
}
export function trackByFactory<T extends ITrackable>() {
return (index: number, item: T): string => item.id;
return (_index: number, item: T): string => item.id;
}
export function hasFormChanged(form: UntypedFormGroup, initialFormValue: Record<string, string>): boolean {
@ -107,7 +107,7 @@ export function deepDiffObj(base: Record<string, unknown>, object: Record<string
}
});
// map removed fields to undefined
forOwn(base, (value: any, key: string) => {
forOwn(base, (_value: any, key: string) => {
if (!has(object, key)) {
res[key] = undefined;
}