diff --git a/src/app/shared/shared_modules/baseClass/application-base-class.component.ts b/src/app/shared/shared_modules/baseClass/application-base-class.component.ts index 55fc87ad99..4d488be035 100644 --- a/src/app/shared/shared_modules/baseClass/application-base-class.component.ts +++ b/src/app/shared/shared_modules/baseClass/application-base-class.component.ts @@ -9,7 +9,6 @@ import { FlavorService } from '../../../api-connector/flavor.service'; import { FacilityService } from '../../../api-connector/facility.service'; import { UserService } from '../../../api-connector/user.service'; import { FlavorTypeShortcuts } from './flavor-type-shortcuts'; -import { VolumeActionStates } from '../../../virtualmachines/volumes/volume-action-states.enum'; /** * Application base component.. @@ -21,54 +20,54 @@ import { VolumeActionStates } from '../../../virtualmachines/volumes/volume-acti }) export class ApplicationBaseClassComponent extends AbstractBaseClass { /** - * If all Applications are loaded, important for the loader. - * - * @type {boolean} - */ + * If all Applications are loaded, important for the loader. + * + * @type {boolean} + */ isLoaded: boolean = false; FlavorTypeShortcuts: typeof FlavorTypeShortcuts = FlavorTypeShortcuts; /** - * Selected Application. - */ + * Selected Application. + */ selectedApplication: Application; /** - * All available compute centers. - * - * @type {Array} - */ + * All available compute centers. + * + * @type {Array} + */ computeCenters: ComputecenterComponent[] = []; /** - * List of flavor types. - */ + * List of flavor types. + */ typeList: FlavorType[]; /** - * Total number of cores. - * - * @type {number} - */ + * Total number of cores. + * + * @type {number} + */ totalNumberOfCores: number = 0; /** - * Total number of ram. - * - * @type {number} - */ + * Total number of ram. + * + * @type {number} + */ totalRAM: number = 0; /** - * Total number of GPUs - */ + * Total number of GPUs + */ totalGPU: number = 0; newFlavors: { - [id: string]: { - counter: number - flavor: Flavor - } - } = {}; + [id: string]: { + counter: number + flavor: Flavor + } + } = {}; GPU_SHORTCUT = 'GPU'; HMF_SHORTCUT = 'HMF'; @@ -76,57 +75,57 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { extension_request: boolean = false; /** - * If shortname is valid. - * - * @type {boolean} - */ + * If shortname is valid. + * + * @type {boolean} + */ public wronginput: boolean = false; /** - * - */ + * + */ constantStrings: Object; /** - * List of flavors. - */ + * List of flavors. + */ flavorList: Flavor[] = []; extraResourceCommentRequired: boolean = false; /** - * If all userApplications are loaded, important for the loader. - * - * @type {boolean} - */ + * If all userApplications are loaded, important for the loader. + * + * @type {boolean} + */ isLoaded_userApplication: boolean = false; public project_application_pi_approved: boolean = false; /** - * Name of the project. - */ + * Name of the project. + */ public projectName: string; public project_application_report_allowed: boolean = false; /** - * Applications of the user viewing the Application overview. - * - * @type {Array} - */ + * Applications of the user viewing the Application overview. + * + * @type {Array} + */ user_applications: Application[] = []; constructor( - protected userService: UserService, - protected applicationsService: ApplicationsService, - protected facilityService: FacilityService, - private cdRef: ChangeDetectorRef, + protected userService: UserService, + protected applicationsService: ApplicationsService, + protected facilityService: FacilityService, + private cdRef: ChangeDetectorRef, ) { super(); } /** - * Gets all available compute centers and saves them in the computeCenters attribute. - */ + * Gets all available compute centers and saves them in the computeCenters attribute. + */ getComputeCenters(): void { this.facilityService.getComputeCenters().subscribe((result: [{ [key: string]: string }]): void => { for (const cc of result) { @@ -162,8 +161,8 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { if ( (entry?.flavor?.type?.shortcut.toUpperCase() === this.GPU_SHORTCUT - || entry?.flavor?.type?.shortcut.toUpperCase() === this.HMF_SHORTCUT) - && entry.counter > 0 + || entry?.flavor?.type?.shortcut.toUpperCase() === this.HMF_SHORTCUT) + && entry.counter > 0 ) { this.extraResourceCommentRequired = true; this.cdRef.detectChanges(); @@ -189,11 +188,11 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { } /** - * Get details of member like name and email by elixir. - * - * @param application - * @param collapse_id - */ + * Get details of member like name and email by elixir. + * + * @param application + * @param collapse_id + */ public getMemberDetailsByElixirIdIfCollapsed(application: Application, collapse_id: string): void { if (!this.getCollapseStatus(collapse_id)) { this.getMemberDetailsByElixirId(application); @@ -214,11 +213,11 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { } /** - * Get status name by status id. - * - * @param id - * @returns - */ + * Get status name by status id. + * + * @param id + * @returns + */ public getStatusById(id: number): string { const dummy: string = 'Unknown'; if (Application_States_Strings[Application_States[id]]) { @@ -229,20 +228,20 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { } /** - * Sets the selected application. - * - * @param application - */ + * Sets the selected application. + * + * @param application + */ setSelectedApplication(application: Application): void { this.selectedApplication = application; } /** - * Uses the param types to safe the available FlavorTypes to the array typeList. - * Also it fills the array collapseList with booleans of value 'false' so all flavor-categories are shown in the application form. - * - * @param types array of all available FlavorTypes - */ + * Uses the param types to safe the available FlavorTypes to the array typeList. + * Also it fills the array collapseList with booleans of value 'false' so all flavor-categories are shown in the application form. + * + * @param types array of all available FlavorTypes + */ setListOfTypes(types: FlavorType[]): void { let index: number = -1; for (let i: number = 0; i < types.length; i += 1) { @@ -261,17 +260,17 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { } /** - * Check if short name is valid. - * - * @param shortname - */ + * Check if short name is valid. + * + * @param shortname + */ public checkShortname(shortname: string): void { this.wronginput = !/^[a-zA-Z0-9\s]*$/.test(shortname); } /** - * Fills the array constantStrings with values dependent of keys which are used to indicate inputs from the application-form - */ + * Fills the array constantStrings with values dependent of keys which are used to indicate inputs from the application-form + */ generateConstants(): void { this.constantStrings = []; this.constantStrings['project_application_shortname'] = 'Shortname: '; @@ -308,13 +307,13 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { } /** - * This function concatenates a given key combined with a given value to a string - * which is used on the confirmation-modal. - * - * @param key the key to access a string in the array constantStrings - * @param val the value that is concatenated with the string from the array and an optional addition (depending on the key) - * @returns the concatenated string for the confirmation-modal - */ + * This function concatenates a given key combined with a given value to a string + * which is used on the confirmation-modal. + * + * @param key the key to access a string in the array constantStrings + * @param val the value that is concatenated with the string from the array and an optional addition (depending on the key) + * @returns the concatenated string for the confirmation-modal + */ matchString(key: string, val: string): string { if (key in this.constantStrings) { switch (key) {