diff --git a/.husky/pre-commit b/.husky/pre-commit index 0cd82b6522..210877eeae 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,3 @@ -yarn \ No newline at end of file +#!/bin/sh + +npx lint-staged \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cb47763483..a4053839c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,7 +82,7 @@ "@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/parser": "^8.0.0", "async": "3.2.5", - "audit-ci": "6.6.1", + "audit-ci": "7.1.0", "autoprefixer": "10.4.20", "eslint": "^8.57.0", "eslint-config-airbnb-base": "15.0.0", @@ -6833,25 +6833,27 @@ } }, "node_modules/audit-ci": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/audit-ci/-/audit-ci-6.6.1.tgz", - "integrity": "sha512-zqZEoYfEC4QwX5yBkDNa0h7YhZC63HWtKtP19BVq+RS0dxRBInfmHogxe4VUeOzoADQjuTLZUI7zp3Pjyl+a5g==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/audit-ci/-/audit-ci-7.1.0.tgz", + "integrity": "sha512-PjjEejlST57S/aDbeWLic0glJ8CNl/ekY3kfGFPMrPkmuaYaDKcMH0F9x9yS9Vp6URhuefSCubl/G0Y2r6oP0g==", "dev": true, + "license": "Apache-2.0", "dependencies": { "cross-spawn": "^7.0.3", "escape-string-regexp": "^4.0.0", "event-stream": "4.0.1", "jju": "^1.4.0", - "JSONStream": "^1.3.5", + "jsonstream-next": "^3.0.0", "readline-transform": "1.0.0", "semver": "^7.0.0", + "tslib": "^2.0.0", "yargs": "^17.0.0" }, "bin": { "audit-ci": "dist/bin.js" }, "engines": { - "node": ">=12.9.0" + "node": ">=16" } }, "node_modules/audit-ci/node_modules/escape-string-regexp": { @@ -6859,6 +6861,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -12497,20 +12500,21 @@ "node >= 0.2.0" ] }, - "node_modules/JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "node_modules/jsonstream-next": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonstream-next/-/jsonstream-next-3.0.0.tgz", + "integrity": "sha512-aAi6oPhdt7BKyQn1SrIIGZBt0ukKuOUE1qV6kJ3GgioSOYzsRc8z9Hfr1BVmacA/jLe9nARfmgMGgn68BqIAgg==", "dev": true, + "license": "(MIT OR Apache-2.0)", "dependencies": { "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" + "through2": "^4.0.2" }, "bin": { - "JSONStream": "bin.js" + "jsonstream-next": "bin.js" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/jspdf": { @@ -18328,6 +18332,16 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "3" + } + }, "node_modules/thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", diff --git a/package.json b/package.json index fca477e26a..edd4217dda 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/parser": "^8.0.0", "async": "3.2.5", - "audit-ci": "6.6.1", + "audit-ci": "7.1.0", "autoprefixer": "10.4.20", "eslint": "^8.57.0", "eslint-config-airbnb-base": "15.0.0", 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/applications/application-detail/resource-detail/resource-detail.component.html b/src/app/applications/application-detail/resource-detail/resource-detail.component.html index 2f1d6a30fc..b4930f88f9 100644 --- a/src/app/applications/application-detail/resource-detail/resource-detail.component.html +++ b/src/app/applications/application-detail/resource-detail/resource-detail.component.html @@ -71,7 +71,7 @@ color: application.project_modification_request.vms_requested >= application.project_application_vms_requested ? 'green' - : 'red' + : 'red', }" > {{ @@ -101,7 +101,7 @@ {{ flavorDiff.diff === 0 ? '' : flavorDiff.diff > 0 ? '+' : '-' }} @@ -124,7 +124,7 @@ color: application.project_modification_request.total_cores >= application.project_application_total_cores ? 'green' - : 'red' + : 'red', }" > {{ @@ -155,7 +155,7 @@ color: application.project_modification_request.total_ram >= application.project_application_total_ram ? 'green' - : 'red' + : 'red', }" > {{ @@ -183,7 +183,7 @@ color: application.project_modification_request.total_gpu >= application.project_application_total_gpu ? 'green' - : 'red' + : 'red', }" > {{ @@ -210,7 +210,7 @@ + {{ application.project_modification_request.extra_credits }} @@ -241,7 +241,7 @@ color: application.project_modification_request.volume_limit >= application.project_application_volume_limit ? 'green' - : 'red' + : 'red', }" > {{ @@ -272,7 +272,7 @@ application.project_modification_request.volume_counter >= application.project_application_volume_counter ? 'green' - : 'red' + : 'red', }" > {{ @@ -304,7 +304,7 @@ application.project_modification_request.object_storage >= application.project_application_object_storage ? 'green' - : 'red' + : 'red', }" > {{ diff --git a/src/app/applications/application-detail/resource-detail/resource-detail.component.ts b/src/app/applications/application-detail/resource-detail/resource-detail.component.ts index 39b6078612..1c0b6e4a3a 100644 --- a/src/app/applications/application-detail/resource-detail/resource-detail.component.ts +++ b/src/app/applications/application-detail/resource-detail/resource-detail.component.ts @@ -1,5 +1,4 @@ import { Component, Input, OnInit } from '@angular/core'; -import { green } from 'audit-ci/dist/colors'; import { Application } from '../../application.model/application.model'; import { User } from '../../application.model/user.model'; import { ApplicationBaseClassComponent } from '../../../shared/shared_modules/baseClass/application-base-class.component'; @@ -24,7 +23,6 @@ export class ResourceDetailComponent extends ApplicationBaseClassComponent imple @Input() is_vo_admin: boolean; @Input() current_credits: number; protected readonly Math = Math; - protected readonly green = green; flavorDiffs: FlavorDiff[] = []; ngOnInit() { 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..b1995bc1a1 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: any) { + 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: any) { + 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) { @@ -517,7 +518,7 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements this.project_application.project_application_current_credits = credits; } }, - (err: Error): void => { + (err: any): void => { console.log(err.message); }, ), diff --git a/src/app/virtualmachines/clusters/cluster-actions/cluster-actions.component.ts b/src/app/virtualmachines/clusters/cluster-actions/cluster-actions.component.ts index 7c49875c4b..4e09071fb7 100644 --- a/src/app/virtualmachines/clusters/cluster-actions/cluster-actions.component.ts +++ b/src/app/virtualmachines/clusters/cluster-actions/cluster-actions.component.ts @@ -126,7 +126,7 @@ export class ClusterActionsComponent implements OnDestroy { this.cluster.status = VirtualMachineStates.POWERING_OFF; this.subscription.add( this.virtualmachineservice.stopCluster(this.cluster.cluster_id).subscribe((): void => { - this.cluster.status === VirtualMachineStates.POWERING_OFF; + this.cluster.status = VirtualMachineStates.POWERING_OFF; this.startStatusLoop.emit(); }), );