From be522dc92747b430be8ed3d6bed2fc943766b451 Mon Sep 17 00:00:00 2001 From: Viktor Baranov Date: Wed, 23 Jun 2021 16:55:11 +0300 Subject: [PATCH] Fix logo url redirection, set font-family defaults for chart.js --- CHANGELOG.md | 1 + .../js/lib/coin_balance_history_chart.js | 1 + .../assets/js/lib/history_chart.js | 6 ++-- apps/block_scout_web/assets/js/pages/chain.js | 2 +- .../assets/js/pages/stakes/utils.js | 1 + .../templates/chain/show.html.eex | 8 ++--- .../templates/layout/_footer.html.eex | 2 +- .../templates/layout/_topnav.html.eex | 2 +- apps/block_scout_web/priv/gettext/default.pot | 30 +++++++++---------- .../priv/gettext/en/LC_MESSAGES/default.po | 30 +++++++++---------- 10 files changed, 42 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41913a67a1..60ac0c7690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ### 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 - [#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 diff --git a/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js b/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js index 2b60f1726a..6624486d09 100644 --- a/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js +++ b/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js @@ -3,6 +3,7 @@ import { Chart, Filler, LineController, LineElement, PointElement, LinearScale, import 'chartjs-adapter-moment' 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) export function createCoinBalanceHistoryChart (el) { diff --git a/apps/block_scout_web/assets/js/lib/history_chart.js b/apps/block_scout_web/assets/js/lib/history_chart.js index 4ae2ed75ea..18a566ae90 100644 --- a/apps/block_scout_web/assets/js/lib/history_chart.js +++ b/apps/block_scout_web/assets/js/lib/history_chart.js @@ -7,6 +7,7 @@ import moment from 'moment' import { formatUsdValue } from '../lib/currency' 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) const grid = { @@ -281,16 +282,15 @@ export function createMarketHistoryChart (el) { break } case 'transaction': { - const transactionHistory = JSON.parse(data.history_data) + const txsHistoryData = JSON.parse(data.history_data) $(el).show() - chart.updateTransactionHistory(transactionHistory) + chart.updateTransactionHistory(txsHistoryData) break } } }) .fail(() => { - $(el).hide() $chartError.show() }) }) diff --git a/apps/block_scout_web/assets/js/pages/chain.js b/apps/block_scout_web/assets/js/pages/chain.js index 7a5e4dee79..d3efe36ada 100644 --- a/apps/block_scout_web/assets/js/pages/chain.js +++ b/apps/block_scout_web/assets/js/pages/chain.js @@ -172,7 +172,7 @@ const elements = { load () { chart = window.dashboardChart }, - render ($el, state, oldState) { + render (_$el, state, oldState) { if (!chart || (oldState.availableSupply === state.availableSupply && oldState.marketHistoryData === state.marketHistoryData) || !state.availableSupply) return chart.updateMarketHistory(state.availableSupply, state.marketHistoryData) diff --git a/apps/block_scout_web/assets/js/pages/stakes/utils.js b/apps/block_scout_web/assets/js/pages/stakes/utils.js index 084fd360cb..ef7c969197 100644 --- a/apps/block_scout_web/assets/js/pages/stakes/utils.js +++ b/apps/block_scout_web/assets/js/pages/stakes/utils.js @@ -2,6 +2,7 @@ import $ from 'jquery' import { ArcElement, Chart, DoughnutController } from 'chart.js' 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) export async function makeContractCall (call, store, gasLimit, callbackFunc) { diff --git a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex index 695f4ca386..2e1f2cc8a6 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex @@ -9,7 +9,6 @@ <%= gettext("There was a problem loading the chart.") %> + width="350" height="152"> + +
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex index e6ea5de0d9..983860c91f 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex @@ -4,7 +4,7 @@