]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Allow moving to next when Bidirectional mode is chosen
authorAfreen Misbah <afreen@ibm.com>
Tue, 21 Apr 2026 21:48:55 +0000 (03:18 +0530)
committerAfreen Misbah <afreen@ibm.com>
Wed, 29 Apr 2026 07:42:26 +0000 (13:12 +0530)
- there is an issue with bi-auth , where the validation is getting empty due to some state refresh
- fixed by removing re-setting of form state

Fixes https://tracker.ceph.com/issues/76194

Signed-off-by: Afreen Misbah <afreen@ibm.com>
(cherry picked from commit 2cbc270a3451dcfb47c04fc461925db0f4b9683d)

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-3/nvmeof-subsystem-step-3.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-3/nvmeof-subsystem-step-3.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-3/nvmeof-subsystem-step-3.component.ts

index 00f045c2a5017850e47682d568af70f18536868f..9ee61b903f8574b198de6ed5a5d392c526c80ff5 100644 (file)
@@ -91,6 +91,7 @@
           <p class="cds--type-label-01 text-helper"
              i18n>{{formGroup.get('authType').value === AUTHENTICATION.Bidirectional ? 'All fields are required.' : 'Optional fields.'}}</p>
         </div>
+        @if (hostDchapKeyList.controls.length) {
         @for (hostDchapKeyItem of hostDchapKeyList.controls; track $index; let i = $index) {
         <div [formGroupName]="i">
           <cds-text-label
           </cds-text-label>
         </div>
         }
+        } @else {
+        <p
+          class="cds--type-label-01 text-helper"
+          i18ns>No hosts selected.</p>
+        }
       </div>
     </div>
   </div>
index 1811c6c44456fad56d6df56be363dbf1d3e7fb97..315d7fca793f34200518a577ac4edba49d2517b3 100644 (file)
@@ -57,6 +57,19 @@ describe('NvmeofSubsystemsStepThreeComponent', () => {
     });
 
     describe('form initialization', () => {
+      beforeEach(() => {
+        fixture = TestBed.createComponent(NvmeofSubsystemsStepThreeComponent);
+        component = fixture.componentInstance;
+
+        component.stepTwoValue = {
+          hostType: 'specific',
+          addedHosts: ['nqn.2001-07.com.ceph:1776805137618']
+        } as any;
+
+        fixture.detectChanges();
+        form = component.formGroup;
+      });
+
       it('should initialize form with default values', () => {
         expect(form).toBeTruthy();
         expect(form.get('authType')?.value).toBe(AUTHENTICATION.Unidirectional);
index dc158ac8b087f1df6202d61860a198db0ec9df63..9bfc3c4c0cdf4ccb5cf704c87371928daed96361 100644 (file)
@@ -50,8 +50,6 @@ export class NvmeofSubsystemsStepThreeComponent implements OnInit, TearsheetStep
       hosts.forEach((nqn) => {
         currentList.push(this.createHostDhchapKeyFormGroup(nqn, existing.get(nqn) ?? null));
       });
-    } else {
-      currentList.push(this.createHostDhchapKeyFormGroup('', null));
     }
   }