From 2f7c08e34ed31cac9516ce726fec8c30d2451d8a Mon Sep 17 00:00:00 2001 From: Avan Thakkar Date: Mon, 8 Nov 2021 22:18:23 +0530 Subject: [PATCH] mgr/dashboard: include mfa_ids in rgw user-details section Fixes: https://tracker.ceph.com/issues/53193 Signed-off-by: Avan Thakkar Introducing mfa_ids in user details section. (cherry picked from commit 6a2234cd6b68adaa0b855219c411eb95eb2ff9be) --- .../rgw-user-details.component.html | 5 +++++ .../rgw-user-details.component.spec.ts | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html index ebd648d021acb..2283f4c546f05 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html @@ -68,6 +68,11 @@ + + MFAs(Id) + {{ user.mfa_ids | join}} + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts index 126fdf44ff264..62519cdf478c9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts @@ -71,4 +71,24 @@ describe('RgwUserDetailsComponent', () => { expect(detailsTab[11].textContent).toEqual('No'); }); + + it('should show mfa ids only if length > 0', () => { + component.selection = { + uid: 'dashboard', + email: '', + system: 'true', + keys: [], + swift_keys: [], + mfa_ids: ['testMFA1', 'testMFA2'] + }; + + component.ngOnChanges(); + fixture.detectChanges(); + + const detailsTab = fixture.debugElement.nativeElement.querySelectorAll( + '.table.table-striped.table-bordered tr td' + ); + expect(detailsTab[14].textContent).toEqual('MFAs(Id)'); + expect(detailsTab[15].textContent).toEqual('testMFA1, testMFA2'); + }); }); -- 2.47.3