Skip to content

Commit

Permalink
Fix operation order to match previous implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccollum-woolpert committed Aug 24, 2023
1 parent b05478d commit 3a4da8a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3a4da8a

Please sign in to comment.