From: Avan Thakkar Date: Mon, 8 Nov 2021 16:48:23 +0000 (+0530) Subject: mgr/dashboard: include mfa_ids in rgw user-details section X-Git-Tag: v16.2.7~23^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43893%2Fhead;p=ceph.git 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) --- 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 ebd648d021ac..2283f4c546f0 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 126fdf44ff26..62519cdf478c 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'); + }); });