Lint fixes

This commit is contained in:
aditya.chandel
2025-01-12 20:30:21 -07:00
parent e9271af75e
commit 00a2d778c0
9 changed files with 17 additions and 19 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ export class AppComponent implements OnInit {
}); });
this.rxStompService.watch('/topic/log').subscribe((message: Message) => { this.rxStompService.watch('/topic/log').subscribe((message: Message) => {
let logNotification = parseLogNotification(message.body); const logNotification = parseLogNotification(message.body);
this.eventService.handleIncomingLog(logNotification); this.eventService.handleIncomingLog(logNotification);
}); });
} }
@@ -84,7 +84,7 @@ export class BookBrowserComponent implements OnInit {
entityType: EntityType | undefined; entityType: EntityType | undefined;
bookTitle: string = ''; bookTitle: string = '';
entityOptions: MenuItem[] | undefined; entityOptions: MenuItem[] | undefined;
selectedBooks: Set<number> = new Set(); selectedBooks = new Set<number>();
selectedSort: SortOption | null = null; selectedSort: SortOption | null = null;
sortOptions: SortOption[] = []; sortOptions: SortOption[] = [];
isDrawerVisible: boolean = false; isDrawerVisible: boolean = false;
@@ -23,7 +23,7 @@ import {SortOption} from '../../../model/sort.model';
}) })
export class BookTableComponent implements OnChanges { export class BookTableComponent implements OnChanges {
selectedBooks: Book[] = []; selectedBooks: Book[] = [];
selectedBookIds: Set<number> = new Set(); selectedBookIds = new Set<number>();
@Output() selectedBooksChange = new EventEmitter<Set<number>>(); @Output() selectedBooksChange = new EventEmitter<Set<number>>();
@Input() books: Book[] = []; @Input() books: Book[] = [];
@@ -34,7 +34,7 @@ export class BookTableComponent implements OnChanges {
// Hack to set virtual-scroller height // Hack to set virtual-scroller height
ngOnChanges() { ngOnChanges() {
let wrapperElements: HTMLCollection = document.getElementsByClassName('p-virtualscroller'); const wrapperElements: HTMLCollection = document.getElementsByClassName('p-virtualscroller');
Array.prototype.forEach.call(wrapperElements, function (wrapperElement) { Array.prototype.forEach.call(wrapperElements, function (wrapperElement) {
wrapperElement.style["height"] = 'calc(100vh - 160px)'; wrapperElement.style["height"] = 'calc(100vh - 160px)';
}); });
@@ -42,7 +42,7 @@ export class ShelfAssignerComponent implements OnInit {
selectedShelves: Shelf[] = []; selectedShelves: Shelf[] = [];
displayShelfDialog: boolean = false; displayShelfDialog: boolean = false;
shelfName: string = ''; shelfName: string = '';
bookIds: Set<number> = new Set(); bookIds = new Set<number>();
isMultiBooks: boolean = false; isMultiBooks: boolean = false;
selectedIcon: string | null = null; selectedIcon: string | null = null;
@@ -92,7 +92,7 @@ export class ShelfAssignerComponent implements OnInit {
} }
updateBooksShelves(): void { updateBooksShelves(): void {
const idsToAssign: Set<number | undefined> = new Set(this.selectedShelves.map(shelf => shelf.id)); const idsToAssign = new Set<number | undefined>(this.selectedShelves.map(shelf => shelf.id));
const idsToUnassign: Set<number> = this.isMultiBooks ? new Set() : this.getIdsToUnAssign(this.book, idsToAssign); const idsToUnassign: Set<number> = this.isMultiBooks ? new Set() : this.getIdsToUnAssign(this.book, idsToAssign);
const bookIds = this.isMultiBooks ? this.bookIds : new Set([this.book.id]); const bookIds = this.isMultiBooks ? this.bookIds : new Set([this.book.id]);
this.updateBookShelves(bookIds, idsToAssign, idsToUnassign); this.updateBookShelves(bookIds, idsToAssign, idsToUnassign);
@@ -105,7 +105,7 @@ export class LayoutService {
changeTheme() { changeTheme() {
const config = this.config(); const config = this.config();
const themeLink = <HTMLLinkElement>document.getElementById('theme-css'); const themeLink = document.getElementById('theme-css') as HTMLLinkElement;
const themeLinkHref = themeLink.getAttribute('href')!; const themeLinkHref = themeLink.getAttribute('href')!;
const newHref = themeLinkHref const newHref = themeLinkHref
.split('/') .split('/')
@@ -122,8 +122,8 @@ export class LayoutService {
} }
replaceThemeLink(href: string) { replaceThemeLink(href: string) {
const id = 'theme-css'; const id = 'theme-css';
let themeLink = <HTMLLinkElement>document.getElementById(id); const themeLink = document.getElementById(id) as HTMLLinkElement;
const cloneLinkElement = <HTMLLinkElement>themeLink.cloneNode(true); const cloneLinkElement = themeLink.cloneNode(true) as HTMLLinkElement;
cloneLinkElement.setAttribute('href', href); cloneLinkElement.setAttribute('href', href);
cloneLinkElement.setAttribute('id', id + '-clone'); cloneLinkElement.setAttribute('id', id + '-clone');
@@ -116,7 +116,7 @@ export class AppMenuitemComponent implements OnInit, OnDestroy {
} }
updateActiveStateFromRoute() { updateActiveStateFromRoute() {
let activeRoute = this.router.isActive(this.item.routerLink[0], { const activeRoute = this.router.isActive(this.item.routerLink[0], {
paths: 'exact', paths: 'exact',
queryParams: 'ignored', queryParams: 'ignored',
matrixParams: 'ignored', matrixParams: 'ignored',
@@ -1,5 +1,5 @@
import {CommonModule, isPlatformBrowser} from '@angular/common'; import {CommonModule, isPlatformBrowser} from '@angular/common';
import {Component, computed, inject, PLATFORM_ID} from '@angular/core'; import {Component, computed, inject, PLATFORM_ID, OnInit} from '@angular/core';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {$t, updatePreset, updateSurfacePalette} from '@primeng/themes'; import {$t, updatePreset, updateSurfacePalette} from '@primeng/themes';
import Aura from '@primeng/themes/aura'; import Aura from '@primeng/themes/aura';
@@ -14,9 +14,7 @@ import {SelectButton} from 'primeng/selectbutton';
import {ToggleSwitchModule} from 'primeng/toggleswitch'; import {ToggleSwitchModule} from 'primeng/toggleswitch';
import {AppConfigService} from '../../../core/service/app-config.service'; import {AppConfigService} from '../../../core/service/app-config.service';
interface ColorPalette { type ColorPalette = Record<string, string>;
[key: string]: string;
}
interface Palette { interface Palette {
name: string; name: string;
@@ -39,7 +37,7 @@ const presets = {
}, },
imports: [CommonModule, FormsModule, InputSwitchModule, ButtonModule, RadioButtonModule, SelectButton, ToggleSwitchModule] imports: [CommonModule, FormsModule, InputSwitchModule, ButtonModule, RadioButtonModule, SelectButton, ToggleSwitchModule]
}) })
export class ThemeConfiguratorComponent { export class ThemeConfiguratorComponent implements OnInit {
get ripple() { get ripple() {
return this.config.ripple(); return this.config.ripple();
@@ -40,8 +40,8 @@ export class MetadataPickerComponent implements OnInit {
currentBookId!: number; currentBookId!: number;
updateThumbnailUrl: boolean = false; updateThumbnailUrl: boolean = false;
thumbnailSaved: boolean = false; thumbnailSaved: boolean = false;
copiedFields: { [key: string]: boolean } = {}; copiedFields: Record<string, boolean> = {};
savedFields: { [key: string]: boolean } = {}; savedFields: Record<string, boolean> = {};
constructor(private bookService: BookService, constructor(private bookService: BookService,
private bookInfoService: BookMetadataCenterService, private bookInfoService: BookMetadataCenterService,
@@ -2,8 +2,8 @@ export interface BookMetadataBI {
bookId: number; bookId: number;
title: string; title: string;
subtitle?: string; subtitle?: string;
authors: Array<string>; authors: string[];
categories: Array<string>; categories: string[];
publisher: string; publisher: string;
publishedDate: string; publishedDate: string;
isbn10: string; isbn10: string;