From 4e84610f65c8993d9725af62188e3578e9a27e8b Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Wed, 6 Oct 2021 09:50:13 +0300 Subject: [PATCH] fix eslint --- src/lib/buttons/buttons.module.ts | 2 +- .../chevron-button/chevron-button.component.ts | 2 +- .../circle-button/circle-button.component.ts | 2 +- .../icon-button/icon-button.component.ts | 2 +- src/lib/buttons/types/circle-button.type.ts | 2 +- src/lib/buttons/types/icon-button.type.ts | 2 +- src/lib/common-ui.module.ts | 6 +++--- src/lib/empty-states/empty-state.module.ts | 2 +- .../empty-state/empty-state.component.ts | 2 +- .../full-page-error.component.ts | 6 +++--- src/lib/filtering/filter-utils.ts | 2 +- src/lib/filtering/filter.service.ts | 4 ++-- src/lib/filtering/filters.module.ts | 2 +- .../popup-filter/popup-filter.component.ts | 14 +++++++------- .../quick-filters/quick-filters.component.ts | 2 +- .../help-mode-dialog.component.ts | 2 +- src/lib/help-mode/help-mode.directive.ts | 4 ++-- src/lib/help-mode/help-mode.module.ts | 2 +- src/lib/help-mode/help-mode.service.ts | 4 ++-- .../help-mode/help-mode/help-mode.component.ts | 2 +- src/lib/icons/icons.module.ts | 2 +- .../editable-input/editable-input.component.ts | 2 +- .../input-with-action.component.ts | 2 +- src/lib/inputs/inputs.module.ts | 2 +- .../round-checkbox/round-checkbox.component.ts | 2 +- src/lib/listing/listing.module.ts | 6 +++--- src/lib/listing/models/listing-modes.ts | 2 +- .../models/search-positions.type.ts | 2 +- .../page-header/page-header.component.ts | 4 ++-- .../scroll-button/scroll-button.component.ts | 4 ++-- src/lib/listing/services/entities.service.ts | 18 +++++++++--------- src/lib/listing/services/listing.service.ts | 3 ++- src/lib/listing/sync-width.directive.ts | 6 +++--- .../table-column-name.component.ts | 2 +- src/lib/listing/table/table.component.ts | 4 ++-- src/lib/listing/workflow/workflow.component.ts | 4 ++-- .../full-page-loading-indicator.component.ts | 2 +- src/lib/loading/loading.service.ts | 2 +- .../hidden-action/hidden-action.component.ts | 2 +- src/lib/misc/logo/logo.component.ts | 2 +- src/lib/misc/side-nav/side-nav.component.ts | 2 +- .../misc/status-bar/status-bar.component.ts | 2 +- src/lib/scrollbar/has-scrollbar.directive.ts | 2 +- src/lib/scrollbar/scrollbar.module.ts | 2 +- src/lib/services/dialog.service.ts | 10 +++++----- src/lib/services/generic.service.ts | 17 +++++++++-------- src/lib/services/toaster.service.ts | 8 ++++---- src/lib/sorting/models/sorting-order.type.ts | 2 +- src/lib/sorting/sorting.service.ts | 2 +- src/lib/utils/custom-route-reuse.strategy.ts | 2 +- src/lib/utils/decorators/bind.decorator.ts | 4 ++-- .../utils/decorators/on-change.decorator.ts | 4 ++-- .../decorators/required-param.decorator.ts | 4 ++-- src/lib/utils/decorators/required.decorator.ts | 4 ++-- src/lib/utils/http-encoder.ts | 2 +- src/lib/utils/pipes/humanize.pipe.ts | 2 +- src/lib/utils/pipes/log.pipe.ts | 2 +- src/lib/utils/pruning-translation-loader.ts | 2 +- src/lib/utils/types/tooltip-positions.type.ts | 2 +- 59 files changed, 108 insertions(+), 106 deletions(-) diff --git a/src/lib/buttons/buttons.module.ts b/src/lib/buttons/buttons.module.ts index 90e84a9..1e71c60 100644 --- a/src/lib/buttons/buttons.module.ts +++ b/src/lib/buttons/buttons.module.ts @@ -14,6 +14,6 @@ const components = [ChevronButtonComponent, CircleButtonComponent, IconButtonCom @NgModule({ declarations: [...components], imports: [CommonModule, IqserIconsModule, TranslateModule, ...matModules], - exports: [...components] + exports: [...components], }) export class IqserButtonsModule {} diff --git a/src/lib/buttons/chevron-button/chevron-button.component.ts b/src/lib/buttons/chevron-button/chevron-button.component.ts index d515146..fc9936d 100644 --- a/src/lib/buttons/chevron-button/chevron-button.component.ts +++ b/src/lib/buttons/chevron-button/chevron-button.component.ts @@ -5,7 +5,7 @@ import { Required } from '../../utils'; selector: 'iqser-chevron-button', templateUrl: './chevron-button.component.html', styleUrls: ['./chevron-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ChevronButtonComponent { @Input() @Required() label!: string; diff --git a/src/lib/buttons/circle-button/circle-button.component.ts b/src/lib/buttons/circle-button/circle-button.component.ts index 3d57336..5dfa21c 100644 --- a/src/lib/buttons/circle-button/circle-button.component.ts +++ b/src/lib/buttons/circle-button/circle-button.component.ts @@ -7,7 +7,7 @@ import { IqserTooltipPosition, IqserTooltipPositions, Required } from '../../uti selector: 'iqser-circle-button', templateUrl: './circle-button.component.html', styleUrls: ['./circle-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class CircleButtonComponent implements OnInit { readonly circleButtonTypes = CircleButtonTypes; diff --git a/src/lib/buttons/icon-button/icon-button.component.ts b/src/lib/buttons/icon-button/icon-button.component.ts index 2e7255a..3b1ad8c 100644 --- a/src/lib/buttons/icon-button/icon-button.component.ts +++ b/src/lib/buttons/icon-button/icon-button.component.ts @@ -6,7 +6,7 @@ import { Required } from '../../utils'; selector: 'iqser-icon-button', templateUrl: './icon-button.component.html', styleUrls: ['./icon-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class IconButtonComponent { readonly iconButtonTypes = IconButtonTypes; diff --git a/src/lib/buttons/types/circle-button.type.ts b/src/lib/buttons/types/circle-button.type.ts index e8398d3..349c720 100644 --- a/src/lib/buttons/types/circle-button.type.ts +++ b/src/lib/buttons/types/circle-button.type.ts @@ -2,7 +2,7 @@ export const CircleButtonTypes = { default: 'default', primary: 'primary', warn: 'warn', - dark: 'dark' + dark: 'dark', } as const; export type CircleButtonType = keyof typeof CircleButtonTypes; diff --git a/src/lib/buttons/types/icon-button.type.ts b/src/lib/buttons/types/icon-button.type.ts index 9a84b04..fb3b62d 100644 --- a/src/lib/buttons/types/icon-button.type.ts +++ b/src/lib/buttons/types/icon-button.type.ts @@ -1,7 +1,7 @@ export const IconButtonTypes = { default: 'default', dark: 'dark', - primary: 'primary' + primary: 'primary', } as const; export type IconButtonType = keyof typeof IconButtonTypes; diff --git a/src/lib/common-ui.module.ts b/src/lib/common-ui.module.ts index 56ee4a2..60ce56c 100644 --- a/src/lib/common-ui.module.ts +++ b/src/lib/common-ui.module.ts @@ -32,7 +32,7 @@ const modules = [ IqserInputsModule, IqserHelpModeModule, IqserScrollbarModule, - IqserEmptyStatesModule + IqserEmptyStatesModule, ]; const components = [ StatusBarComponent, @@ -41,13 +41,13 @@ const components = [ LogoComponent, HiddenActionComponent, ConfirmationDialogComponent, - SideNavComponent + SideNavComponent, ]; const pipes = [SortByPipe, HumanizePipe]; @NgModule({ declarations: [...components, ...pipes, LogPipe], imports: [CommonModule, ...matModules, ...modules, FormsModule, ReactiveFormsModule], - exports: [...components, ...pipes, ...modules, LogPipe] + exports: [...components, ...pipes, ...modules, LogPipe], }) export class CommonUiModule {} diff --git a/src/lib/empty-states/empty-state.module.ts b/src/lib/empty-states/empty-state.module.ts index 0e352a1..46257c1 100644 --- a/src/lib/empty-states/empty-state.module.ts +++ b/src/lib/empty-states/empty-state.module.ts @@ -10,6 +10,6 @@ const components = [EmptyStateComponent]; @NgModule({ declarations: [...components], imports: [CommonModule, ...modules], - exports: [...components] + exports: [...components], }) export class IqserEmptyStatesModule {} diff --git a/src/lib/empty-states/empty-state/empty-state.component.ts b/src/lib/empty-states/empty-state/empty-state.component.ts index 4f2c9cc..c648c7e 100644 --- a/src/lib/empty-states/empty-state/empty-state.component.ts +++ b/src/lib/empty-states/empty-state/empty-state.component.ts @@ -6,7 +6,7 @@ import { Required } from '../../utils'; selector: 'iqser-empty-state', templateUrl: './empty-state.component.html', styleUrls: ['./empty-state.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class EmptyStateComponent implements OnInit { readonly iconButtonTypes = IconButtonTypes; diff --git a/src/lib/error/full-page-error/full-page-error.component.ts b/src/lib/error/full-page-error/full-page-error.component.ts index 43862b9..8e65339 100644 --- a/src/lib/error/full-page-error/full-page-error.component.ts +++ b/src/lib/error/full-page-error/full-page-error.component.ts @@ -11,10 +11,10 @@ import { animate, state, style, transition, trigger } from '@angular/animations' trigger('animateOpenClose', [ state('open', style({ bottom: '20px' })), state('void', style({ bottom: '-70px' })), - transition('* => open, open => void', animate('1s ease-in-out')) - ]) + transition('* => open, open => void', animate('1s ease-in-out')), + ]), ], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class FullPageErrorComponent { readonly iconButtonTypes = IconButtonTypes; diff --git a/src/lib/filtering/filter-utils.ts b/src/lib/filtering/filter-utils.ts index 017012c..f8288da 100644 --- a/src/lib/filtering/filter-utils.ts +++ b/src/lib/filtering/filter-utils.ts @@ -50,7 +50,7 @@ export function checkFilter( validate?: (...args: unknown[]) => boolean, // eslint-disable-next-line @typescript-eslint/no-explicit-any validateArgs: any = [], - matchAll = false + matchAll = false, ): boolean { const hasChecked = filters.find(f => f.checked); diff --git a/src/lib/filtering/filter.service.ts b/src/lib/filtering/filter.service.ts index d72052f..64dd02d 100644 --- a/src/lib/filtering/filter.service.ts +++ b/src/lib/filtering/filter.service.ts @@ -18,7 +18,7 @@ export class FilterService { constructor() { this.filterGroups$ = this._refresh$.pipe( startWith(''), - switchMap(() => this._filterGroups$.asObservable()) + switchMap(() => this._filterGroups$.asObservable()), ); this.showResetFilters$ = this._showResetFilters$; @@ -32,7 +32,7 @@ export class FilterService { return this.filterGroups$.pipe( map(toFlatFilters), map(f => !!f.find(el => el.checked)), - distinctUntilChanged() + distinctUntilChanged(), ); } diff --git a/src/lib/filtering/filters.module.ts b/src/lib/filtering/filters.module.ts index 1e516e2..4796037 100644 --- a/src/lib/filtering/filters.module.ts +++ b/src/lib/filtering/filters.module.ts @@ -16,6 +16,6 @@ const components = [QuickFiltersComponent, PopupFilterComponent]; @NgModule({ declarations: [...components], exports: [...components], - imports: [CommonModule, ...matModules, ...modules] + imports: [CommonModule, ...matModules, ...modules], }) export class IqserFiltersModule {} diff --git a/src/lib/filtering/popup-filter/popup-filter.component.ts b/src/lib/filtering/popup-filter/popup-filter.component.ts index cf2a489..3ae08ca 100644 --- a/src/lib/filtering/popup-filter/popup-filter.component.ts +++ b/src/lib/filtering/popup-filter/popup-filter.component.ts @@ -14,7 +14,7 @@ const areExpandable = (nestedFilter: INestedFilter) => !!nestedFilter?.children? const atLeastOneIsExpandable = pipe( map(group => !!group?.filters.some(areExpandable)), distinctUntilChanged(), - shareReplay() + shareReplay(), ); @Component({ @@ -27,11 +27,11 @@ const atLeastOneIsExpandable = pipe( provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: { clickAction: 'noop', - color: 'primary' - } + color: 'primary', + }, }, - SearchService - ] + SearchService, + ], }) export class PopupFilterComponent implements OnInit { @Input() primaryFiltersSlug!: string; @@ -54,7 +54,7 @@ export class PopupFilterComponent implements OnInit { return combineLatest([this.primaryFilterGroup$, this.secondaryFilterGroup$]).pipe( map(([primary, secondary]) => [...(primary?.filters || []), ...(secondary?.filters || [])]), any(f => f.checked || !!f.indeterminate), - distinctUntilChanged() + distinctUntilChanged(), ); } @@ -123,7 +123,7 @@ export class PopupFilterComponent implements OnInit { private get _primaryFilters$(): Observable { return combineLatest([this.primaryFilterGroup$, this.searchService.valueChanges$]).pipe( - map(([group]) => this.searchService.searchIn(group?.filters ?? [])) + map(([group]) => this.searchService.searchIn(group?.filters ?? [])), ); } } diff --git a/src/lib/filtering/quick-filters/quick-filters.component.ts b/src/lib/filtering/quick-filters/quick-filters.component.ts index 59c8f5c..0cac999 100644 --- a/src/lib/filtering/quick-filters/quick-filters.component.ts +++ b/src/lib/filtering/quick-filters/quick-filters.component.ts @@ -5,7 +5,7 @@ import { FilterService } from '../filter.service'; selector: 'iqser-quick-filters', templateUrl: './quick-filters.component.html', styleUrls: ['./quick-filters.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class QuickFiltersComponent { readonly quickFilters$ = this.filterService.getFilterModels$('quickFilters'); diff --git a/src/lib/help-mode/help-mode-dialog/help-mode-dialog.component.ts b/src/lib/help-mode/help-mode-dialog/help-mode-dialog.component.ts index ae75872..a4aee63 100644 --- a/src/lib/help-mode/help-mode-dialog/help-mode-dialog.component.ts +++ b/src/lib/help-mode/help-mode-dialog/help-mode-dialog.component.ts @@ -3,6 +3,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ templateUrl: './help-mode-dialog.component.html', styleUrls: ['./help-mode-dialog.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class HelpModeDialogComponent {} diff --git a/src/lib/help-mode/help-mode.directive.ts b/src/lib/help-mode/help-mode.directive.ts index c2110b2..f213d51 100644 --- a/src/lib/help-mode/help-mode.directive.ts +++ b/src/lib/help-mode/help-mode.directive.ts @@ -3,7 +3,7 @@ import { HelpModeService } from './help-mode.service'; @Directive({ selector: '[iqserHelpMode]', - exportAs: 'iqserHelpMode' + exportAs: 'iqserHelpMode', }) export class HelpModeDirective implements OnInit { @Input('iqserHelpMode') elementName!: string; @@ -11,7 +11,7 @@ export class HelpModeDirective implements OnInit { constructor( private readonly _elementRef: ElementRef, private readonly _renderer: Renderer2, - private readonly _helpModeService: HelpModeService + private readonly _helpModeService: HelpModeService, ) {} ngOnInit(): void { diff --git a/src/lib/help-mode/help-mode.module.ts b/src/lib/help-mode/help-mode.module.ts index a3fa60d..3ce45ca 100644 --- a/src/lib/help-mode/help-mode.module.ts +++ b/src/lib/help-mode/help-mode.module.ts @@ -16,6 +16,6 @@ const components = [HelpModeComponent, HelpModeDialogComponent, HelpModeDirectiv declarations: [...components], imports: [CommonModule, IqserIconsModule, ...matModules, TranslateModule, IqserButtonsModule], exports: [...components], - providers: [HelpModeService] + providers: [HelpModeService], }) export class IqserHelpModeModule {} diff --git a/src/lib/help-mode/help-mode.service.ts b/src/lib/help-mode/help-mode.service.ts index 7258a6c..ae36f92 100644 --- a/src/lib/help-mode/help-mode.service.ts +++ b/src/lib/help-mode/help-mode.service.ts @@ -24,7 +24,7 @@ export class HelpModeService { @Inject(HELP_DOCS) private readonly _docs: Record>, private readonly _dialog: MatDialog, private readonly _rendererFactory: RendererFactory2, - private readonly _translateService: TranslateService + private readonly _translateService: TranslateService, ) { this._renderer = this._rendererFactory.createRenderer(null, null); } @@ -41,7 +41,7 @@ export class HelpModeService { this._helpModeDialogIsOpened$.next(true); const ref = this._dialog.open(HelpModeDialogComponent, { - width: '600px' + width: '600px', }); ref.afterClosed() diff --git a/src/lib/help-mode/help-mode/help-mode.component.ts b/src/lib/help-mode/help-mode/help-mode.component.ts index 7740c6c..39c246c 100644 --- a/src/lib/help-mode/help-mode/help-mode.component.ts +++ b/src/lib/help-mode/help-mode/help-mode.component.ts @@ -6,7 +6,7 @@ import { IqserEventTarget } from '../../utils'; selector: 'iqser-help-mode', templateUrl: './help-mode.component.html', styleUrls: ['./help-mode.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class HelpModeComponent { constructor(readonly helpModeService: HelpModeService) {} diff --git a/src/lib/icons/icons.module.ts b/src/lib/icons/icons.module.ts index 68d3a2a..3a84f05 100644 --- a/src/lib/icons/icons.module.ts +++ b/src/lib/icons/icons.module.ts @@ -36,7 +36,7 @@ export class IqserIconsModule { 'sort-desc', 'status-collapse', 'status-expand', - 'upload' + 'upload', ]); icons.forEach(icon => { _iconRegistry.addSvgIconInNamespace( diff --git a/src/lib/inputs/editable-input/editable-input.component.ts b/src/lib/inputs/editable-input/editable-input.component.ts index 480fbdb..2936c44 100644 --- a/src/lib/inputs/editable-input/editable-input.component.ts +++ b/src/lib/inputs/editable-input/editable-input.component.ts @@ -6,7 +6,7 @@ import { CircleButtonType } from '../../buttons'; selector: 'iqser-editable-input', templateUrl: './editable-input.component.html', styleUrls: ['./editable-input.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class EditableInputComponent { @Input() @Required() value!: string; diff --git a/src/lib/inputs/input-with-action/input-with-action.component.ts b/src/lib/inputs/input-with-action/input-with-action.component.ts index 809eccc..d0230a4 100644 --- a/src/lib/inputs/input-with-action/input-with-action.component.ts +++ b/src/lib/inputs/input-with-action/input-with-action.component.ts @@ -4,7 +4,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from selector: 'iqser-input-with-action', templateUrl: './input-with-action.component.html', styleUrls: ['./input-with-action.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class InputWithActionComponent { @Input() placeholder = ''; diff --git a/src/lib/inputs/inputs.module.ts b/src/lib/inputs/inputs.module.ts index 2355853..fa1308c 100644 --- a/src/lib/inputs/inputs.module.ts +++ b/src/lib/inputs/inputs.module.ts @@ -13,6 +13,6 @@ const components = [RoundCheckboxComponent, EditableInputComponent, InputWithAct @NgModule({ declarations: [...components], exports: [...components], - imports: [CommonModule, IqserIconsModule, ...modules] + imports: [CommonModule, IqserIconsModule, ...modules], }) export class IqserInputsModule {} diff --git a/src/lib/inputs/round-checkbox/round-checkbox.component.ts b/src/lib/inputs/round-checkbox/round-checkbox.component.ts index 05c3339..f96ba9d 100644 --- a/src/lib/inputs/round-checkbox/round-checkbox.component.ts +++ b/src/lib/inputs/round-checkbox/round-checkbox.component.ts @@ -4,7 +4,7 @@ import { ChangeDetectionStrategy, Component, ElementRef, Input, OnInit, ViewChil selector: 'iqser-round-checkbox', templateUrl: './round-checkbox.component.html', styleUrls: ['./round-checkbox.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class RoundCheckboxComponent implements OnInit { @Input() size = 20; diff --git a/src/lib/listing/listing.module.ts b/src/lib/listing/listing.module.ts index 1a60ca1..4d4df0f 100644 --- a/src/lib/listing/listing.module.ts +++ b/src/lib/listing/listing.module.ts @@ -26,7 +26,7 @@ const components = [ WorkflowComponent, TableColumnNameComponent, ScrollButtonComponent, - PageHeaderComponent + PageHeaderComponent, ]; const modules = [ DragDropModule, @@ -38,13 +38,13 @@ const modules = [ IqserScrollbarModule, IqserEmptyStatesModule, ScrollingModule, - RouterModule + RouterModule, ]; const utils = [SyncWidthDirective]; @NgModule({ declarations: [...components, ...utils], exports: [...components, ...utils], - imports: [CommonModule, ...modules, ...matModules] + imports: [CommonModule, ...modules, ...matModules], }) export class IqserListingModule {} diff --git a/src/lib/listing/models/listing-modes.ts b/src/lib/listing/models/listing-modes.ts index ed2cf73..b7eabfc 100644 --- a/src/lib/listing/models/listing-modes.ts +++ b/src/lib/listing/models/listing-modes.ts @@ -1,6 +1,6 @@ export const ListingModes = { table: 'table', - workflow: 'workflow' + workflow: 'workflow', } as const; export type ListingMode = keyof typeof ListingModes; diff --git a/src/lib/listing/page-header/models/search-positions.type.ts b/src/lib/listing/page-header/models/search-positions.type.ts index 2b6314c..c0d336d 100644 --- a/src/lib/listing/page-header/models/search-positions.type.ts +++ b/src/lib/listing/page-header/models/search-positions.type.ts @@ -1,6 +1,6 @@ export const SearchPositions = { beforeFilters: 'beforeFilters', - afterFilters: 'afterFilters' + afterFilters: 'afterFilters', } as const; export type SearchPosition = keyof typeof SearchPositions; diff --git a/src/lib/listing/page-header/page-header.component.ts b/src/lib/listing/page-header/page-header.component.ts index 9857a76..28c211a 100644 --- a/src/lib/listing/page-header/page-header.component.ts +++ b/src/lib/listing/page-header/page-header.component.ts @@ -11,7 +11,7 @@ import { FilterService } from '../../filtering'; selector: 'iqser-page-header', templateUrl: './page-header.component.html', styleUrls: ['./page-header.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class PageHeaderComponent { readonly searchPositions = SearchPositions; @@ -39,7 +39,7 @@ export class PageHeaderComponent { return combineLatest([this.filterService.showResetFilters$, this.searchService.valueChanges$]).pipe( map(([showResetFilters, searchValue]) => showResetFilters || !!searchValue), - distinctUntilChanged() + distinctUntilChanged(), ); } diff --git a/src/lib/listing/scroll-button/scroll-button.component.ts b/src/lib/listing/scroll-button/scroll-button.component.ts index c6da626..ca614f4 100644 --- a/src/lib/listing/scroll-button/scroll-button.component.ts +++ b/src/lib/listing/scroll-button/scroll-button.component.ts @@ -6,7 +6,7 @@ import { Required } from '../../utils'; const ButtonTypes = { top: 'top', - bottom: 'bottom' + bottom: 'bottom', } as const; type ButtonType = keyof typeof ButtonTypes; @@ -15,7 +15,7 @@ type ButtonType = keyof typeof ButtonTypes; selector: 'iqser-scroll-button', templateUrl: './scroll-button.component.html', styleUrls: ['./scroll-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ScrollButtonComponent implements OnInit { readonly buttonType = ButtonTypes; diff --git a/src/lib/listing/services/entities.service.ts b/src/lib/listing/services/entities.service.ts index 95194c2..cc9b430 100644 --- a/src/lib/listing/services/entities.service.ts +++ b/src/lib/listing/services/entities.service.ts @@ -1,9 +1,9 @@ -import { Inject, Injectable, InjectionToken, Injector, Optional } from "@angular/core"; -import { BehaviorSubject, Observable, Subject } from "rxjs"; -import { distinctUntilChanged, map, tap } from "rxjs/operators"; -import { IListable } from "../models"; -import { GenericService } from "../../services"; -import { getLength } from "../../utils"; +import { Inject, Injectable, InjectionToken, Injector, Optional } from '@angular/core'; +import { BehaviorSubject, Observable, Subject } from 'rxjs'; +import { distinctUntilChanged, map, tap } from 'rxjs/operators'; +import { IListable } from '../models'; +import { GenericService } from '../../services'; +import { getLength } from '../../utils'; /** * This should be removed when refactoring is done @@ -27,7 +27,7 @@ export class EntitiesService extends GenericService< constructor( protected readonly _injector: Injector, @Optional() @Inject(ENTITY_CLASS) private readonly _entityClass: new (entityInterface: I, ...args: unknown[]) => E, - @Optional() @Inject(ENTITY_PATH) protected readonly _defaultModelPath = '' + @Optional() @Inject(ENTITY_PATH) protected readonly _defaultModelPath = '', ) { super(_injector, _defaultModelPath); this.all$ = this._all$.asObservable(); @@ -42,14 +42,14 @@ export class EntitiesService extends GenericService< private get _noData$(): Observable { return this.allLength$.pipe( map(length => length === 0), - distinctUntilChanged() + distinctUntilChanged(), ); } loadAll(): Observable { return this.getAll().pipe( map((entities: I[]) => entities.map(entity => new this._entityClass(entity))), - tap((entities: E[]) => this.setEntities(entities)) + tap((entities: E[]) => this.setEntities(entities)), ); } diff --git a/src/lib/listing/services/listing.service.ts b/src/lib/listing/services/listing.service.ts index 37abf8b..afd6c83 100644 --- a/src/lib/listing/services/listing.service.ts +++ b/src/lib/listing/services/listing.service.ts @@ -4,7 +4,8 @@ import { distinctUntilChanged, map, tap } from 'rxjs/operators'; import { FilterService, getFilteredEntities } from '../../filtering'; import { SearchService } from '../../search'; import { IListable } from '../models'; -import { EntitiesService, getLength } from '@iqser/common-ui'; +import { EntitiesService } from './entities.service'; +import { getLength } from '../../utils'; @Injectable() export class ListingService { diff --git a/src/lib/listing/sync-width.directive.ts b/src/lib/listing/sync-width.directive.ts index d5a1a03..fac4287 100644 --- a/src/lib/listing/sync-width.directive.ts +++ b/src/lib/listing/sync-width.directive.ts @@ -1,7 +1,7 @@ import { Directive, ElementRef, HostListener, Input, OnDestroy } from '@angular/core'; @Directive({ - selector: '[iqserSyncWidth]' + selector: '[iqserSyncWidth]', }) export class SyncWidthDirective implements OnDestroy { @Input() iqserSyncWidth!: string; @@ -25,7 +25,7 @@ export class SyncWidthDirective implements OnDestroy { private _matchWidth() { const headerItems = (this._elementRef.nativeElement as HTMLElement).children; const tableRows = (this._elementRef.nativeElement as HTMLElement).parentElement?.parentElement?.getElementsByClassName( - this.iqserSyncWidth + this.iqserSyncWidth, ); if (!tableRows || !tableRows.length) { @@ -52,7 +52,7 @@ export class SyncWidthDirective implements OnDestroy { for (let idx = length - hasExtraColumns - 1; idx < headerItems.length; idx += 1) { const item = headerItems[idx] as HTMLElement; if (item) { - item.style.minWidth = `0`; + item.style.minWidth = '0'; } } } diff --git a/src/lib/listing/table-column-name/table-column-name.component.ts b/src/lib/listing/table-column-name/table-column-name.component.ts index dc1e1c4..4b2b81a 100644 --- a/src/lib/listing/table-column-name/table-column-name.component.ts +++ b/src/lib/listing/table-column-name/table-column-name.component.ts @@ -9,7 +9,7 @@ const ifHasRightIcon = (thisArg: TableColumnNameComponent { readonly sortingOrders = SortingOrders; diff --git a/src/lib/listing/table/table.component.ts b/src/lib/listing/table/table.component.ts index 4d9a7c6..7c111a6 100644 --- a/src/lib/listing/table/table.component.ts +++ b/src/lib/listing/table/table.component.ts @@ -9,7 +9,7 @@ import { Output, TemplateRef, ViewChild, - ViewContainerRef + ViewContainerRef, } from '@angular/core'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { Required } from '../../utils'; @@ -80,7 +80,7 @@ export class TableComponent implements OnInit { getTableItemClasses(entity: T): { [key: string]: boolean } { const classes: { [key: string]: boolean } = { 'table-item': true, - pointer: !!entity.routerLink && entity.routerLink.length > 0 + pointer: !!entity.routerLink && entity.routerLink.length > 0, }; for (const key in this.tableItemClasses) { if (Object.prototype.hasOwnProperty.call(this.tableItemClasses, key)) { diff --git a/src/lib/listing/workflow/workflow.component.ts b/src/lib/listing/workflow/workflow.component.ts index 0fa2113..b0bc1a5 100644 --- a/src/lib/listing/workflow/workflow.component.ts +++ b/src/lib/listing/workflow/workflow.component.ts @@ -9,7 +9,7 @@ import { Output, QueryList, TemplateRef, - ViewChildren + ViewChildren, } from '@angular/core'; import { ListingComponent } from '../listing-component.directive'; import { CdkDrag, CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop'; @@ -37,7 +37,7 @@ export interface WorkflowConfig { selector: 'iqser-workflow', templateUrl: './workflow.component.html', styleUrls: ['./workflow.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class WorkflowComponent implements OnInit { @Input() headerTemplate?: TemplateRef; 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 c1c9b4e..e87160b 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 @@ -5,7 +5,7 @@ import { LoadingService } from '../loading.service'; selector: 'iqser-full-page-loading-indicator', templateUrl: './full-page-loading-indicator.component.html', styleUrls: ['./full-page-loading-indicator.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class FullPageLoadingIndicatorComponent { constructor(readonly loadingService: LoadingService) {} diff --git a/src/lib/loading/loading.service.ts b/src/lib/loading/loading.service.ts index 15ac265..efb767b 100644 --- a/src/lib/loading/loading.service.ts +++ b/src/lib/loading/loading.service.ts @@ -28,7 +28,7 @@ export class LoadingService { func.then( () => this.stop(), - () => this.stop() + () => this.stop(), ); } diff --git a/src/lib/misc/hidden-action/hidden-action.component.ts b/src/lib/misc/hidden-action/hidden-action.component.ts index c379b72..6d8a68c 100644 --- a/src/lib/misc/hidden-action/hidden-action.component.ts +++ b/src/lib/misc/hidden-action/hidden-action.component.ts @@ -4,7 +4,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from selector: 'iqser-hidden-action', templateUrl: './hidden-action.component.html', styleUrls: ['./hidden-action.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class HiddenActionComponent { @Input() requiredClicks = 4; diff --git a/src/lib/misc/logo/logo.component.ts b/src/lib/misc/logo/logo.component.ts index 1aeee08..c73e4a5 100644 --- a/src/lib/misc/logo/logo.component.ts +++ b/src/lib/misc/logo/logo.component.ts @@ -5,7 +5,7 @@ import { Required } from '../../utils'; selector: 'iqser-logo', templateUrl: './logo.component.html', styleUrls: ['./logo.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class LogoComponent { @Input() @Required() icon!: string; diff --git a/src/lib/misc/side-nav/side-nav.component.ts b/src/lib/misc/side-nav/side-nav.component.ts index 5ed36e4..d37f895 100644 --- a/src/lib/misc/side-nav/side-nav.component.ts +++ b/src/lib/misc/side-nav/side-nav.component.ts @@ -5,7 +5,7 @@ import { Required } from '../../utils'; selector: 'iqser-side-nav', templateUrl: './side-nav.component.html', styleUrls: ['./side-nav.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class SideNavComponent { @Input() @Required() title!: string; diff --git a/src/lib/misc/status-bar/status-bar.component.ts b/src/lib/misc/status-bar/status-bar.component.ts index 80001ee..5bdbcf1 100644 --- a/src/lib/misc/status-bar/status-bar.component.ts +++ b/src/lib/misc/status-bar/status-bar.component.ts @@ -6,7 +6,7 @@ import { StatusBarConfig } from './status-bar-config.model'; templateUrl: './status-bar.component.html', styleUrls: ['./status-bar.component.scss'], encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) export class StatusBarComponent { @Input() configs: readonly StatusBarConfig[] = []; diff --git a/src/lib/scrollbar/has-scrollbar.directive.ts b/src/lib/scrollbar/has-scrollbar.directive.ts index c2edf2f..03de918 100644 --- a/src/lib/scrollbar/has-scrollbar.directive.ts +++ b/src/lib/scrollbar/has-scrollbar.directive.ts @@ -2,7 +2,7 @@ import { AfterContentChecked, Directive, ElementRef, HostBinding } from '@angula @Directive({ selector: '[iqserHasScrollbar]', - exportAs: 'iqserHasScrollbar' + exportAs: 'iqserHasScrollbar', }) export class HasScrollbarDirective implements AfterContentChecked { @HostBinding('class') class = ''; diff --git a/src/lib/scrollbar/scrollbar.module.ts b/src/lib/scrollbar/scrollbar.module.ts index 5efb8f1..e9e9d0b 100644 --- a/src/lib/scrollbar/scrollbar.module.ts +++ b/src/lib/scrollbar/scrollbar.module.ts @@ -8,6 +8,6 @@ const utils = [HasScrollbarDirective]; declarations: [...utils], exports: [...utils], imports: [CommonModule], - providers: [HasScrollbarDirective] + providers: [HasScrollbarDirective], }) export class IqserScrollbarModule {} diff --git a/src/lib/services/dialog.service.ts b/src/lib/services/dialog.service.ts index e9bf19f..1f3ba19 100644 --- a/src/lib/services/dialog.service.ts +++ b/src/lib/services/dialog.service.ts @@ -6,13 +6,13 @@ export const largeDialogConfig: MatDialogConfig = { width: '90vw', maxWidth: '90vw', maxHeight: '90vh', - autoFocus: false + autoFocus: false, } as const; export const defaultDialogConfig: MatDialogConfig = { width: '662px', maxWidth: '90vw', - autoFocus: false + autoFocus: false, } as const; @Injectable() @@ -30,8 +30,8 @@ export abstract class DialogService { type: T, $event: MouseEvent, data: unknown, - cb?: (...params: unknown[]) => unknown, - finallyCb?: (...params: unknown[]) => unknown | Promise + cb?: (...params: unknown[]) => Promise | unknown, + finallyCb?: (...params: unknown[]) => unknown | Promise, ): MatDialogRef { const config = this._config[type]; @@ -39,7 +39,7 @@ export abstract class DialogService { const ref = this._dialog.open(config.component, { ...defaultDialogConfig, ...(config.dialogConfig || {}), - data + data, }); // eslint-disable-next-line @typescript-eslint/no-misused-promises ref.afterClosed().subscribe(async result => { diff --git a/src/lib/services/generic.service.ts b/src/lib/services/generic.service.ts index ff87130..d7bcb61 100644 --- a/src/lib/services/generic.service.ts +++ b/src/lib/services/generic.service.ts @@ -26,6 +26,7 @@ export abstract class GenericService { get(): Observable; get(id: string, ...args: unknown[]): Observable; + // eslint-disable-next-line @typescript-eslint/no-unused-vars get(id?: string, ...args: unknown[]): Observable { return id ? this._getOne([id]) : this.getAll(); } @@ -34,7 +35,7 @@ export abstract class GenericService { getAll(modelPath = this._defaultModelPath): Observable { return this._http.get(`/${encodeURI(modelPath)}`, { headers: HeadersConfiguration.getHeaders({ contentType: false }), - observe: 'body' + observe: 'body', }); } @@ -50,7 +51,7 @@ export abstract class GenericService { body: body, params: this._queryParams(queryParams), headers: HeadersConfiguration.getHeaders({ contentType: false }), - observe: 'body' + observe: 'body', }); } @@ -58,12 +59,12 @@ export abstract class GenericService { protected _post( @RequiredParam() body: unknown, modelPath = this._defaultModelPath, - queryParams?: List + queryParams?: List, ): Observable { return this._http.post(`/${encodeURI(modelPath)}`, body, { params: this._queryParams(queryParams), headers: HeadersConfiguration.getHeaders(), - observe: 'body' + observe: 'body', }); } @@ -71,12 +72,12 @@ export abstract class GenericService { protected _put( @RequiredParam() body: unknown, modelPath = this._defaultModelPath, - queryParams?: List + queryParams?: List, ): Observable { return this._http.put(`/${encodeURI(modelPath)}`, body, { params: this._queryParams(queryParams), headers: HeadersConfiguration.getHeaders(), - observe: 'body' + observe: 'body', }); } @@ -84,14 +85,14 @@ export abstract class GenericService { protected _getOne( @RequiredParam() path: List, modelPath = this._defaultModelPath, - queryParams?: List + queryParams?: List, ): Observable { const entityPath = path.map(item => encodeURIComponent(item)).join('/'); return this._http.get(`/${encodeURI(modelPath)}/${entityPath}`, { headers: HeadersConfiguration.getHeaders({ contentType: false }), params: this._queryParams(queryParams), - observe: 'body' + observe: 'body', }); } diff --git a/src/lib/services/toaster.service.ts b/src/lib/services/toaster.service.ts index 5562b1b..6b4f6d6 100644 --- a/src/lib/services/toaster.service.ts +++ b/src/lib/services/toaster.service.ts @@ -10,7 +10,7 @@ import { ErrorMessageService } from './error-message.service'; const enum NotificationType { SUCCESS = 'SUCCESS', WARNING = 'WARNING', - INFO = 'INFO' + INFO = 'INFO', } export interface ToasterOptions extends IndividualConfig { @@ -31,14 +31,14 @@ export interface ErrorToasterOptions extends ToasterOptions { } @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class Toaster { constructor( private readonly _toastr: ToastrService, private readonly _router: Router, private readonly _translateService: TranslateService, - private readonly _errorMessageService: ErrorMessageService + private readonly _errorMessageService: ErrorMessageService, ) { _router.events.pipe(filter(event => event instanceof NavigationStart)).subscribe(() => { _toastr.clear(); @@ -71,7 +71,7 @@ export class Toaster { private _showToastNotification( message: string, notificationType = NotificationType.INFO, - options?: Partial + options?: Partial, ): ActiveToast { const translatedMsg = this._translateService.instant(message, options?.params) as string; diff --git a/src/lib/sorting/models/sorting-order.type.ts b/src/lib/sorting/models/sorting-order.type.ts index 8ab85f8..f401114 100644 --- a/src/lib/sorting/models/sorting-order.type.ts +++ b/src/lib/sorting/models/sorting-order.type.ts @@ -8,7 +8,7 @@ export const SortingOrders = { return 'asc'; } return order === 'asc' ? 'desc' : 'asc'; - } + }, } as const; export type SortingOrder = NonFunctionKeys; diff --git a/src/lib/sorting/sorting.service.ts b/src/lib/sorting/sorting.service.ts index 6d6870f..f9fd53f 100644 --- a/src/lib/sorting/sorting.service.ts +++ b/src/lib/sorting/sorting.service.ts @@ -10,7 +10,7 @@ import { IListable } from '../listing'; export class SortingService { private readonly _sortingOption$ = new BehaviorSubject>({ column: 'searchKey', - order: SortingOrders.asc + order: SortingOrders.asc, }); readonly sortingOption$ = this._sortingOption$.asObservable(); diff --git a/src/lib/utils/custom-route-reuse.strategy.ts b/src/lib/utils/custom-route-reuse.strategy.ts index 72a41f1..9fe90ca 100644 --- a/src/lib/utils/custom-route-reuse.strategy.ts +++ b/src/lib/utils/custom-route-reuse.strategy.ts @@ -45,7 +45,7 @@ export class CustomRouteReuseStrategy implements RouteReuseStrategy { this._storedRoutes[this._getKey(route)] = { handle: element as DetachedRouteHandle, - previousRoute: route + previousRoute: route, }; } diff --git a/src/lib/utils/decorators/bind.decorator.ts b/src/lib/utils/decorators/bind.decorator.ts index 66ee6e1..7ee72bc 100644 --- a/src/lib/utils/decorators/bind.decorator.ts +++ b/src/lib/utils/decorators/bind.decorator.ts @@ -19,10 +19,10 @@ export function Bind(): MethodDecorator { Object.defineProperty(this, propertyKey, { value: boundMethod, configurable: true, - writable: true + writable: true, }); return boundMethod; - } + }, }; }; } diff --git a/src/lib/utils/decorators/on-change.decorator.ts b/src/lib/utils/decorators/on-change.decorator.ts index b083e4d..11ddf69 100644 --- a/src/lib/utils/decorators/on-change.decorator.ts +++ b/src/lib/utils/decorators/on-change.decorator.ts @@ -47,14 +47,14 @@ export function OnChange(callback: CallBackFunctio const simpleChange: SimpleChange = { previousValue: oldValue, currentValue: instance[CACHED_VALUE_KEY], - isFirstChange: instance[IS_FIRST_CHANGE_KEY] + isFirstChange: instance[IS_FIRST_CHANGE_KEY], }; callBackFn.call(instance, instance[CACHED_VALUE_KEY], simpleChange); }, get(): T { return (this as Instance)[CACHED_VALUE_KEY]; - } + }, }); }; } diff --git a/src/lib/utils/decorators/required-param.decorator.ts b/src/lib/utils/decorators/required-param.decorator.ts index f6536f8..513eb2b 100644 --- a/src/lib/utils/decorators/required-param.decorator.ts +++ b/src/lib/utils/decorators/required-param.decorator.ts @@ -20,7 +20,7 @@ export function Validate() { const method = descriptor.value as (...args: unknown[]) => unknown; const methodParams = getMethodParams(target as Record, propertyName); - descriptor.value = function(...args: unknown[]) { + descriptor.value = function (...args: unknown[]) { // eslint-disable-next-line @typescript-eslint/ban-types const requiredParameters = Reflect.getOwnMetadata(requiredMetadataKey, target as Object, propertyName); @@ -31,7 +31,7 @@ export function Validate() { for (const parameterIndex of requiredParameters) { if (parameterIndex >= args.length || args[parameterIndex] === undefined) { throw new Error( - `Required parameter ${methodParams[parameterIndex]} was null or undefined when calling ${propertyName}` + `Required parameter ${methodParams[parameterIndex]} was null or undefined when calling ${propertyName}`, ); } } diff --git a/src/lib/utils/decorators/required.decorator.ts b/src/lib/utils/decorators/required.decorator.ts index 276dfc0..b142468 100644 --- a/src/lib/utils/decorators/required.decorator.ts +++ b/src/lib/utils/decorators/required.decorator.ts @@ -11,9 +11,9 @@ export function Required(condition: Condition = () => true): PropertyDecor set(value: unknown) { Object.defineProperty(this, propertyKey, { value, - writable: true + writable: true, }); - } + }, }); }; } diff --git a/src/lib/utils/http-encoder.ts b/src/lib/utils/http-encoder.ts index 3e8c0a3..892cfe3 100644 --- a/src/lib/utils/http-encoder.ts +++ b/src/lib/utils/http-encoder.ts @@ -1,4 +1,4 @@ -import { HttpUrlEncodingCodec } from "@angular/common/http"; +import { HttpUrlEncodingCodec } from '@angular/common/http'; /** * CustomHttpUrlEncodingCodec diff --git a/src/lib/utils/pipes/humanize.pipe.ts b/src/lib/utils/pipes/humanize.pipe.ts index c392ed7..25a4d7e 100644 --- a/src/lib/utils/pipes/humanize.pipe.ts +++ b/src/lib/utils/pipes/humanize.pipe.ts @@ -2,7 +2,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { humanize } from '../functions'; @Pipe({ - name: 'humanize' + name: 'humanize', }) export class HumanizePipe implements PipeTransform { transform(item: string, lowercase = false): string { diff --git a/src/lib/utils/pipes/log.pipe.ts b/src/lib/utils/pipes/log.pipe.ts index d8dc377..e9dd9b9 100644 --- a/src/lib/utils/pipes/log.pipe.ts +++ b/src/lib/utils/pipes/log.pipe.ts @@ -1,7 +1,7 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: 'log' + name: 'log', }) export class LogPipe implements PipeTransform { transform(value: T, message = ''): T { diff --git a/src/lib/utils/pruning-translation-loader.ts b/src/lib/utils/pruning-translation-loader.ts index 3ec063c..f618ac6 100644 --- a/src/lib/utils/pruning-translation-loader.ts +++ b/src/lib/utils/pruning-translation-loader.ts @@ -23,7 +23,7 @@ export class PruningTranslationLoader implements TranslateLoader { (result: T, key) => ( (result[key] = typeof object[key] === 'object' ? this._process(object[key] as T) : object[key]), result ), - {} + {}, ) ); } diff --git a/src/lib/utils/types/tooltip-positions.type.ts b/src/lib/utils/types/tooltip-positions.type.ts index 35f6e6a..3582567 100644 --- a/src/lib/utils/types/tooltip-positions.type.ts +++ b/src/lib/utils/types/tooltip-positions.type.ts @@ -4,7 +4,7 @@ export const IqserTooltipPositions = { below: 'below', above: 'above', before: 'before', - after: 'after' + after: 'after', } as const; export type IqserTooltipPosition = KeysOf;