Skip to content

Commit

Permalink
Fix headless mode (didn't work with vertical navbar) (getredash#4977)
Browse files Browse the repository at this point in the history
* Fix headless mode (didn't work with vertical navbar)

* Fix header margins on public dashboard page

* Fix test
  • Loading branch information
kravets-levko authored Jun 17, 2020
1 parent 4c324dd commit 98a5154
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
11 changes: 0 additions & 11 deletions client/app/assets/less/inc/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ body {
#application-root {
padding-bottom: 15px;
}

&.headless {
#application-root {
padding-top: 10px;
padding-bottom: 0;
}

.app-header-wrapper {
display: none;
}
}
}

#application-root {
Expand Down
11 changes: 11 additions & 0 deletions client/app/components/ApplicationArea/ApplicationLayout/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ body.fixed-layout #application-root {
}
}

body.headless #application-root {
.application-layout-side-menu,
.application-layout-top-menu {
display: none !important;
}

.application-layout-content {
margin-top: 0;
}
}

// Fixes for proper snapshots in Percy (move vertical scroll to body level
// to capture entire page, otherwise it wll be cut by viewport)
@media only percy {
Expand Down
6 changes: 6 additions & 0 deletions client/app/pages/dashboards/PublicDashboardPage.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.public-dashboard-page {
width: 100%;

.page-header-wrapper {
margin-top: 0;
margin-left: 15px;
margin-right: 15px;
}

> .container {
min-height: calc(100vh - 95px);
}
Expand Down
2 changes: 1 addition & 1 deletion client/app/pages/queries/VisualizationEmbed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function VisualizationEmbed({ queryId, visualizationId, apiKey, onError }) {
}

return (
<div className="tile m-l-10 m-r-10 p-t-10 embed__vis" data-test="VisualizationEmbed">
<div className="tile m-t-10 m-l-10 m-r-10 p-t-10 embed__vis" data-test="VisualizationEmbed">
{!hideHeader && (
<VisualizationEmbedHeader
queryName={query.name}
Expand Down
6 changes: 5 additions & 1 deletion client/cypress/integration/user/logout_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ describe("Logout", () => {

it("shows login page after logout", () => {
cy.getByTestId("ProfileDropdown").click();
cy.getByTestId("LogOutButton").click();
// Wait until submenu appears and become interactive
cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId("LogOutButton")
.should("be.visible")
.click();

cy.title().should("eq", "Login to Redash");
});
Expand Down

0 comments on commit 98a5154

Please sign in to comment.