From 14a8cbf3da192642d3dd925f4ab83780df520f40 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Thu, 15 Aug 2024 10:29:52 +0200 Subject: [PATCH] fixed linting --- src/app/api-connector/credits.service.ts | 10 +++++----- .../modification-request.component.ts | 2 +- src/app/projectmanagement/overview.component.ts | 13 +++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/app/api-connector/credits.service.ts b/src/app/api-connector/credits.service.ts index 352b5c1236..d89ea521c6 100644 --- a/src/app/api-connector/credits.service.ts +++ b/src/app/api-connector/credits.service.ts @@ -113,7 +113,7 @@ export class CreditsService { * * @param group_id */ - public getCreditsUsageHistoryOfProject(group_id: number): Observable<{}> { + public getCreditsUsageHistoryOfProject(group_id: number): Observable { return this.http.get(`${ApiSettings.getApiBaseURL()}creditManager/${group_id}/getCreditsHistory/`, { withCredentials: true, }); @@ -124,8 +124,8 @@ export class CreditsService { flavor_pairs: [string, number][], compute_center_name: string, start_timestamp: number, - ): Observable<{}> { - const params: {} = { + ): Observable { + const params: object = { hours, flavor_pairs, compute_center_name, @@ -142,8 +142,8 @@ export class CreditsService { flavor_pairs: [string, number][], compute_center_name: string, start_timestamp: number, - ): Observable<{}> { - const params: {} = { + ): Observable { + const params: object = { credits, flavor_pairs, compute_center_name, diff --git a/src/app/projectmanagement/modals/modification-request/modification-request.component.ts b/src/app/projectmanagement/modals/modification-request/modification-request.component.ts index 4f672b71bb..e660635815 100644 --- a/src/app/projectmanagement/modals/modification-request/modification-request.component.ts +++ b/src/app/projectmanagement/modals/modification-request/modification-request.component.ts @@ -272,7 +272,7 @@ export class ModificationRequestComponent implements OnInit, OnDestroy { } showSubmitModal(adjustment: boolean): void { - let initialState: {}; + let initialState: object; if (adjustment) { initialState = { project: this.project, diff --git a/src/app/projectmanagement/overview.component.ts b/src/app/projectmanagement/overview.component.ts index 9940b0ce07..7e1bc94799 100644 --- a/src/app/projectmanagement/overview.component.ts +++ b/src/app/projectmanagement/overview.component.ts @@ -9,7 +9,8 @@ import { ViewChild, inject, } from '@angular/core'; -import moment from 'moment'; import { forkJoin, Observable, Subscription } from 'rxjs'; +import moment from 'moment'; +import { forkJoin, Observable, Subscription } from 'rxjs'; import { ActivatedRoute, Router } from '@angular/router'; import { DOCUMENT } from '@angular/common'; import { Chart } from 'chart.js'; @@ -178,8 +179,8 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements this.creditHistoryLoaded = false; this.creditsChart = undefined; } - } catch (someError) { - // empty catch + } catch (error: Error) { + console.log(error); } this.subscription.unsubscribe(); @@ -217,8 +218,8 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements if (this.updateCreditsHistoryIntervals) { clearInterval(this.updateCreditsHistoryIntervals); } - } catch (someError) { - // empty catch + } catch (error: Error) { + console.log(error); } } @@ -440,7 +441,7 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements this.subscription.add( this.creditsService .getCreditsUsageHistoryOfProject(Number(this.project_application.project_application_perun_id.toString())) - .subscribe((response: {}): void => { + .subscribe((response: any): void => { if (response['data_points'] !== undefined) { const data_points: number[] = response['data_points']; if (this.creditsChart !== undefined) {