From cb81b5ef932f75af14dfbdf89f8451a9d1827856 Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Wed, 5 Oct 2022 13:00:16 +0000 Subject: [PATCH] [FIX] website, website_sale: repair Plausible dashboard layout This commit includes several changes in the Plausible dashboard: - Remove the "Analytics" title. - Add margins (container-fluid => container). This also fixes the country map overflow and the flickering. - Remove the duplicated scrollbars. - Use the background colors from within the iframe. - Hide the date range buttons by default, but show them if website_sale is installed. It also reorders the Reporting menu as follows: - Analytics - eCommerce - Online Sales - Visitors - Page Views task-2993773 X-original-commit: b8c1976e933628182496929d348dda11b5051a0c Part-of: odoo/odoo#102782 --- .../static/src/scss/website.backend.scss | 29 ++++++++++++++++ .../static/src/xml/website.backend.xml | 33 ++++++++++--------- addons/website/views/website_views.xml | 4 +-- .../website/views/website_visitor_views.xml | 4 +-- .../static/src/xml/website_sale_dashboard.xml | 7 ++++ 5 files changed, 57 insertions(+), 20 deletions(-) diff --git a/addons/website/static/src/scss/website.backend.scss b/addons/website/static/src/scss/website.backend.scss index 9c8d292524c..d9b74db7f5d 100644 --- a/addons/website/static/src/scss/website.backend.scss +++ b/addons/website/static/src/scss/website.backend.scss @@ -1,8 +1,37 @@ .o_dashboards { background-color: #ececec; + &:has(iframe[src*='plausible']) { + background-color: #f9fafb; // Copied from iframe. + } + .o_website_dashboard { background-color: #ececec; + + &:has(iframe[src*='plausible']) { + background-color: #f9fafb; // Copied from iframe. + + iframe { + // TODO: Find another way to set the height, not robust enough, + // especially if plausible change those values later. + height: 2350px; // Copied from iframe. + top: 2px; // Do not cover eCommerce dashboard border. + + @include media-breakpoint-only(md) { + height: 2500px; // Copied from iframe. + } + @include media-breakpoint-only(lg) { + height: 1600px; // Copied from iframe. + } + @include media-breakpoint-only(xl) { + height: 1570px; // Copied from iframe. + } + @include media-breakpoint-only(xxl) { + height: 1650px; // Copied from iframe. + } + } + } + div.o_box { @include clearfix; color: $o-main-color-muted; diff --git a/addons/website/static/src/xml/website.backend.xml b/addons/website/static/src/xml/website.backend.xml index f5ec944162c..c8bd6c11b77 100644 --- a/addons/website/static/src/xml/website.backend.xml +++ b/addons/website/static/src/xml/website.backend.xml @@ -30,24 +30,24 @@
-
-

Analytics

-
+
+
-