From ebd2c8c55ce8511f8f67a77c9cf79d71b06d7ac9 Mon Sep 17 00:00:00 2001 From: ArnaudCerisier <arnaud.cerisier@gmail.com> Date: Mon, 22 May 2017 11:26:59 +0200 Subject: [PATCH] [fix] Problems corrected on Graph TX : title, filter lost, click to search #457 --- www/plugins/graph/i18n/locale-en-GB.json | 2 +- www/plugins/graph/i18n/locale-en.json | 1 + www/plugins/graph/i18n/locale-es-ES.json | 1 + www/plugins/graph/i18n/locale-fr-FR.json | 1 + www/plugins/graph/i18n/locale-nl-NL.json | 1 + .../js/controllers/blockchain-controllers.js | 18 ++++++++++++------ 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/www/plugins/graph/i18n/locale-en-GB.json b/www/plugins/graph/i18n/locale-en-GB.json index 665e2eb75..337754035 100644 --- a/www/plugins/graph/i18n/locale-en-GB.json +++ b/www/plugins/graph/i18n/locale-en-GB.json @@ -19,7 +19,7 @@ "BLOCKS_ISSUERS_LABEL": "Number of blocks", "TX_DIVIDER": "Analysis of transactions", "TX_AMOUNT_TITLE": "Transaction volume", - "TX_AMOUNT_LABEL": "Exchange volume", + "TX_AMOUNT_PUBKEY_TITLE": "Volume of transactions calculated by {{issuer | formatPubkey}}", "TX_COUNT_TITLE": "Number of written transactions", "TX_COUNT_LABEL": "Number of transactions", "TX_AVG_BY_BLOCK": "Average per block", diff --git a/www/plugins/graph/i18n/locale-en.json b/www/plugins/graph/i18n/locale-en.json index 665e2eb75..67b7b4483 100644 --- a/www/plugins/graph/i18n/locale-en.json +++ b/www/plugins/graph/i18n/locale-en.json @@ -19,6 +19,7 @@ "BLOCKS_ISSUERS_LABEL": "Number of blocks", "TX_DIVIDER": "Analysis of transactions", "TX_AMOUNT_TITLE": "Transaction volume", + "TX_AMOUNT_PUBKEY_TITLE": "Volume of transactions calculated by {{issuer | formatPubkey}}", "TX_AMOUNT_LABEL": "Exchange volume", "TX_COUNT_TITLE": "Number of written transactions", "TX_COUNT_LABEL": "Number of transactions", diff --git a/www/plugins/graph/i18n/locale-es-ES.json b/www/plugins/graph/i18n/locale-es-ES.json index 7c475c0b0..462cdf1ec 100644 --- a/www/plugins/graph/i18n/locale-es-ES.json +++ b/www/plugins/graph/i18n/locale-es-ES.json @@ -19,6 +19,7 @@ "BLOCKS_ISSUERS_LABEL": "Número de bloques", "TX_DIVIDER": "Análisis de transacciones", "TX_AMOUNT_TITLE": "El volumen de operaciones", + "TX_AMOUNT_PUBKEY_TITLE": "El volumen de operaciones calculado por {{issuer | formatPubkey}}", "TX_AMOUNT_LABEL": "Volumen negociado", "TX_COUNT_TITLE": "Número de transacciones escritas", "TX_COUNT_LABEL": "Número de transacciones", diff --git a/www/plugins/graph/i18n/locale-fr-FR.json b/www/plugins/graph/i18n/locale-fr-FR.json index 32152f141..e39f1cc9d 100644 --- a/www/plugins/graph/i18n/locale-fr-FR.json +++ b/www/plugins/graph/i18n/locale-fr-FR.json @@ -19,6 +19,7 @@ "BLOCKS_ISSUERS_LABEL": "Nombre de blocs", "TX_DIVIDER": "Analyse des transactions", "TX_AMOUNT_TITLE": "Volume des transactions", + "TX_AMOUNT_PUBKEY_TITLE": "Volume des transactions calculées par {{issuer | formatPubkey}}", "TX_AMOUNT_LABEL": "Volume échangé", "TX_COUNT_TITLE": "Nombre de transactions écrites", "TX_COUNT_LABEL": "Nombre de transactions", diff --git a/www/plugins/graph/i18n/locale-nl-NL.json b/www/plugins/graph/i18n/locale-nl-NL.json index 9d82f5978..1cc891d68 100644 --- a/www/plugins/graph/i18n/locale-nl-NL.json +++ b/www/plugins/graph/i18n/locale-nl-NL.json @@ -19,6 +19,7 @@ "BLOCKS_ISSUERS_LABEL": "Aantal blokken", "TX_DIVIDER": "Analyse van transacties", "TX_AMOUNT_TITLE": "Trading volume", + "TX_AMOUNT_PUBKEY_TITLE": "Trading volume dat wordt berekend door {{issuer | formatPubkey}}", "TX_AMOUNT_LABEL": "Verhandeld volume", "TX_COUNT_TITLE": "Aantal schriftelijke transacties", "TX_COUNT_LABEL": "Aantal transacties", diff --git a/www/plugins/graph/js/controllers/blockchain-controllers.js b/www/plugins/graph/js/controllers/blockchain-controllers.js index cc8735230..a7f0ba1a9 100644 --- a/www/plugins/graph/js/controllers/blockchain-controllers.js +++ b/www/plugins/graph/js/controllers/blockchain-controllers.js @@ -83,9 +83,12 @@ function GpBlockchainTxCountController($scope, $q, $state, $filter, $translate, return $q.all([ + $translate($scope.txOptions.issuer? + 'GRAPH.BLOCKCHAIN.TX_AMOUNT_PUBKEY_TITLE': + 'GRAPH.BLOCKCHAIN.TX_AMOUNT_TITLE', txOptions), + // translate i18n keys - $translate(['GRAPH.BLOCKCHAIN.TX_AMOUNT_TITLE', - 'GRAPH.BLOCKCHAIN.TX_AMOUNT_LABEL', + $translate(['GRAPH.BLOCKCHAIN.TX_AMOUNT_LABEL', 'GRAPH.BLOCKCHAIN.TX_COUNT_LABEL', 'GRAPH.BLOCKCHAIN.TX_AVG_BY_BLOCK', 'COMMON.DATE_PATTERN', @@ -106,11 +109,14 @@ function GpBlockchainTxCountController($scope, $q, $state, $filter, $translate, gpData.blockchain.txCount($scope.currency, txOptions) ]) .then(function(result) { - var translations = result[0]; - $scope.firstBlockTime = $scope.firstBlockTime || result[1].medianTime; + + var title = result[0]; + + var translations = result[1]; + $scope.firstBlockTime = $scope.firstBlockTime || result[2].medianTime; $scope.formData.firstBlockTime = $scope.formData.firstBlockTime || truncDate($scope.firstBlockTime); $scope.formData.currencyAge = truncDate(esHttp.date.now()) - $scope.formData.firstBlockTime; - result = result[2]; + result = result[3]; if (!result || !result.times) return; // no data $scope.times = result.times; @@ -170,7 +176,7 @@ function GpBlockchainTxCountController($scope, $q, $state, $filter, $translate, maintainAspectRatio: true, title: { display: true, - text: translations['GRAPH.BLOCKCHAIN.TX_AMOUNT_TITLE'] + text: title }, scales: { yAxes: [ -- GitLab