Merge pull request #4310 from blockscout/vb-logo-redirect-fix

Fix logo URL redirection, set font-family defaults for chart.js
pull/4314/head
Victor Baranov 3 years ago committed by GitHub
commit b21dfe1ddd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 1
      apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js
  3. 6
      apps/block_scout_web/assets/js/lib/history_chart.js
  4. 2
      apps/block_scout_web/assets/js/pages/chain.js
  5. 1
      apps/block_scout_web/assets/js/pages/stakes/utils.js
  6. 8
      apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex
  7. 2
      apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex
  8. 2
      apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex
  9. 30
      apps/block_scout_web/priv/gettext/default.pot
  10. 30
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -10,6 +10,7 @@
- [#4067](https://github.com/blockscout/blockscout/pull/4067) - Display LP tokens USD value and custom metadata in tokens dropdown at address page - [#4067](https://github.com/blockscout/blockscout/pull/4067) - Display LP tokens USD value and custom metadata in tokens dropdown at address page
### Fixes ### Fixes
- [#4310](https://github.com/blockscout/blockscout/pull/4310) - Fix logo URL redirection, set font-family defaults for chart.js
- [#4308](https://github.com/blockscout/blockscout/pull/4308) - Fix internal server error on contract verification options page - [#4308](https://github.com/blockscout/blockscout/pull/4308) - Fix internal server error on contract verification options page
- [#4307](https://github.com/blockscout/blockscout/pull/4307) - Fix for composing IPFS URLs for NFTs images - [#4307](https://github.com/blockscout/blockscout/pull/4307) - Fix for composing IPFS URLs for NFTs images
- [#4306](https://github.com/blockscout/blockscout/pull/4306) - Check token instance images MIME types - [#4306](https://github.com/blockscout/blockscout/pull/4306) - Check token instance images MIME types

@ -3,6 +3,7 @@ import { Chart, Filler, LineController, LineElement, PointElement, LinearScale,
import 'chartjs-adapter-moment' import 'chartjs-adapter-moment'
import humps from 'humps' import humps from 'humps'
Chart.defaults.font.family = 'Nunito, "Helvetica Neue", Arial, sans-serif,"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
Chart.register(Filler, LineController, LineElement, PointElement, LinearScale, TimeScale, Title, Tooltip) Chart.register(Filler, LineController, LineElement, PointElement, LinearScale, TimeScale, Title, Tooltip)
export function createCoinBalanceHistoryChart (el) { export function createCoinBalanceHistoryChart (el) {

@ -7,6 +7,7 @@ import moment from 'moment'
import { formatUsdValue } from '../lib/currency' import { formatUsdValue } from '../lib/currency'
import sassVariables from '../../css/app.scss' import sassVariables from '../../css/app.scss'
Chart.defaults.font.family = 'Nunito, "Helvetica Neue", Arial, sans-serif,"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
Chart.register(LineController, LineElement, PointElement, LinearScale, TimeScale, Title, Tooltip) Chart.register(LineController, LineElement, PointElement, LinearScale, TimeScale, Title, Tooltip)
const grid = { const grid = {
@ -281,16 +282,15 @@ export function createMarketHistoryChart (el) {
break break
} }
case 'transaction': { case 'transaction': {
const transactionHistory = JSON.parse(data.history_data) const txsHistoryData = JSON.parse(data.history_data)
$(el).show() $(el).show()
chart.updateTransactionHistory(transactionHistory) chart.updateTransactionHistory(txsHistoryData)
break break
} }
} }
}) })
.fail(() => { .fail(() => {
$(el).hide()
$chartError.show() $chartError.show()
}) })
}) })

@ -172,7 +172,7 @@ const elements = {
load () { load () {
chart = window.dashboardChart chart = window.dashboardChart
}, },
render ($el, state, oldState) { render (_$el, state, oldState) {
if (!chart || (oldState.availableSupply === state.availableSupply && oldState.marketHistoryData === state.marketHistoryData) || !state.availableSupply) return if (!chart || (oldState.availableSupply === state.availableSupply && oldState.marketHistoryData === state.marketHistoryData) || !state.availableSupply) return
chart.updateMarketHistory(state.availableSupply, state.marketHistoryData) chart.updateMarketHistory(state.availableSupply, state.marketHistoryData)

@ -2,6 +2,7 @@ import $ from 'jquery'
import { ArcElement, Chart, DoughnutController } from 'chart.js' import { ArcElement, Chart, DoughnutController } from 'chart.js'
import { openErrorModal, openSuccessModal, openWarningModal } from '../../lib/modals' import { openErrorModal, openSuccessModal, openWarningModal } from '../../lib/modals'
Chart.defaults.font.family = 'Nunito, "Helvetica Neue", Arial, sans-serif,"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
Chart.register(ArcElement, DoughnutController) Chart.register(ArcElement, DoughnutController)
export async function makeContractCall (call, store, gasLimit, callbackFunc) { export async function makeContractCall (call, store, gasLimit, callbackFunc) {

@ -9,7 +9,6 @@
<span><%= gettext("There was a problem loading the chart.") %></span> <span><%= gettext("There was a problem loading the chart.") %></span>
</button> </button>
<canvas data-chart="historyChart" <canvas data-chart="historyChart"
data-history_chart_paths= data-history_chart_paths=
'{<%= for {{key, value}, x} <- Enum.with_index(@chart_data_paths) do %> '{<%= for {{key, value}, x} <- Enum.with_index(@chart_data_paths) do %>
"<%= key %>":"<%= value %>" "<%= key %>":"<%= value %>"
@ -17,10 +16,10 @@
, ,
<% end %> <% end %>
<% end %>}' <% end %>}'
data-history_chart_config = '<%= @chart_config_json %>' data-history_chart_config = '<%= @chart_config_json %>'
width="350" height="152">
width="350" height="152" style="display: none;"></canvas> </canvas>
<script data-cfasync="false" src="<%= static_path(@conn, "/js/chart-loader.js") %>"></script>
</div> </div>
<!-- Legend --> <!-- Legend -->
<script> <script>
@ -170,7 +169,6 @@
</div> </div>
</div> </div>
</div> </div>
<script defer data-cfasync="false" src="<%= static_path(@conn, "/js/chart-loader.js") %>"></script>
<script defer data-cfasync="false" src="<%= static_path(@conn, "/js/chain.js") %>"></script> <script defer data-cfasync="false" src="<%= static_path(@conn, "/js/chain.js") %>"></script>
</div> </div>
<section class="container"> <section class="container">

@ -4,7 +4,7 @@
<div class="row footer-logo-row"> <div class="row footer-logo-row">
<div class="col-md-12"> <div class="col-md-12">
<%= link to: webapp_url(@conn), class: "footer-brand" do %> <%= link to: webapp_url(@conn), class: "footer-brand" do %>
<img class="footer-logo" src="<%= logo_footer() %>" alt="<%= subnetwork_title() %>" /> <img class="footer-logo" src="<%= static_path(@conn, logo_footer()) %>" alt="<%= subnetwork_title() %>" />
<%= if logo_text() do %> <%= if logo_text() do %>
<span class="logo-text footer"> <%= logo_text() %> </span> <span class="logo-text footer"> <%= logo_text() %> </span>
<% end %> <% end %>

@ -12,7 +12,7 @@
</script> </script>
<div class="container-fluid navbar-container"> <div class="container-fluid navbar-container">
<%= link to: webapp_url(@conn), class: "navbar-brand", "data-test": "header_logo" do %> <%= link to: webapp_url(@conn), class: "navbar-brand", "data-test": "header_logo" do %>
<img class="navbar-logo" id="navbar-logo" src="<%= logo() %>" alt="<%= subnetwork_title() %>" /> <img class="navbar-logo" id="navbar-logo" src="<%= static_path(@conn, logo()) %>" alt="<%= subnetwork_title() %>" />
<%= if logo_text() do %> <%= if logo_text() do %>
<span class="logo-text"> <%= logo_text() %> </span> <span class="logo-text"> <%= logo_text() %> </span>
<% end %> <% end %>

@ -152,7 +152,7 @@ msgid "Anything not in this list is not supported. Click on the method to be tak
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:125 #: lib/block_scout_web/templates/chain/show.html.eex:124
msgid "Average block time" msgid "Average block time"
msgstr "" msgstr ""
@ -237,7 +237,7 @@ msgid "BlockScout provides analytics data, API, and Smart Contract tools for the
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:180 #: lib/block_scout_web/templates/chain/show.html.eex:178
#: lib/block_scout_web/templates/layout/_topnav.html.eex:36 #: lib/block_scout_web/templates/layout/_topnav.html.eex:36
#: lib/block_scout_web/templates/layout/_topnav.html.eex:40 #: lib/block_scout_web/templates/layout/_topnav.html.eex:40
msgid "Blocks" msgid "Blocks"
@ -742,7 +742,7 @@ msgid "GraphQL"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:54 #: lib/block_scout_web/templates/chain/show.html.eex:53
#: lib/block_scout_web/views/block_view.ex:20 #: lib/block_scout_web/views/block_view.ex:20
#: lib/block_scout_web/views/wei_helpers.ex:77 #: lib/block_scout_web/views/wei_helpers.ex:77
msgid "Gwei" msgid "Gwei"
@ -782,7 +782,7 @@ msgid "Success"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:94 #: lib/block_scout_web/templates/chain/show.html.eex:93
#: lib/block_scout_web/templates/layout/app.html.eex:34 #: lib/block_scout_web/templates/layout/app.html.eex:34
msgid "Tx/day" msgid "Tx/day"
msgstr "" msgstr ""
@ -1042,7 +1042,7 @@ msgid "Mainnet"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:63 #: lib/block_scout_web/templates/chain/show.html.eex:62
#: lib/block_scout_web/templates/layout/app.html.eex:31 #: lib/block_scout_web/templates/layout/app.html.eex:31
#: lib/block_scout_web/views/address_view.ex:142 #: lib/block_scout_web/views/address_view.ex:142
msgid "Market Cap" msgid "Market Cap"
@ -1075,7 +1075,7 @@ msgid "More internal transactions have come in"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:241 #: lib/block_scout_web/templates/chain/show.html.eex:239
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:12 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:12
#: lib/block_scout_web/templates/transaction/index.html.eex:18 #: lib/block_scout_web/templates/transaction/index.html.eex:18
msgid "More transactions have come in" msgid "More transactions have come in"
@ -1180,7 +1180,7 @@ msgid "Potential matches from our contract method database:"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:43 #: lib/block_scout_web/templates/chain/show.html.eex:42
#: lib/block_scout_web/templates/layout/app.html.eex:32 #: lib/block_scout_web/templates/layout/app.html.eex:32
msgid "Price" msgid "Price"
msgstr "" msgstr ""
@ -1320,7 +1320,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_transaction/index.html.eex:50 #: lib/block_scout_web/templates/address_transaction/index.html.eex:50
#: lib/block_scout_web/templates/address_validation/index.html.eex:24 #: lib/block_scout_web/templates/address_validation/index.html.eex:24
#: lib/block_scout_web/templates/block_transaction/index.html.eex:23 #: lib/block_scout_web/templates/block_transaction/index.html.eex:23
#: lib/block_scout_web/templates/chain/show.html.eex:184 #: lib/block_scout_web/templates/chain/show.html.eex:182
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:21 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:21
#: lib/block_scout_web/templates/stakes/_table.html.eex:49 #: lib/block_scout_web/templates/stakes/_table.html.eex:49
#: lib/block_scout_web/templates/tokens/holder/index.html.eex:22 #: lib/block_scout_web/templates/tokens/holder/index.html.eex:22
@ -1335,7 +1335,7 @@ msgid "Something went wrong, click to reload."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:247 #: lib/block_scout_web/templates/chain/show.html.eex:245
msgid "Something went wrong, click to retry." msgid "Something went wrong, click to retry."
msgstr "" msgstr ""
@ -1464,7 +1464,7 @@ msgid "Total Supply"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:155 #: lib/block_scout_web/templates/chain/show.html.eex:154
msgid "Total blocks" msgid "Total blocks"
msgstr "" msgstr ""
@ -1606,12 +1606,12 @@ msgid "Version"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:179 #: lib/block_scout_web/templates/chain/show.html.eex:177
msgid "View All Blocks" msgid "View All Blocks"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:237 #: lib/block_scout_web/templates/chain/show.html.eex:235
msgid "View All Transactions" msgid "View All Transactions"
msgstr "" msgstr ""
@ -1653,7 +1653,7 @@ msgid "WEI"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:163 #: lib/block_scout_web/templates/chain/show.html.eex:162
msgid "Wallet addresses" msgid "Wallet addresses"
msgstr "" msgstr ""
@ -1792,7 +1792,7 @@ msgid "Module"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:134 #: lib/block_scout_web/templates/chain/show.html.eex:133
msgid "Total transactions" msgid "Total transactions"
msgstr "" msgstr ""
@ -1879,7 +1879,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_transaction/index.html.eex:17 #: lib/block_scout_web/templates/address_transaction/index.html.eex:17
#: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10
#: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18
#: lib/block_scout_web/templates/chain/show.html.eex:238 #: lib/block_scout_web/templates/chain/show.html.eex:236
#: lib/block_scout_web/templates/layout/_topnav.html.eex:55 #: lib/block_scout_web/templates/layout/_topnav.html.eex:55
#: lib/block_scout_web/views/address_view.ex:345 #: lib/block_scout_web/views/address_view.ex:345
msgid "Transactions" msgid "Transactions"

@ -152,7 +152,7 @@ msgid "Anything not in this list is not supported. Click on the method to be tak
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:125 #: lib/block_scout_web/templates/chain/show.html.eex:124
msgid "Average block time" msgid "Average block time"
msgstr "" msgstr ""
@ -237,7 +237,7 @@ msgid "BlockScout provides analytics data, API, and Smart Contract tools for the
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:180 #: lib/block_scout_web/templates/chain/show.html.eex:178
#: lib/block_scout_web/templates/layout/_topnav.html.eex:36 #: lib/block_scout_web/templates/layout/_topnav.html.eex:36
#: lib/block_scout_web/templates/layout/_topnav.html.eex:40 #: lib/block_scout_web/templates/layout/_topnav.html.eex:40
msgid "Blocks" msgid "Blocks"
@ -742,7 +742,7 @@ msgid "GraphQL"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:54 #: lib/block_scout_web/templates/chain/show.html.eex:53
#: lib/block_scout_web/views/block_view.ex:20 #: lib/block_scout_web/views/block_view.ex:20
#: lib/block_scout_web/views/wei_helpers.ex:77 #: lib/block_scout_web/views/wei_helpers.ex:77
msgid "Gwei" msgid "Gwei"
@ -782,7 +782,7 @@ msgid "Success"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:94 #: lib/block_scout_web/templates/chain/show.html.eex:93
#: lib/block_scout_web/templates/layout/app.html.eex:34 #: lib/block_scout_web/templates/layout/app.html.eex:34
msgid "Tx/day" msgid "Tx/day"
msgstr "" msgstr ""
@ -1042,7 +1042,7 @@ msgid "Mainnet"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:63 #: lib/block_scout_web/templates/chain/show.html.eex:62
#: lib/block_scout_web/templates/layout/app.html.eex:31 #: lib/block_scout_web/templates/layout/app.html.eex:31
#: lib/block_scout_web/views/address_view.ex:142 #: lib/block_scout_web/views/address_view.ex:142
msgid "Market Cap" msgid "Market Cap"
@ -1075,7 +1075,7 @@ msgid "More internal transactions have come in"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:241 #: lib/block_scout_web/templates/chain/show.html.eex:239
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:12 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:12
#: lib/block_scout_web/templates/transaction/index.html.eex:18 #: lib/block_scout_web/templates/transaction/index.html.eex:18
msgid "More transactions have come in" msgid "More transactions have come in"
@ -1180,7 +1180,7 @@ msgid "Potential matches from our contract method database:"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:43 #: lib/block_scout_web/templates/chain/show.html.eex:42
#: lib/block_scout_web/templates/layout/app.html.eex:32 #: lib/block_scout_web/templates/layout/app.html.eex:32
msgid "Price" msgid "Price"
msgstr "" msgstr ""
@ -1320,7 +1320,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_transaction/index.html.eex:50 #: lib/block_scout_web/templates/address_transaction/index.html.eex:50
#: lib/block_scout_web/templates/address_validation/index.html.eex:24 #: lib/block_scout_web/templates/address_validation/index.html.eex:24
#: lib/block_scout_web/templates/block_transaction/index.html.eex:23 #: lib/block_scout_web/templates/block_transaction/index.html.eex:23
#: lib/block_scout_web/templates/chain/show.html.eex:184 #: lib/block_scout_web/templates/chain/show.html.eex:182
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:21 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:21
#: lib/block_scout_web/templates/stakes/_table.html.eex:49 #: lib/block_scout_web/templates/stakes/_table.html.eex:49
#: lib/block_scout_web/templates/tokens/holder/index.html.eex:22 #: lib/block_scout_web/templates/tokens/holder/index.html.eex:22
@ -1335,7 +1335,7 @@ msgid "Something went wrong, click to reload."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:247 #: lib/block_scout_web/templates/chain/show.html.eex:245
msgid "Something went wrong, click to retry." msgid "Something went wrong, click to retry."
msgstr "" msgstr ""
@ -1464,7 +1464,7 @@ msgid "Total Supply"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:155 #: lib/block_scout_web/templates/chain/show.html.eex:154
msgid "Total blocks" msgid "Total blocks"
msgstr "" msgstr ""
@ -1606,12 +1606,12 @@ msgid "Version"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:179 #: lib/block_scout_web/templates/chain/show.html.eex:177
msgid "View All Blocks" msgid "View All Blocks"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:237 #: lib/block_scout_web/templates/chain/show.html.eex:235
msgid "View All Transactions" msgid "View All Transactions"
msgstr "" msgstr ""
@ -1653,7 +1653,7 @@ msgid "WEI"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:163 #: lib/block_scout_web/templates/chain/show.html.eex:162
msgid "Wallet addresses" msgid "Wallet addresses"
msgstr "" msgstr ""
@ -1792,7 +1792,7 @@ msgid "Module"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:134 #: lib/block_scout_web/templates/chain/show.html.eex:133
msgid "Total transactions" msgid "Total transactions"
msgstr "" msgstr ""
@ -1879,7 +1879,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_transaction/index.html.eex:17 #: lib/block_scout_web/templates/address_transaction/index.html.eex:17
#: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10
#: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18
#: lib/block_scout_web/templates/chain/show.html.eex:238 #: lib/block_scout_web/templates/chain/show.html.eex:236
#: lib/block_scout_web/templates/layout/_topnav.html.eex:55 #: lib/block_scout_web/templates/layout/_topnav.html.eex:55
#: lib/block_scout_web/views/address_view.ex:345 #: lib/block_scout_web/views/address_view.ex:345
msgid "Transactions" msgid "Transactions"

Loading…
Cancel
Save