From 6ee46aa2cb0fedf18c6468defa116342e8df7386 Mon Sep 17 00:00:00 2001 From: vktrrdk Date: Fri, 10 Jan 2025 16:12:33 +0000 Subject: [PATCH] adjustments of tests missing + applicationDetailComponent is undefined? --- .../application-list.component.ts | 1 - .../application-vo-actions.component.ts | 2 +- .../adjust-application.component.html | 3 - .../adjust-application.component.ts | 2 +- .../modification-request.component.html | 85 ++++++++++--------- .../modification-request.component.ts | 33 +++---- 6 files changed, 60 insertions(+), 66 deletions(-) diff --git a/src/app/applications/application-list/application-list.component.ts b/src/app/applications/application-list/application-list.component.ts index 3792311fc0..2850caf3b2 100644 --- a/src/app/applications/application-list/application-list.component.ts +++ b/src/app/applications/application-list/application-list.component.ts @@ -36,7 +36,6 @@ export class ApplicationListComponent implements OnInit, OnChanges { } setDataTestId(): void { - console.log('set data test id') switch (this.tabState) { case ApplicationTabStates.SUBMITTED: { this.dataTestId = 'submitted_applications_container' diff --git a/src/app/applications/application-vo-actions/application-vo-actions.component.ts b/src/app/applications/application-vo-actions/application-vo-actions.component.ts index 9aef00cc31..11ae1997c9 100644 --- a/src/app/applications/application-vo-actions/application-vo-actions.component.ts +++ b/src/app/applications/application-vo-actions/application-vo-actions.component.ts @@ -99,7 +99,7 @@ export class ApplicationVoActionsComponent extends AbstractBaseClass implements this.bsModalRef = this.modalService.show(ModificationRequestComponent, { initialState, - class: 'modal-lg' + class: 'modal-xl' }) this.subscribeToBsModalRef() // this.subscribeForExtensionResult(this.ExtensionRequestType.MODIFICATION); diff --git a/src/app/projectmanagement/modals/adjust-application/adjust-application.component.html b/src/app/projectmanagement/modals/adjust-application/adjust-application.component.html index b0b772fdb3..96f1e69d8e 100644 --- a/src/app/projectmanagement/modals/adjust-application/adjust-application.component.html +++ b/src/app/projectmanagement/modals/adjust-application/adjust-application.component.html @@ -1,4 +1,3 @@ - -
+
- + - + @@ -103,6 +103,7 @@
id="{{ flavor_instance.name }}" type="number" min="0" + [disabled]="adjustment" step="1" attr.data-test-id="{{ flavor_instance.type.shortcut + '_' + i }}" placeholder="e.g 1" @@ -127,6 +128,9 @@
'is-valid': name?.valid && !adjustment, }" /> +
+ VMs +
Number of VMs you would like to run in the future @@ -139,7 +143,7 @@
-
+
type="number" min="0" step="1" + [disabled]="adjustment" attr.data-test-id="{{ flavor_instance.type.shortcut + '_' + i }}" placeholder="e.g 1" [ngModel]=" @@ -180,43 +185,43 @@
+ - - + +
- 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 86b1f8ac73..4724a150b4 100644 --- a/src/app/projectmanagement/modals/modification-request/modification-request.component.ts +++ b/src/app/projectmanagement/modals/modification-request/modification-request.component.ts @@ -29,8 +29,7 @@ export class ModificationRequestComponent implements OnInit, OnDestroy { expected_total_credits: number = 0 flavorTypes: FlavorType[] = [] - shown_flavors: { [name: string]: Flavor[] } = {} - REFACTOR_flavors: ShownFlavors = {}; + shown_flavors: ShownFlavors = {}; min_vm: boolean = true min_vm_adjusted: boolean = true @@ -66,10 +65,7 @@ export class ModificationRequestComponent implements OnInit, OnDestroy { this.flavorService.getListOfTypesAvailable().subscribe((result: FlavorType[]) => { this.flavorTypes = result for (const flavorType of this.flavorTypes) { - this.shown_flavors[flavorType.long_name] = [] - } - for (const flavorType of this.flavorTypes) { - this.REFACTOR_flavors[flavorType.long_name] = {}; + this.shown_flavors[flavorType.long_name] = {}; } this.getFlavors() @@ -120,11 +116,11 @@ export class ModificationRequestComponent implements OnInit, OnDestroy { for (const flavor of flavors) { if (this.project.project_application_openstack_project || flavor.simple_vm) { - if (flavor.name in this.REFACTOR_flavors[flavor.type.long_name]) + if (flavor.name in this.shown_flavors[flavor.type.long_name]) { - this.REFACTOR_flavors[flavor.type.long_name][flavor.name].push(flavor) + this.shown_flavors[flavor.type.long_name][flavor.name].push(flavor) } else { - this.REFACTOR_flavors[flavor.type.long_name][flavor.name] = [flavor]; + this.shown_flavors[flavor.type.long_name][flavor.name] = [flavor]; } } @@ -137,14 +133,14 @@ export class ModificationRequestComponent implements OnInit, OnDestroy { } getFlavorNamesByType(type: FlavorType): string[] { - let names: string[] = Object.keys(this.REFACTOR_flavors[type.long_name]); + let names: string[] = Object.keys(this.shown_flavors[type.long_name]); return names; } checkFlavorDifferences(): void { for (const flavor of this.project.flavors) { - const idx: number = this.REFACTOR_flavors[flavor.type.long_name][flavor.name].findIndex( + const idx: number = this.shown_flavors[flavor.type.long_name][flavor.name].findIndex( (fl: Flavor): boolean => fl.name === flavor.name ) // not in shown_flavors, so flavor only for project @@ -152,19 +148,16 @@ export class ModificationRequestComponent implements OnInit, OnDestroy { const disabled_flavor: Flavor = new Flavor(flavor) disabled_flavor.setDisabled(true) const mod_flavor: Flavor = new Flavor(flavor) - this.REFACTOR_flavors[mod_flavor.type.long_name][mod_flavor.name].push(mod_flavor); - this.REFACTOR_flavors[disabled_flavor.type.long_name][disabled_flavor.name].push(disabled_flavor) + this.shown_flavors[mod_flavor.type.long_name][mod_flavor.name].push(mod_flavor); + this.shown_flavors[disabled_flavor.type.long_name][disabled_flavor.name].push(disabled_flavor) this.temp_project_modification.flavors.push(mod_flavor) } else { // else in shown_flavors, may be different than old one - this.REFACTOR_flavors[flavor.type.long_name][flavor.name][idx].counter = flavor.counter; - const mod_flavor: Flavor = new Flavor(this.shown_flavors[flavor.type.long_name][idx]) + this.shown_flavors[flavor.type.long_name][flavor.name][idx].counter = flavor.counter; + const mod_flavor: Flavor = new Flavor(this.shown_flavors[flavor.type.long_name][flavor.name][idx]) this.temp_project_modification.flavors.push(mod_flavor) - this.REFACTOR_flavors[mod_flavor.type.long_name][mod_flavor.name].splice(idx, 0, mod_flavor) - this.REFACTOR_flavors[mod_flavor.type.long_name][mod_flavor.name][idx].setDisabled(true); - this.shown_flavors[flavor.type.long_name].splice(idx, 0, flavor) - this.shown_flavors[flavor.type.long_name][idx].setDisabled(true) - console.log(this.REFACTOR_flavors); + this.shown_flavors[mod_flavor.type.long_name][mod_flavor.name].splice(idx, 0, mod_flavor) + this.shown_flavors[mod_flavor.type.long_name][mod_flavor.name][idx].setDisabled(true); } } this.temp_project_modification.calculateRamCores()