From 3a4da8acc29647448a11a679fa607885a58e3459 Mon Sep 17 00:00:00 2001 From: Jason McCollum Date: Thu, 24 Aug 2023 15:35:02 -0700 Subject: [PATCH] Fix operation order to match previous implementation --- .../pre-solve-shipment-model-settings.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/frontend/src/app/core/containers/pre-solve-shipment-model-settings/pre-solve-shipment-model-settings.component.ts b/application/frontend/src/app/core/containers/pre-solve-shipment-model-settings/pre-solve-shipment-model-settings.component.ts index f1b48a07..96b13f1c 100644 --- a/application/frontend/src/app/core/containers/pre-solve-shipment-model-settings/pre-solve-shipment-model-settings.component.ts +++ b/application/frontend/src/app/core/containers/pre-solve-shipment-model-settings/pre-solve-shipment-model-settings.component.ts @@ -772,18 +772,20 @@ export class PreSolveShipmentModelSettingsComponent implements OnInit, OnDestroy } getPrecedenceRuleFirstIndexOptions(selectedIndex: number): Shipment[] { - const options = [...this.scenarioShipments$.value]; + const options = []; if (selectedIndex != null) { options.push(this.scenarioShipments$.value[selectedIndex]); } + options.push(...this.scenarioShipments$.value); return options; } getPrecendenceRuleSecondIndexOptions(firstIndex: number, selectedIndex: number): Shipment[] { - const options = [...this.scenarioShipments$.value.filter((_, i) => i !== firstIndex)]; + const options = []; if (selectedIndex != null) { options.push(this.scenarioShipments$.value[selectedIndex]); } + options.push(...this.scenarioShipments$.value.filter((_, i) => i !== firstIndex)); return options; }