Skip to content

Commit

Permalink
Merge branch 'dev' into deps/major-eslint-monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz authored Aug 15, 2024
2 parents 5c95ace + cc6c0ea commit 3558eec
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 40 deletions.
4 changes: 3 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
yarn
#!/bin/sh

npx lint-staged
40 changes: 27 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "^9.0.0",
"eslint-config-airbnb-base": "15.0.0",
Expand Down
10 changes: 5 additions & 5 deletions src/app/api-connector/credits.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class CreditsService {
*
* @param group_id
*/
public getCreditsUsageHistoryOfProject(group_id: number): Observable<{}> {
public getCreditsUsageHistoryOfProject(group_id: number): Observable<object> {
return this.http.get(`${ApiSettings.getApiBaseURL()}creditManager/${group_id}/getCreditsHistory/`, {
withCredentials: true,
});
Expand All @@ -124,8 +124,8 @@ export class CreditsService {
flavor_pairs: [string, number][],
compute_center_name: string,
start_timestamp: number,
): Observable<{}> {
const params: {} = {
): Observable<object> {
const params: object = {
hours,
flavor_pairs,
compute_center_name,
Expand All @@ -142,8 +142,8 @@ export class CreditsService {
flavor_pairs: [string, number][],
compute_center_name: string,
start_timestamp: number,
): Observable<{}> {
const params: {} = {
): Observable<object> {
const params: object = {
credits,
flavor_pairs,
compute_center_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
color:
application.project_modification_request.vms_requested >= application.project_application_vms_requested
? 'green'
: 'red'
: 'red',
}"
>
{{
Expand Down Expand Up @@ -101,7 +101,7 @@
<td>
<span
[ngStyle]="{
color: flavorDiff.diff >= 0 ? 'green' : 'red'
color: flavorDiff.diff >= 0 ? 'green' : 'red',
}"
>
{{ flavorDiff.diff === 0 ? '' : flavorDiff.diff > 0 ? '+' : '-' }}
Expand All @@ -124,7 +124,7 @@
color:
application.project_modification_request.total_cores >= application.project_application_total_cores
? 'green'
: 'red'
: 'red',
}"
>
{{
Expand Down Expand Up @@ -155,7 +155,7 @@
color:
application.project_modification_request.total_ram >= application.project_application_total_ram
? 'green'
: 'red'
: 'red',
}"
>
{{
Expand Down Expand Up @@ -183,7 +183,7 @@
color:
application.project_modification_request.total_gpu >= application.project_application_total_gpu
? 'green'
: 'red'
: 'red',
}"
>
{{
Expand All @@ -210,7 +210,7 @@
<td>
<span
[ngStyle]="{
color: green
color: 'green',
}"
>
+ {{ application.project_modification_request.extra_credits }}
Expand Down Expand Up @@ -241,7 +241,7 @@
color:
application.project_modification_request.volume_limit >= application.project_application_volume_limit
? 'green'
: 'red'
: 'red',
}"
>
{{
Expand Down Expand Up @@ -272,7 +272,7 @@
application.project_modification_request.volume_counter >=
application.project_application_volume_counter
? 'green'
: 'red'
: 'red',
}"
>
{{
Expand Down Expand Up @@ -304,7 +304,7 @@
application.project_modification_request.object_storage >=
application.project_application_object_storage
? 'green'
: 'red'
: 'red',
}"
>
{{
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 8 additions & 7 deletions src/app/projectmanagement/overview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}),
);
Expand Down

0 comments on commit 3558eec

Please sign in to comment.