From aebb77e6c3d18b750f1c334cd929ad1dfaea9be4 Mon Sep 17 00:00:00 2001 From: lastminutediorama Date: Fri, 20 Dec 2024 13:55:26 -0600 Subject: [PATCH] rm optional chaining --- .../create-scenarios.component.scss | 1 - .../create-scenarios.component.spec.ts | 19 +------------------ .../create-scenarios.component.ts | 6 +++--- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/interface/src/app/plan/create-scenarios/create-scenarios.component.scss b/src/interface/src/app/plan/create-scenarios/create-scenarios.component.scss index a714395d2..b7384ed75 100644 --- a/src/interface/src/app/plan/create-scenarios/create-scenarios.component.scss +++ b/src/interface/src/app/plan/create-scenarios/create-scenarios.component.scss @@ -25,7 +25,6 @@ align-items: center; height: 100%; width: 100%; - // z-index: 5; top: 0; left: 0; } diff --git a/src/interface/src/app/plan/create-scenarios/create-scenarios.component.spec.ts b/src/interface/src/app/plan/create-scenarios/create-scenarios.component.spec.ts index b363197aa..281253d05 100644 --- a/src/interface/src/app/plan/create-scenarios/create-scenarios.component.spec.ts +++ b/src/interface/src/app/plan/create-scenarios/create-scenarios.component.spec.ts @@ -6,20 +6,13 @@ import { TestBed, tick, } from '@angular/core/testing'; -// import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BehaviorSubject, of } from 'rxjs'; -import { - Scenario, - ScenarioResult, - TreatmentGoalConfig, - // TreatmentQuestionConfig, -} from '@types'; +import { Scenario, ScenarioResult, TreatmentGoalConfig } from '@types'; import { PlanModule } from '../plan.module'; import { CreateScenariosComponent } from './create-scenarios.component'; -// import { HarnessLoader } from '@angular/cdk/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { POLLING_INTERVAL } from '../plan-helpers'; import { PlanState, PlanStateService, ScenarioService } from '@services'; @@ -38,15 +31,6 @@ describe('CreateScenariosComponent', () => { let fixture: ComponentFixture; let fakePlanStateService: PlanStateService; - // let loader: HarnessLoader; - // let defaultSelectedQuestion: TreatmentQuestionConfig = { - // short_question_text: '', - // scenario_output_fields_paths: {}, - // scenario_priorities: [''], - // stand_thresholds: [''], - // global_thresholds: [''], - // weights: [0], - // }; let fakeScenario: Scenario = { id: '1', name: 'name', @@ -156,7 +140,6 @@ describe('CreateScenariosComponent', () => { fixture = TestBed.createComponent(CreateScenariosComponent); component = fixture.componentInstance; - // loader = TestbedHarnessEnvironment.loader(fixture); }); it('should create', () => { diff --git a/src/interface/src/app/plan/create-scenarios/create-scenarios.component.ts b/src/interface/src/app/plan/create-scenarios/create-scenarios.component.ts index c22d4c61f..5c337ecfe 100644 --- a/src/interface/src/app/plan/create-scenarios/create-scenarios.component.ts +++ b/src/interface/src/app/plan/create-scenarios/create-scenarios.component.ts @@ -102,8 +102,8 @@ export class CreateScenariosComponent implements OnInit { (control: AbstractControl) => scenarioNameMustBeNew(control, this.existingScenarioNames), ]), - priorities: this.prioritiesComponent?.createForm() || '', - constrains: this.constraintsPanelComponent?.createForm() || '', + priorities: this.prioritiesComponent.createForm() || '', + constrains: this.constraintsPanelComponent.createForm() || '', projectAreas: this.fb.group({ generateAreas: [''], uploadedArea: [''], @@ -221,7 +221,7 @@ export class CreateScenariosComponent implements OnInit { ); } // setting constraints - this.constraintsPanelComponent?.setFormData(scenario.configuration); + this.constraintsPanelComponent.setFormData(scenario.configuration); }, error: () => { this.scenarioNotFound = true;