From 006560736adfb87bdd2f15b9cef8ee1d8014de1b Mon Sep 17 00:00:00 2001 From: Sigve Kvalsvik Date: Thu, 5 Oct 2017 14:15:21 +0200 Subject: [PATCH] Move some utility components --- app/assets/locales/locale-en.json | 3 ++- app/components/Account/AccountOverview.jsx | 7 +++++-- app/components/Account/AccountVotingProxy.jsx | 2 +- app/components/Account/AccountWhitelist.jsx | 2 +- app/components/Account/NestedApprovalState.jsx | 2 +- app/components/Account/VotingAccountsList.jsx | 2 +- app/components/Account/WorkerApproval.jsx | 2 +- app/components/Blockchain/Asset.jsx | 2 +- app/components/Blockchain/Block.jsx | 2 +- app/components/Blockchain/Operation.jsx | 4 ++-- app/components/Blockchain/ProposedOperation.jsx | 16 +++++++++++----- app/components/Blockchain/Transaction.jsx | 4 ++-- .../BlockTradesGatewayDepositRequest.jsx | 2 +- app/components/Explorer/Assets.jsx | 2 +- app/components/Explorer/Blocks.jsx | 2 +- .../LinkToAccountById.jsx | 4 ++-- .../{Blockchain => Utility}/LinkToAssetById.jsx | 6 +++--- .../LinkToWitnessById.jsx | 0 app/components/Utility/TranslateWithLinks.jsx | 4 ++-- 19 files changed, 39 insertions(+), 29 deletions(-) rename app/components/{Blockchain => Utility}/LinkToAccountById.jsx (90%) rename app/components/{Blockchain => Utility}/LinkToAssetById.jsx (75%) rename app/components/{Blockchain => Utility}/LinkToWitnessById.jsx (100%) diff --git a/app/assets/locales/locale-en.json b/app/assets/locales/locale-en.json index 7abac961e9..0efbde5686 100644 --- a/app/assets/locales/locale-en.json +++ b/app/assets/locales/locale-en.json @@ -475,7 +475,8 @@ "asset_issue": "Issue {amount} to {to} using {account}", "asset_reserve": "Reserve (burn) {amount} using {account}", "vesting_balance_withdraw": "Withdraw {amount} from vesting balance of {account}", - "feed_producer": "Update the feed producers for the asset {asset} using the account {account}" + "feed_producer": "Update the feed producers for the asset {asset} using the account {account}", + "call_order_update": "Change {account} {debtSymbol} debt by {debt} and collateral by {collateral}" }, "transaction": { "confirm": "Please confirm the transaction", diff --git a/app/components/Account/AccountOverview.jsx b/app/components/Account/AccountOverview.jsx index b9a2375d92..313b5c6802 100644 --- a/app/components/Account/AccountOverview.jsx +++ b/app/components/Account/AccountOverview.jsx @@ -18,6 +18,7 @@ import {Link} from "react-router/es"; import ChainTypes from "../Utility/ChainTypes"; import FormattedAsset from "../Utility/FormattedAsset"; import BindToChainState from "../Utility/BindToChainState"; +import LinkToAssetById from "../Utility/LinkToAssetById"; import utils from "common/utils"; import BorrowModal from "../Modal/BorrowModal"; import ReactTooltip from "react-tooltip"; @@ -207,7 +208,9 @@ class AccountOverview extends React.Component { } balances.push( - + + + {hasBalance || hasOnOrder ? : null} @@ -300,7 +303,7 @@ class AccountOverview extends React.Component { if (includeAsset && visible || !includeAsset && !visible) balances.push( - + diff --git a/app/components/Account/AccountVotingProxy.jsx b/app/components/Account/AccountVotingProxy.jsx index 0e9831e814..5fdf22bdd3 100644 --- a/app/components/Account/AccountVotingProxy.jsx +++ b/app/components/Account/AccountVotingProxy.jsx @@ -5,7 +5,7 @@ import BindToChainState from "../Utility/BindToChainState"; import ChainTypes from "../Utility/ChainTypes"; import Translate from "react-translate-component"; import AccountImage from "../Account/AccountImage"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; import {List} from "immutable"; class AccountVotingProxy extends React.Component { diff --git a/app/components/Account/AccountWhitelist.jsx b/app/components/Account/AccountWhitelist.jsx index 0348910779..10f21b99c8 100644 --- a/app/components/Account/AccountWhitelist.jsx +++ b/app/components/Account/AccountWhitelist.jsx @@ -6,7 +6,7 @@ import Immutable from "immutable"; import Translate from "react-translate-component"; import ChainTypes from "../Utility/ChainTypes"; import BindToChainState from "../Utility/BindToChainState"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; import WalletApi from "api/WalletApi"; import WalletDb from "stores/WalletDb.js"; diff --git a/app/components/Account/NestedApprovalState.jsx b/app/components/Account/NestedApprovalState.jsx index 4f5946a9ea..b43c90d687 100644 --- a/app/components/Account/NestedApprovalState.jsx +++ b/app/components/Account/NestedApprovalState.jsx @@ -3,7 +3,7 @@ import ChainTypes from "../Utility/ChainTypes"; import BindToChainState from "../Utility/BindToChainState"; import utils from "common/utils"; import Icon from "../Icon/Icon"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; import pu from "common/permission_utils"; import {cloneDeep} from "lodash"; import {ChainStore} from "bitsharesjs/es"; diff --git a/app/components/Account/VotingAccountsList.jsx b/app/components/Account/VotingAccountsList.jsx index a85d281c90..0c1b27c9ea 100644 --- a/app/components/Account/VotingAccountsList.jsx +++ b/app/components/Account/VotingAccountsList.jsx @@ -6,7 +6,7 @@ import {ChainStore} from "bitsharesjs/es"; import ChainTypes from "../Utility/ChainTypes"; import FormattedAsset from "../Utility/FormattedAsset"; import BindToChainState from "../Utility/BindToChainState"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; import counterpart from "counterpart"; function getWitnessOrCommittee(type, acct) { diff --git a/app/components/Account/WorkerApproval.jsx b/app/components/Account/WorkerApproval.jsx index 360123f5e5..4e583c646e 100644 --- a/app/components/Account/WorkerApproval.jsx +++ b/app/components/Account/WorkerApproval.jsx @@ -5,7 +5,7 @@ import utils from "common/utils"; import ChainTypes from "../Utility/ChainTypes"; import FormattedAsset from "../Utility/FormattedAsset"; import VestingBalance from "../Utility/VestingBalance"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; import BindToChainState from "../Utility/BindToChainState"; import {EquivalentValueComponent} from "../Utility/EquivalentValueComponent"; import Icon from "components/Icon/Icon"; diff --git a/app/components/Blockchain/Asset.jsx b/app/components/Blockchain/Asset.jsx index 62de1e7c4a..28500b4094 100644 --- a/app/components/Blockchain/Asset.jsx +++ b/app/components/Blockchain/Asset.jsx @@ -1,7 +1,7 @@ import React from "react"; import {Link} from "react-router/es"; import Translate from "react-translate-component"; -import LinkToAccountById from "./LinkToAccountById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; import ChainTypes from "../Utility/ChainTypes"; import BindToChainState from "../Utility/BindToChainState"; import FormattedAsset from "../Utility/FormattedAsset"; diff --git a/app/components/Blockchain/Block.jsx b/app/components/Blockchain/Block.jsx index 79a50e9146..4e4a1e7cc3 100644 --- a/app/components/Blockchain/Block.jsx +++ b/app/components/Blockchain/Block.jsx @@ -7,7 +7,7 @@ import Transaction from "./Transaction"; import Translate from "react-translate-component"; import ChainTypes from "../Utility/ChainTypes"; import BindToChainState from "../Utility/BindToChainState"; -import LinkToWitnessById from "./LinkToWitnessById"; +import LinkToWitnessById from "../Utility/LinkToWitnessById"; class TransactionList extends React.Component { diff --git a/app/components/Blockchain/Operation.jsx b/app/components/Blockchain/Operation.jsx index 7973050970..6b19af07cc 100644 --- a/app/components/Blockchain/Operation.jsx +++ b/app/components/Blockchain/Operation.jsx @@ -6,8 +6,8 @@ import Translate from "react-translate-component"; import counterpart from "counterpart"; import utils from "common/utils"; import BlockTime from "./BlockTime"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; -import LinkToAssetById from "../Blockchain/LinkToAssetById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; +import LinkToAssetById from "../Utility/LinkToAssetById"; import BindToChainState from "../Utility/BindToChainState"; import ChainTypes from "../Utility/ChainTypes"; import TranslateWithLinks from "../Utility/TranslateWithLinks"; diff --git a/app/components/Blockchain/ProposedOperation.jsx b/app/components/Blockchain/ProposedOperation.jsx index 0eac7a957c..990cf5f64e 100644 --- a/app/components/Blockchain/ProposedOperation.jsx +++ b/app/components/Blockchain/ProposedOperation.jsx @@ -6,8 +6,8 @@ import Translate from "react-translate-component"; import counterpart from "counterpart"; import market_utils from "common/market_utils"; import utils from "common/utils"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; -import LinkToAssetById from "../Blockchain/LinkToAssetById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; +import LinkToAssetById from "../Utility/LinkToAssetById"; import BindToChainState from "../Utility/BindToChainState"; import FormattedPrice from "../Utility/FormattedPrice"; import {ChainStore, ChainTypes as grapheneChainTypes} from "bitsharesjs/es"; @@ -203,9 +203,15 @@ class ProposedOperation extends React.Component { color = "warning"; column = ( - {this.linkToAccount(op[1].funding_account)}  - -  {this.linkToAsset(op[1].delta_debt.asset_id)} + ); break; diff --git a/app/components/Blockchain/Transaction.jsx b/app/components/Blockchain/Transaction.jsx index 33a6f08704..28ac3b8dd2 100644 --- a/app/components/Blockchain/Transaction.jsx +++ b/app/components/Blockchain/Transaction.jsx @@ -8,8 +8,8 @@ import classNames from "classnames"; import {FormattedDate} from "react-intl"; import Inspector from "react-json-inspector"; import utils from "common/utils"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; -import LinkToAssetById from "../Blockchain/LinkToAssetById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; +import LinkToAssetById from "../Utility/LinkToAssetById"; import FormattedPrice from "../Utility/FormattedPrice"; import account_constants from "chain/account_constants"; import Icon from "../Icon/Icon"; diff --git a/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx b/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx index f2d2a788b8..abbc926407 100644 --- a/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx +++ b/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx @@ -10,7 +10,7 @@ import ZfApi from "react-foundation-apps/src/utils/foundation-api"; import AccountBalance from "../../Account/AccountBalance"; import BlockTradesDepositAddressCache from "common/BlockTradesDepositAddressCache"; import AssetName from "components/Utility/AssetName"; -import LinkToAccountById from "components/Blockchain/LinkToAccountById"; +import LinkToAccountById from "components/Utility/LinkToAccountById"; import {requestDepositAddress} from "common/blockTradesMethods"; import { blockTradesAPIs } from "api/apiConfig"; diff --git a/app/components/Explorer/Assets.jsx b/app/components/Explorer/Assets.jsx index d73403629b..ea5f2dbea2 100644 --- a/app/components/Explorer/Assets.jsx +++ b/app/components/Explorer/Assets.jsx @@ -5,7 +5,7 @@ import SettingsActions from "actions/SettingsActions"; import {Link} from "react-router/es"; import Immutable from "immutable"; import Translate from "react-translate-component"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; import assetUtils from "common/asset_utils"; import counterpart from "counterpart"; import FormattedAsset from "../Utility/FormattedAsset"; diff --git a/app/components/Explorer/Blocks.jsx b/app/components/Explorer/Blocks.jsx index b26aaeed20..1f3fe49333 100644 --- a/app/components/Explorer/Blocks.jsx +++ b/app/components/Explorer/Blocks.jsx @@ -4,7 +4,7 @@ import BlockchainActions from "actions/BlockchainActions"; import Translate from "react-translate-component"; import {FormattedDate} from "react-intl"; import Operation from "../Blockchain/Operation"; -import LinkToWitnessById from "../Blockchain/LinkToWitnessById"; +import LinkToWitnessById from "../Utility/LinkToWitnessById"; import ChainTypes from "../Utility/ChainTypes"; import BindToChainState from "../Utility/BindToChainState"; import TransactionChart from "./TransactionChart"; diff --git a/app/components/Blockchain/LinkToAccountById.jsx b/app/components/Utility/LinkToAccountById.jsx similarity index 90% rename from app/components/Blockchain/LinkToAccountById.jsx rename to app/components/Utility/LinkToAccountById.jsx index e29bbd87ad..3196745c79 100644 --- a/app/components/Blockchain/LinkToAccountById.jsx +++ b/app/components/Utility/LinkToAccountById.jsx @@ -1,7 +1,7 @@ import React from "react"; import {Link} from "react-router/es"; -import ChainTypes from "../Utility/ChainTypes"; -import BindToChainState from "../Utility/BindToChainState"; +import ChainTypes from "./ChainTypes"; +import BindToChainState from "./BindToChainState"; class LinkToAccountById extends React.Component { diff --git a/app/components/Blockchain/LinkToAssetById.jsx b/app/components/Utility/LinkToAssetById.jsx similarity index 75% rename from app/components/Blockchain/LinkToAssetById.jsx rename to app/components/Utility/LinkToAssetById.jsx index b28c6894e1..5a5986f37e 100644 --- a/app/components/Blockchain/LinkToAssetById.jsx +++ b/app/components/Utility/LinkToAssetById.jsx @@ -1,8 +1,8 @@ import React from "react"; import {Link} from "react-router/es"; -import ChainTypes from "../Utility/ChainTypes"; -import BindToChainState from "../Utility/BindToChainState"; -import AssetName from "../Utility/AssetName"; +import ChainTypes from "./ChainTypes"; +import BindToChainState from "./BindToChainState"; +import AssetName from "./AssetName"; class LinkToAssetById extends React.Component { static propTypes = { diff --git a/app/components/Blockchain/LinkToWitnessById.jsx b/app/components/Utility/LinkToWitnessById.jsx similarity index 100% rename from app/components/Blockchain/LinkToWitnessById.jsx rename to app/components/Utility/LinkToWitnessById.jsx diff --git a/app/components/Utility/TranslateWithLinks.jsx b/app/components/Utility/TranslateWithLinks.jsx index 9b6ff012c9..8e4ff0fad8 100644 --- a/app/components/Utility/TranslateWithLinks.jsx +++ b/app/components/Utility/TranslateWithLinks.jsx @@ -1,8 +1,8 @@ import React from "react"; import counterpart from "counterpart"; import utils from "common/utils"; -import LinkToAccountById from "../Blockchain/LinkToAccountById"; -import LinkToAssetById from "../Blockchain/LinkToAssetById"; +import LinkToAccountById from "../Utility/LinkToAccountById"; +import LinkToAssetById from "../Utility/LinkToAssetById"; import {Link} from "react-router/es"; import FormattedAsset from "../Utility/FormattedAsset"; import FormattedPrice from "../Utility/FormattedPrice";