mgr/dashboard: include mfa_ids in rgw user-details section

Fixes: https://tracker.ceph.com/issues/53193
Signed-off-by: Avan Thakkar <athakkar@redhat.com>

Introducing mfa_ids in user details section.
This commit is contained in:
Avan Thakkar 2021-11-08 22:18:23 +05:30
parent 534fc6d936
commit 6a2234cd6b
2 changed files with 25 additions and 0 deletions

View File

@ -68,6 +68,11 @@
</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>

View 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');
});
});