Merge pull request #43845 from rhcs-dashboard/add-mfa-ids-in-rgw-user-details

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

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
This commit is contained in:
Ernesto Puerta 2021-11-10 21:52:11 +01:00 committed by GitHub
commit fe74cd8c6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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');
});
});