]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: show correct RGW user 'system' info 33234/head
authorAlfonso Martínez <almartin@redhat.com>
Tue, 11 Feb 2020 14:26:34 +0000 (15:26 +0100)
committerAlfonso Martínez <almartin@redhat.com>
Fri, 6 Mar 2020 08:29:34 +0000 (09:29 +0100)
Fixes: https://tracker.ceph.com/issues/44075
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
(cherry picked from commit 3d84dd948d771e761b42e8476eaf7d9df57c2eb3)

 Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html

- Conflicts manually solved.

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 304ce2327e9f7ccbcf9f6fb91d5becdf81bdc80f..b1739193433856fba9145b6bcb3c695c3ef1d304 100644 (file)
@@ -27,7 +27,7 @@
           <tr>
             <td i18n
                 class="bold col-sm-1">System</td>
-            <td class="col-sm-3">{{ user.system | booleanText }}</td>
+            <td class="col-sm-3">{{ user.system === 'true' | booleanText }}</td>
           </tr>
           <tr>
             <td i18n
index d5afbc5285a03707c73c44a2877342dbafbe5aa3..cafbf63d5f0b1454ee5de9ba913ede20006e893e 100644 (file)
@@ -29,4 +29,26 @@ describe('RgwUserDetailsComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
+  it('should show correct "System" info', () => {
+    component.selection.selected = [
+      { uid: '', email: '', system: 'true', keys: [], swift_keys: [] }
+    ];
+    component.selection.hasSelection = true;
+    component.selection.hasSingleSelection = true;
+    component.ngOnChanges();
+    fixture.detectChanges();
+
+    const detailsTab = fixture.debugElement.nativeElement.querySelectorAll(
+      '.table.table-striped.table-bordered tr td'
+    );
+    expect(detailsTab[6].textContent).toEqual('System');
+    expect(detailsTab[7].textContent).toEqual('Yes');
+
+    component.selection.selected[0].system = 'false';
+    component.ngOnChanges();
+    fixture.detectChanges();
+
+    expect(detailsTab[7].textContent).toEqual('No');
+  });
 });