]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: include mfa_ids in rgw user-details section 43893/head
authorAvan Thakkar <athakkar@redhat.com>
Mon, 8 Nov 2021 16:48:23 +0000 (22:18 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Thu, 11 Nov 2021 16:34:15 +0000 (22:04 +0530)
Fixes: https://tracker.ceph.com/issues/53193
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Introducing mfa_ids in user details section.

(cherry picked from commit 6a2234cd6b68adaa0b855219c411eb95eb2ff9be)

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts

index ebd648d021acb46202b43c7ef6f30f54d1eaea61..2283f4c546f053982c7def5fbd5d9937c9abc555 100644 (file)
                   </div>
                 </td>
               </tr>
+              <tr *ngIf="user.mfa_ids?.length">
+                <td i18n
+                    class="bold">MFAs(Id)</td>
+                <td>{{ user.mfa_ids | join}}</td>
+              </tr>
             </tbody>
           </table>
 
index 126fdf44ff26468b1a7a8d258ccdb63615b010a2..62519cdf478c975e4e88d5b970c418fce53a6235 100644 (file)
@@ -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');
+  });
 });