From 3d5703a61a35f72c9045b0c807093d5fc44892e6 Mon Sep 17 00:00:00 2001 From: 0xarthurxyz <46296830+0xarthurxyz@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:03:55 +0100 Subject: [PATCH 1/3] Revert "Embedding makerdojo (#750)" This reverts commit 22bb0f16b2502f7acdda487783392d38b83e40b3. Quick attempt at reverting pull request #750 without installing entire local development requirements. A few merge conflicts make me think the git revert operation might mess things up.: --- apps/block_scout_web/assets/css/app.scss | 2 +- .../assets/css/components/_datastudio.scss | 79 +++++++++++++++++++ .../controllers/makerdojo_controller.ex | 9 --- .../lib/block_scout_web/csp_header.ex | 2 +- .../templates/layout/_topnav.html.eex | 20 +---- .../templates/makerdojo/index.html.eex | 44 ----------- .../block_scout_web/views/makerdojo_view.ex | 10 --- .../lib/block_scout_web/web_router.ex | 2 - 8 files changed, 85 insertions(+), 83 deletions(-) create mode 100644 apps/block_scout_web/assets/css/components/_datastudio.scss delete mode 100644 apps/block_scout_web/lib/block_scout_web/controllers/makerdojo_controller.ex delete mode 100644 apps/block_scout_web/lib/block_scout_web/templates/makerdojo/index.html.eex delete mode 100644 apps/block_scout_web/lib/block_scout_web/views/makerdojo_view.ex diff --git a/apps/block_scout_web/assets/css/app.scss b/apps/block_scout_web/assets/css/app.scss index d8c1137ab57e..9eaa3e8dc1a7 100644 --- a/apps/block_scout_web/assets/css/app.scss +++ b/apps/block_scout_web/assets/css/app.scss @@ -83,7 +83,7 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "components/epoch_tile"; @import "components/campaign_banner"; @import "components/dashboard-banner"; -@import "components/stats"; +@import "components/datastudio"; @import "components/icon-link"; @import "components/badge"; @import "components/description-list"; diff --git a/apps/block_scout_web/assets/css/components/_datastudio.scss b/apps/block_scout_web/assets/css/components/_datastudio.scss new file mode 100644 index 000000000000..e7410ddaacf8 --- /dev/null +++ b/apps/block_scout_web/assets/css/components/_datastudio.scss @@ -0,0 +1,79 @@ +.reportArea.down-scaled { + height: 1150px !important; + overflow: unset !important; +} + +.google-data-studio { + position: relative; + padding-bottom: 10%; + // padding-top: 4%; + overflow: hidden; +} + +nav#stats-navbar { + background-color:white!important; + color: #767676; +} + +iframe#myiframe { + height: 3340px !important; + @media only screen and (max-width: 768px) { + height: 960px !important; + } +} + + +ul.topnav { + list-style-type: none; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + margin: 0; + padding: 0; + padding-left: 5%; + overflow: hidden; + background-color: #FFFFFF; +} + +ul.topnav li { + -ms-flex-preferred-size: 120px; + -ms-flex-negative: 0; + flex-shrink: 0; /* don't allow menu item to shrink below 120px when there isn’t enough space on the row. */ + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; /* allow items to grow up to 150px wide if the container is big enough */ + -o-text-overflow: ellipsis; + text-overflow: ellipsis; +} + +.menuWrap { + -webkit-box-sizing: content-box; + box-sizing: content-box; + overflow-x: scroll; + overflow-y: hidden; +} + +ul.topnav li a { + display: inline-block; + color: #2F3237; + font-size: 18px; + font-weight: normal; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +ul.topnav li.selected a {color: #00BE9C; font-weight: bold;} + +ul.topnav li a:hover:not(.active) {color: #00BE9C;} + +// ul.topnav li.right {float: right;} + +@media only screen and (max-width: 768px) { + ul.topnav {background-color: #2F3237; overflow-x: scroll; white-space: nowrap; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar;} + .dark-theme-applied ul.topnav {background-color: #282945; overflow-x: scroll; white-space: nowrap; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar;} + .topnav::-webkit-scrollbar { + display: none; } + // ul.topnav li.right, + ul.topnav li a { color: #ffffff; font-size: 14px} +} \ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/makerdojo_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/makerdojo_controller.ex deleted file mode 100644 index 9ffa0b2f0bee..000000000000 --- a/apps/block_scout_web/lib/block_scout_web/controllers/makerdojo_controller.ex +++ /dev/null @@ -1,9 +0,0 @@ -defmodule BlockScoutWeb.MakerdojoController do - use BlockScoutWeb, :controller - - def index(conn, _params) do - conn - |> put_status(200) - |> render("index.html", token: nil) - end -end diff --git a/apps/block_scout_web/lib/block_scout_web/csp_header.ex b/apps/block_scout_web/lib/block_scout_web/csp_header.ex index afa82d1c7c92..a691caee9744 100644 --- a/apps/block_scout_web/lib/block_scout_web/csp_header.ex +++ b/apps/block_scout_web/lib/block_scout_web/csp_header.ex @@ -18,7 +18,7 @@ defmodule BlockScoutWeb.CSPHeader do img-src 'self' * data: https://*.google-analytics.com https://*.googletagmanager.com;\ media-src 'self' * data:;\ font-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.gstatic.com data:;\ - frame-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com https://datastudio.google.com/ https://lookerstudio.google.com/ https://makerdojo.io/;\ + frame-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com https://datastudio.google.com/;\ " }) end diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index 0d8d55cfd316..b7dd615d4211 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -94,26 +94,14 @@ <% end %> <%= if stats_enabled do %> - + <% end %> <%= if Application.get_env(:block_scout_web, BlockScoutWeb.ApiRouter)[:reading_enabled] || Application.get_env(:block_scout_web, :api_url) do %>