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 %>
-
-
+
+
<%= render BlockScoutWeb.IconsView, "_stats_icon.html" %>
- <%= gettext("Stats") %>
+ <%= gettext("Stats") %>
-
-
+
<% end %>
<%= if Application.get_env(:block_scout_web, BlockScoutWeb.ApiRouter)[:reading_enabled] || Application.get_env(:block_scout_web, :api_url) do %>
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/makerdojo/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/makerdojo/index.html.eex
deleted file mode 100644
index b05c94afb7cc..000000000000
--- a/apps/block_scout_web/lib/block_scout_web/templates/makerdojo/index.html.eex
+++ /dev/null
@@ -1,44 +0,0 @@
-<% stats_enabled = Application.get_env(:block_scout_web, :stats_enabled) %>
-<% makerdojo_url = Application.get_env(:block_scout_web, :makerdojo_url) %>
-<%
-{:ok, urls} = makerdojo_url |> Jason.decode()
-%{"attestations" => attestations_url, "uniswap" => uniswap_url, "moola" => moola_url} = urls
-%>
-
-
-
-
-
-
-
- <%= if stats_enabled do %>
-
-
-
-
- <% end %>
-
-
-
-
-
diff --git a/apps/block_scout_web/lib/block_scout_web/views/makerdojo_view.ex b/apps/block_scout_web/lib/block_scout_web/views/makerdojo_view.ex
deleted file mode 100644
index c3cccaf7de7e..000000000000
--- a/apps/block_scout_web/lib/block_scout_web/views/makerdojo_view.ex
+++ /dev/null
@@ -1,10 +0,0 @@
-defmodule BlockScoutWeb.MakerdojoView do
- use BlockScoutWeb, :view
-
- @dialyzer :no_match
-
- def get_url(list, page) do
- {:ok, response} = Jason.decode(list)
- Map.get(response, page)
- end
-end
diff --git a/apps/block_scout_web/lib/block_scout_web/web_router.ex b/apps/block_scout_web/lib/block_scout_web/web_router.ex
index db5dc981e0c7..2fc37c96a02e 100644
--- a/apps/block_scout_web/lib/block_scout_web/web_router.ex
+++ b/apps/block_scout_web/lib/block_scout_web/web_router.ex
@@ -527,8 +527,6 @@ defmodule BlockScoutWeb.WebRouter do
get("/stats", StatsController, :index)
- get("/makerdojo", MakerdojoController, :index)
-
get("/visualize/sol2uml", VisualizeSol2umlController, :index)
get("/*path", PageNotFoundController, :index)
From 8f26c6bd7ee9b766495012e5f65a1c0fec755bfe Mon Sep 17 00:00:00 2001
From: Leszek Stachowski
Date: Wed, 27 Sep 2023 09:49:29 +0200
Subject: [PATCH 2/3] mix gettext
---
apps/block_scout_web/priv/gettext/default.pot | 55 +++++--------------
.../priv/gettext/en/LC_MESSAGES/default.po | 55 +++++--------------
2 files changed, 30 insertions(+), 80 deletions(-)
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot
index 198e0e6f4c43..504985574134 100644
--- a/apps/block_scout_web/priv/gettext/default.pot
+++ b/apps/block_scout_web/priv/gettext/default.pot
@@ -142,7 +142,7 @@ msgstr ""
msgid "API keys"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:124
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:112
#, elixir-autogen, elixir-format
msgid "APIs"
msgstr ""
@@ -1201,7 +1201,7 @@ msgstr ""
msgid "Error: Could not determine contract creator."
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:138
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:126
#, elixir-autogen, elixir-format
msgid "Eth RPC"
msgstr ""
@@ -1365,7 +1365,7 @@ msgstr ""
msgid "Go to"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:128
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:116
#, elixir-autogen, elixir-format
msgid "GraphQL"
msgstr ""
@@ -2030,7 +2030,7 @@ msgstr ""
msgid "Query"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:133
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:121
#, elixir-autogen, elixir-format
msgid "RPC"
msgstr ""
@@ -3381,11 +3381,6 @@ msgstr ""
msgid "Amount of locked CELO that has been activated to vote for validator(s)"
msgstr ""
-#: lib/block_scout_web/templates/makerdojo/index.html.eex:13
-#, elixir-autogen, elixir-format
-msgid "Attestations"
-msgstr ""
-
#: lib/block_scout_web/templates/page_not_found/index.html.eex:9
#: lib/block_scout_web/templates/transaction/not_found.html.eex:30
#, elixir-autogen, elixir-format
@@ -3443,7 +3438,7 @@ msgstr ""
msgid "Community Fund"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:172
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:160
#, elixir-autogen, elixir-format
msgid "Connect"
msgstr ""
@@ -3521,12 +3516,12 @@ msgstr ""
msgid "Fees sent to Community Fund"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:213
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:201
#, elixir-autogen, elixir-format
msgid "Finance Tools"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:221
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:209
#, elixir-autogen, elixir-format
msgid "Gas Tracker"
msgstr ""
@@ -3561,12 +3556,12 @@ msgstr ""
msgid "It could still be in the TX Pool of a different node, waiting to be broadcasted."
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:178
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:166
#, elixir-autogen, elixir-format
msgid "Learn"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:186
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:174
#, elixir-autogen, elixir-format
msgid "Learn, Borrow, Earn"
msgstr ""
@@ -3581,11 +3576,6 @@ msgstr ""
msgid "Locked CELO Balance"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:111
-#, elixir-autogen, elixir-format
-msgid "MakerDojo"
-msgstr ""
-
#: lib/block_scout_web/templates/stats/index.html.eex:22
#, elixir-autogen, elixir-format
msgid "Mento"
@@ -3596,12 +3586,7 @@ msgstr ""
msgid "Mento Reserve"
msgstr ""
-#: lib/block_scout_web/templates/makerdojo/index.html.eex:23
-#, elixir-autogen, elixir-format
-msgid "Moola"
-msgstr ""
-
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:151
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:139
#, elixir-autogen, elixir-format
msgid "More"
msgstr ""
@@ -3611,7 +3596,7 @@ msgstr ""
msgid "More epoch transactions have come in"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:193
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:181
#, elixir-autogen, elixir-format
msgid "NFT"
msgstr ""
@@ -3651,7 +3636,7 @@ msgstr ""
msgid "Reserve bolster"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:205
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:193
#, elixir-autogen, elixir-format
msgid "Resources"
msgstr ""
@@ -3696,7 +3681,7 @@ msgstr ""
msgid "Source code matches deployed contracts except the metadata hash"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:199
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:187
#, elixir-autogen, elixir-format
msgid "Spend"
msgstr ""
@@ -3706,7 +3691,7 @@ msgstr ""
msgid "Stats"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:157
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:145
#, elixir-autogen, elixir-format
msgid "Swap"
msgstr ""
@@ -3772,11 +3757,6 @@ msgstr ""
msgid "Total amount of epoch rewards this address has received, all time."
msgstr ""
-#: lib/block_scout_web/templates/makerdojo/index.html.eex:18
-#, elixir-autogen, elixir-format
-msgid "Uniswap"
-msgstr ""
-
#: lib/block_scout_web/templates/block/_tile.html.eex:50
#: lib/block_scout_web/templates/block/overview.html.eex:153
#: lib/block_scout_web/templates/chain/_block.html.eex:16
@@ -3876,16 +3856,11 @@ msgstr ""
msgid "Voting rewards accumulated over time."
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:164
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:152
#, elixir-autogen, elixir-format
msgid "Wallet"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:106
-#, elixir-autogen, elixir-format
-msgid "cLabs"
-msgstr ""
-
#: lib/block_scout_web/templates/address/overview.html.eex:250
#, elixir-autogen, elixir-format
msgid "cUSD"
diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
index 62a3ddd33596..1b29374f8e38 100644
--- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
+++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
@@ -142,7 +142,7 @@ msgstr ""
msgid "API keys"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:124
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:112
#, elixir-autogen, elixir-format
msgid "APIs"
msgstr ""
@@ -1201,7 +1201,7 @@ msgstr ""
msgid "Error: Could not determine contract creator."
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:138
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:126
#, elixir-autogen, elixir-format
msgid "Eth RPC"
msgstr ""
@@ -1365,7 +1365,7 @@ msgstr ""
msgid "Go to"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:128
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:116
#, elixir-autogen, elixir-format
msgid "GraphQL"
msgstr ""
@@ -2030,7 +2030,7 @@ msgstr ""
msgid "Query"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:133
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:121
#, elixir-autogen, elixir-format
msgid "RPC"
msgstr ""
@@ -3381,11 +3381,6 @@ msgstr ""
msgid "Amount of locked CELO that has been activated to vote for validator(s)"
msgstr ""
-#: lib/block_scout_web/templates/makerdojo/index.html.eex:13
-#, elixir-autogen, elixir-format
-msgid "Attestations"
-msgstr ""
-
#: lib/block_scout_web/templates/page_not_found/index.html.eex:9
#: lib/block_scout_web/templates/transaction/not_found.html.eex:30
#, elixir-autogen, elixir-format, fuzzy
@@ -3443,7 +3438,7 @@ msgstr ""
msgid "Community Fund"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:172
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:160
#, elixir-autogen, elixir-format, fuzzy
msgid "Connect"
msgstr ""
@@ -3521,12 +3516,12 @@ msgstr ""
msgid "Fees sent to Community Fund"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:213
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:201
#, elixir-autogen, elixir-format
msgid "Finance Tools"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:221
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:209
#, elixir-autogen, elixir-format, fuzzy
msgid "Gas Tracker"
msgstr ""
@@ -3561,12 +3556,12 @@ msgstr ""
msgid "It could still be in the TX Pool of a different node, waiting to be broadcasted."
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:178
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:166
#, elixir-autogen, elixir-format, fuzzy
msgid "Learn"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:186
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:174
#, elixir-autogen, elixir-format
msgid "Learn, Borrow, Earn"
msgstr ""
@@ -3581,11 +3576,6 @@ msgstr ""
msgid "Locked CELO Balance"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:111
-#, elixir-autogen, elixir-format
-msgid "MakerDojo"
-msgstr ""
-
#: lib/block_scout_web/templates/stats/index.html.eex:22
#, elixir-autogen, elixir-format
msgid "Mento"
@@ -3596,12 +3586,7 @@ msgstr ""
msgid "Mento Reserve"
msgstr ""
-#: lib/block_scout_web/templates/makerdojo/index.html.eex:23
-#, elixir-autogen, elixir-format
-msgid "Moola"
-msgstr ""
-
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:151
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:139
#, elixir-autogen, elixir-format
msgid "More"
msgstr ""
@@ -3611,7 +3596,7 @@ msgstr ""
msgid "More epoch transactions have come in"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:193
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:181
#, elixir-autogen, elixir-format
msgid "NFT"
msgstr ""
@@ -3651,7 +3636,7 @@ msgstr ""
msgid "Reserve bolster"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:205
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:193
#, elixir-autogen, elixir-format
msgid "Resources"
msgstr ""
@@ -3696,7 +3681,7 @@ msgstr ""
msgid "Source code matches deployed contracts except the metadata hash"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:199
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:187
#, elixir-autogen, elixir-format
msgid "Spend"
msgstr ""
@@ -3706,7 +3691,7 @@ msgstr ""
msgid "Stats"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:157
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:145
#, elixir-autogen, elixir-format
msgid "Swap"
msgstr ""
@@ -3772,11 +3757,6 @@ msgstr ""
msgid "Total amount of epoch rewards this address has received, all time."
msgstr ""
-#: lib/block_scout_web/templates/makerdojo/index.html.eex:18
-#, elixir-autogen, elixir-format
-msgid "Uniswap"
-msgstr ""
-
#: lib/block_scout_web/templates/block/_tile.html.eex:50
#: lib/block_scout_web/templates/block/overview.html.eex:153
#: lib/block_scout_web/templates/chain/_block.html.eex:16
@@ -3876,16 +3856,11 @@ msgstr ""
msgid "Voting rewards accumulated over time."
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:164
+#: lib/block_scout_web/templates/layout/_topnav.html.eex:152
#, elixir-autogen, elixir-format
msgid "Wallet"
msgstr ""
-#: lib/block_scout_web/templates/layout/_topnav.html.eex:106
-#, elixir-autogen, elixir-format
-msgid "cLabs"
-msgstr ""
-
#: lib/block_scout_web/templates/address/overview.html.eex:250
#, elixir-autogen, elixir-format
msgid "cUSD"
From 301aecf4753e1a8575b41a24d4160f1f7282df40 Mon Sep 17 00:00:00 2001
From: Leszek Stachowski
Date: Wed, 27 Sep 2023 16:10:19 +0200
Subject: [PATCH 3/3] restore stats css and csp header changes
---
apps/block_scout_web/assets/css/app.scss | 2 +-
.../assets/css/components/_datastudio.scss | 79 -------------------
.../lib/block_scout_web/csp_header.ex | 2 +-
3 files changed, 2 insertions(+), 81 deletions(-)
delete mode 100644 apps/block_scout_web/assets/css/components/_datastudio.scss
diff --git a/apps/block_scout_web/assets/css/app.scss b/apps/block_scout_web/assets/css/app.scss
index 9eaa3e8dc1a7..d8c1137ab57e 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/datastudio";
+@import "components/stats";
@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
deleted file mode 100644
index e7410ddaacf8..000000000000
--- a/apps/block_scout_web/assets/css/components/_datastudio.scss
+++ /dev/null
@@ -1,79 +0,0 @@
-.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/csp_header.ex b/apps/block_scout_web/lib/block_scout_web/csp_header.ex
index a691caee9744..1cebfb53cf82 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/;\
+ frame-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com https://datastudio.google.com/ https://lookerstudio.google.com/;\
"
})
end