From da6fbc139418e2e83f9d14cbbea0c4fc11ada4f0 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Wed, 7 Jun 2023 13:47:56 +0530 Subject: [PATCH] mgr/dashboard: add popover to cluster status card Previous dashboard has a popover for the status when there are some warnings in the Cluster Health. Introducing the same behaviour on the new landing page Fixes: https://tracker.ceph.com/issues/61611 Signed-off-by: Nizamudeen A (cherry picked from commit 947df3d8ed5d9c34614a31df157e672e77d3042c) --- .../dashboard/dashboard-v3.component.html | 23 +++++++++++++++++++ .../dashboard/dashboard-v3.component.spec.ts | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html index 94c1435557c11..9c0dd09111088 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html @@ -21,11 +21,27 @@ class="col-sm-6 px-3 d-flex" aria-label="Status card">
+ + +
    +
  • + + {{ check.type }}: {{ check.summary.message }} +
  • +
+
+ Cluster Cluster
+ + + + + + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.spec.ts index 2ca65a468aa6c..b5c4e5b48d55d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.spec.ts @@ -295,6 +295,29 @@ describe('Dashbord Component', () => { expect(dangerAlerts).toBe(null); }); + it('should render "Status" card text that is not clickable', () => { + fixture.detectChanges(); + + const clusterStatusCard = fixture.debugElement.query(By.css('cd-card[cardTitle="Status"]')); + const clickableContent = clusterStatusCard.query(By.css('.lead.text-primary')); + expect(clickableContent).toBeNull(); + }); + + it('should render "Status" card text that is clickable (popover)', () => { + const payload = _.cloneDeep(healthPayload); + payload.health['status'] = 'HEALTH_WARN'; + payload.health['checks'] = [ + { severity: 'HEALTH_WARN', type: 'WRN', summary: { message: 'fake warning' } } + ]; + + getHealthSpy.and.returnValue(of(payload)); + fixture.detectChanges(); + + const clusterStatusCard = fixture.debugElement.query(By.css('cd-card[cardTitle="Status"]')); + const clickableContent = clusterStatusCard.query(By.css('.lead.text-primary')); + expect(clickableContent).not.toBeNull(); + }); + describe('features disabled', () => { beforeEach(() => { fakeFeatureTogglesService.and.returnValue( -- 2.39.5