From 87b433e9c77b73ed298606047ff428b0b4327014 Mon Sep 17 00:00:00 2001 From: RehanY147 Date: Sat, 30 Nov 2024 04:22:17 +0500 Subject: [PATCH] NAS-128390: Adjust child selection options --- .../draid-selection/draid-selection.component.spec.ts | 4 ++-- .../draid-selection/draid-selection.component.ts | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.spec.ts index d9a5edf290c..83ec46c1bfb 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.spec.ts @@ -109,7 +109,7 @@ describe('DraidSelectionComponent', () => { expect(await spares.getValue()).toBe('0'); const children = await form.getControl('Children') as IxSelectHarness; - expect(await children.getOptionLabels()).toEqual(['4', '5']); + expect(await children.getOptionLabels()).toEqual(['3', '4', '5']); }); it('updates Children when Spares are selected', async () => { @@ -122,7 +122,7 @@ describe('DraidSelectionComponent', () => { ); const children = await form.getControl('Children') as IxSelectHarness; - expect(await children.getOptionLabels()).toEqual(['5']); + expect(await children.getOptionLabels()).toEqual(['4', '5']); }); it('defaults Children to optimal number, but only once', async () => { diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.ts index 3dd842f947a..c410530b605 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/components/layout-step/automated-disk-selection/draid-selection/draid-selection.component.ts @@ -193,11 +193,10 @@ export class DraidSelectionComponent implements OnInit, OnChanges { let nextOptions: Option[] = []; if ((groupSize + hotSpares) <= maxPossibleWidth && dataDevices) { - nextOptions = _.range(groupSize + hotSpares, maxPossibleWidth).map((item) => { - const disks = item + 1; + nextOptions = _.range(groupSize + hotSpares, maxPossibleWidth + 1).map((noOfChildren) => { return { - label: String(disks), - value: disks, + label: String(noOfChildren), + value: noOfChildren, }; }); }