Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated TsLint Linting [refs/heads/deps/major-angular-eslint-monorepo] #6276

Open
wants to merge 2 commits into
base: deps/major-angular-eslint-monorepo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
282 changes: 228 additions & 54 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@denbi/cloud-portal-webapp",
"version": "4.900.0",
"version": "4.901.0",
"description": "de.NBI Cloud Portal",
"scripts": {
"ng": "ng serve",
Expand All @@ -18,7 +18,7 @@
"resolutions": {},
"private": true,
"dependencies": {
"@angular-eslint/eslint-plugin": "^18.3.0",
"@angular-eslint/eslint-plugin": "^19.0.0",
"@angular/animations": "18.2.8",
"@angular/cdk": "18.2.9",
"@angular/common": "18.2.8",
Expand Down Expand Up @@ -79,10 +79,10 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.7",
"@angular-eslint/builder": "18.3.1",
"@angular-eslint/eslint-plugin-template": "18.3.1",
"@angular-eslint/schematics": "18.3.1",
"@angular-eslint/template-parser": "18.3.1",
"@angular-eslint/builder": "19.0.2",
"@angular-eslint/eslint-plugin-template": "19.0.2",
"@angular-eslint/schematics": "19.0.2",
"@angular-eslint/template-parser": "19.0.2",
"@angular/cli": "^18.1.4",
"@angular/compiler-cli": "18.2.8",
"@eslint/eslintrc": "^3.1.0",
Expand Down
13 changes: 6 additions & 7 deletions src/app/api-connector/applications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,15 @@ export class ApplicationsService {
})
}

checkForTakenShortname(shortname: string,exclude_project_id?:string|number): Observable<any> {

let params:any={ shortname: shortname }
if (exclude_project_id){
params={ shortname: shortname ,exclude_project_id:exclude_project_id}
checkForTakenShortname(shortname: string, exclude_project_id?: string | number): Observable<any> {
let params: any = { shortname: shortname }
if (exclude_project_id) {
params = { shortname: shortname, exclude_project_id: exclude_project_id }
}

return this.http.get(`${ApiSettings.getApiBaseURL()}project_applications/shortname/`, {
params: params,
withCredentials: true
});

})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import { UserService } from '../../api-connector/user.service'
import { Userinfo } from '../../userinfo/userinfo.model'
import { User } from '../application.model/user.model'
import { NotificationModalComponent } from '../../shared/modal/notification-modal'
import { Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { Subject } from 'rxjs'
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'

/**
* Application formular component.
Expand All @@ -53,8 +53,8 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent
@Input() application: Application
@Input() is_validation: boolean = false
@Input() hash: string
DEFAULT_SHORTNAME_MAX_LENGTH:number=15
shortNameMaxLength:number=15
DEFAULT_SHORTNAME_MAX_LENGTH: number = 15
shortNameMaxLength: number = 15

userinfo: Userinfo
valid_pi_affiliations
Expand Down Expand Up @@ -91,9 +91,9 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent
WIKI_BACKUP_LINK: string = WIKI_BACKUP_LINK
GDPR_LINK: string = GDPR_LINK
survey_link_visible: boolean = false
private nameCheckPipe = new Subject<string>();
shortnameChecking: boolean = false;
shortNameTaken: boolean = false;
private nameCheckPipe = new Subject<string>()
shortnameChecking: boolean = false
shortNameTaken: boolean = false

MAX_LIFETIME_DEFAULT: number = 6
max_lifetime: number = this.MAX_LIFETIME_DEFAULT
Expand Down Expand Up @@ -126,7 +126,9 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent
this.getListOfFlavors()
this.getListOfTypes()
this.is_vo_admin = is_vo
this.nameCheckPipe.pipe(debounceTime(600), distinctUntilChanged()).subscribe(value => {this.checkIfNameIsTaken(value)});
this.nameCheckPipe.pipe(debounceTime(600), distinctUntilChanged()).subscribe(value => {
this.checkIfNameIsTaken(value)
})

if (this.openstack_project) {
this.simple_vm_min_vm = true
Expand All @@ -146,19 +148,20 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent
}
}

setDefaulShortnameLength():void{
this.shortNameMaxLength=this.DEFAULT_SHORTNAME_MAX_LENGTH
setDefaulShortnameLength(): void {
this.shortNameMaxLength = this.DEFAULT_SHORTNAME_MAX_LENGTH
}

checkIfNameIsTaken(shortname: string): void {
this.shortnameChecking = true;

this.applicationsService.checkForTakenShortname(shortname,this.application?.project_application_id).subscribe((result: boolean): void => {
let nameExists: boolean = result['exists'];
this.shortnameChecking = false;
this.shortNameTaken = nameExists;
});

this.shortnameChecking = true

this.applicationsService
.checkForTakenShortname(shortname, this.application?.project_application_id)
.subscribe((result: boolean): void => {
const nameExists: boolean = result['exists']
this.shortnameChecking = false
this.shortNameTaken = nameExists
})
}

checkValidityComment(): boolean {
Expand Down Expand Up @@ -196,8 +199,8 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent
if (this.application && !this.initiated_validation && this.is_validation) {
this.openstack_project = this.application.project_application_openstack_project

if(this.application.project_application_shortname.length > 15){
this.shortNameMaxLength=this.application.project_application_shortname.length
if (this.application.project_application_shortname.length > 15) {
this.shortNameMaxLength = this.application.project_application_shortname.length
}

this.simple_vm_project = !this.openstack_project
Expand Down Expand Up @@ -266,10 +269,9 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent
public checkShortname(shortname: string): void {
this.invalid_shortname = !/^[a-zA-Z0-9\s]*$/.test(shortname)
if (!this.invalid_shortname) {
this.shortnameChecking = true;
this.nameCheckPipe.next(shortname);
this.shortnameChecking = true
this.nameCheckPipe.next(shortname)
}

}

public checkLongname(longname: string): void {
Expand Down
78 changes: 39 additions & 39 deletions src/app/facility_manager/resources/resource-machine.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
import { ComputecenterComponent } from '../../projectmanagement/computecenter.component';
import { GPUSpecification } from './gpu-specification';
import { ComputecenterComponent } from '../../projectmanagement/computecenter.component'
import { GPUSpecification } from './gpu-specification'

/**
* ResourceMachine class.
*/

export class ResourceMachine {
id: string;
compute_center: ComputecenterComponent;
name: string;
ram_public_factor: number = 1;
ram_private_factor: number = 1;
cores: number = 0;
cores_private_factor: number = 1;
cores_public_factor: number = 1;
gpu_slots: number = 0;
gpu_used: GPUSpecification[] = [];
public_count: number = 0;
private_count: number = 0;
ram: number = 0;
type: string = 'GENERAL_PURPOSE';
local_disk_storage: number = 0;
local_disk_encrypted: boolean = false;
id: string
compute_center: ComputecenterComponent
name: string
ram_public_factor: number = 1
ram_private_factor: number = 1
cores: number = 0
cores_private_factor: number = 1
cores_public_factor: number = 1
gpu_slots: number = 0
gpu_used: GPUSpecification[] = []
public_count: number = 0
private_count: number = 0
ram: number = 0
type: string = 'GENERAL_PURPOSE'
local_disk_storage: number = 0
local_disk_encrypted: boolean = false

constructor(resourceMachine: ResourceMachine | null) {
if (resourceMachine) {
this.id = resourceMachine.id;
this.compute_center = resourceMachine.compute_center;
this.name = resourceMachine.name;
// eslint-disable-next-line no-multi-assign,no-param-reassign
this.ram_public_factor = resourceMachine.ram_public_factor = 1;
// eslint-disable-next-line no-multi-assign,no-param-reassign
this.ram_private_factor = resourceMachine.ram_private_factor = 1;
this.cores = resourceMachine.cores;
this.local_disk_storage = resourceMachine.local_disk_storage;
this.local_disk_encrypted = resourceMachine.local_disk_encrypted;
this.cores_private_factor = resourceMachine.cores_private_factor;
this.cores_public_factor = resourceMachine.cores_public_factor;
this.gpu_slots = resourceMachine.gpu_slots;
this.gpu_used = resourceMachine.gpu_used;
this.public_count = resourceMachine.public_count;
this.private_count = resourceMachine.private_count;
this.ram = resourceMachine.ram;
this.type = resourceMachine.type;
this.id = resourceMachine.id
this.compute_center = resourceMachine.compute_center
this.name = resourceMachine.name

this.ram_public_factor = resourceMachine.ram_public_factor = 1

this.ram_private_factor = resourceMachine.ram_private_factor = 1
this.cores = resourceMachine.cores
this.local_disk_storage = resourceMachine.local_disk_storage
this.local_disk_encrypted = resourceMachine.local_disk_encrypted
this.cores_private_factor = resourceMachine.cores_private_factor
this.cores_public_factor = resourceMachine.cores_public_factor
this.gpu_slots = resourceMachine.gpu_slots
this.gpu_used = resourceMachine.gpu_used
this.public_count = resourceMachine.public_count
this.private_count = resourceMachine.private_count
this.ram = resourceMachine.ram
this.type = resourceMachine.type
if (this.gpu_used.length < this.gpu_slots) {
while (this.gpu_used.length < this.gpu_slots) {
this.gpu_used.push(new GPUSpecification(null));
this.gpu_used.push(new GPUSpecification(null))
}
}
}
}

changeGpuUsed(): void {
if (this.gpu_slots < this.gpu_used.length) {
this.gpu_used = this.gpu_used.slice(0, this.gpu_slots);
this.gpu_used = this.gpu_used.slice(0, this.gpu_slots)
} else {
while (this.gpu_slots > this.gpu_used.length) {
this.gpu_used.push(new GPUSpecification(null));
this.gpu_used.push(new GPUSpecification(null))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { GeneratePublicKeyModalComponent } from './generate-public-key-modal.component';
import { GeneratePublicKeyModalComponent } from './generate-public-key-modal.component'

describe('GeneratePublicKeyModalComponent', () => {
let component: GeneratePublicKeyModalComponent;
let fixture: ComponentFixture<GeneratePublicKeyModalComponent>;
let component: GeneratePublicKeyModalComponent
let fixture: ComponentFixture<GeneratePublicKeyModalComponent>

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [GeneratePublicKeyModalComponent]
})
.compileComponents();
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [GeneratePublicKeyModalComponent]
}).compileComponents()

fixture = TestBed.createComponent(GeneratePublicKeyModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
fixture = TestBed.createComponent(GeneratePublicKeyModalComponent)
component = fixture.componentInstance
fixture.detectChanges()
})

it('should create', () => {
expect(component).toBeTruthy();
});
});
it('should create', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
import { Component, EventEmitter, Injectable } from '@angular/core';
import { KeyService } from 'app/api-connector/key.service';
import { AbstractBaseModalComponent } from 'app/shared/modal/abstract-base-modal/abstract-base-modal.component';
import { BsModalService } from 'ngx-bootstrap/modal';
import { Component, EventEmitter, Injectable } from '@angular/core'
import { KeyService } from 'app/api-connector/key.service'
import { AbstractBaseModalComponent } from 'app/shared/modal/abstract-base-modal/abstract-base-modal.component'
import { BsModalService } from 'ngx-bootstrap/modal'
import { saveAs } from 'file-saver'

@Injectable({ providedIn: 'root' })
@Component({
selector: 'app-generate-public-key-modal',
templateUrl: './generate-public-key-modal.component.html',
styleUrl: './generate-public-key-modal.component.scss'
selector: 'app-generate-public-key-modal',
templateUrl: './generate-public-key-modal.component.html',
styleUrl: './generate-public-key-modal.component.scss'
})
export class GeneratePublicKeyModalComponent extends AbstractBaseModalComponent {
userlogin:string;
acknowledgement_given:boolean=false
userlogin: string
acknowledgement_given: boolean = false

constructor(
constructor(
protected modalService: BsModalService,
private keyService:KeyService
) {
super(modalService)

}
showGeneratePublicKeyModal(
userlogin:string

): EventEmitter<void> {
const initialState = {
userlogin
}

return this.showBaseModal(GeneratePublicKeyModalComponent, initialState)
private keyService: KeyService
) {
super(modalService)
}
showGeneratePublicKeyModal(userlogin: string): EventEmitter<void> {
const initialState = {
userlogin
}

downloadPem(data: string): void {
const blob: Blob = new Blob([data], { type: 'pem' })
const url: string = window.URL.createObjectURL(blob)
saveAs(url, `${this.userlogin}_ecdsa`)
}


generateKey(): void {
this.keyService.generateKey().subscribe((res: any): void => {
this.event.emit()
this.downloadPem(res['private_key'])
})
}
return this.showBaseModal(GeneratePublicKeyModalComponent, initialState)
}

downloadPem(data: string): void {
const blob: Blob = new Blob([data], { type: 'pem' })
const url: string = window.URL.createObjectURL(blob)
saveAs(url, `${this.userlogin}_ecdsa`)
}

generateKey(): void {
this.keyService.generateKey().subscribe((res: any): void => {
this.event.emit()
this.downloadPem(res['private_key'])
})
}
}
Loading