From: Volker Theile Date: Tue, 30 Jun 2020 09:26:22 +0000 (+0200) Subject: mgr/dashboard: stay on active tab X-Git-Tag: v16.1.0~1771^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34946%2Fhead;p=ceph.git mgr/dashboard: stay on active tab * Remember the selected tab and restore the state on tabset init. * Remove tab headers where only one tab is shown. Fixes: https://tracker.ceph.com/issues/43120 Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.e2e-spec.ts index fda568206752..33b3e357a68d 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.e2e-spec.ts @@ -23,10 +23,9 @@ describe('Configuration page', () => { configuration.getTableSelectedCount().should('eq', 1); }); - it('should check that details table opens and tab is correct', () => { + it('should check that details table opens (w/o tab header)', () => { configuration.getStatusTables().should('be.visible'); - configuration.getTabsCount().should('eq', 1); - configuration.getTabText(0).should('eq', 'Details'); + configuration.getTabs().should('not.exist'); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/page-helper.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/page-helper.po.ts index 44532b666781..b1a2fdfda377 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/page-helper.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/page-helper.po.ts @@ -69,12 +69,16 @@ export abstract class PageHelper { cy.get('.breadcrumb-item.active').should('have.text', text); } + getTabs() { + return cy.get('.nav.nav-tabs li'); + } + getTabText(index: number) { - return cy.get('.nav.nav-tabs li').its(index).text(); + return this.getTabs().its(index).text(); } getTabsCount(): any { - return cy.get('.nav.nav-tabs li').its('length'); + return this.getTabs().its('length'); } /** diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html index 584a09a9ad71..ee2f3d0421b3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html @@ -1,7 +1,8 @@