From 1bd57566b5996b775611115b9d1e2f8b88cd5183 Mon Sep 17 00:00:00 2001 From: Alexand Andreev Date: Wed, 20 Mar 2019 13:34:42 +0300 Subject: [PATCH 01/45] CLIENT-1618: add warning seed --- src/modules/restore/templates/restore.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html index 3b68e069b6..650d406322 100644 --- a/src/modules/restore/templates/restore.html +++ b/src/modules/restore/templates/restore.html @@ -50,7 +50,10 @@ w-i18n="seedForm.saveUserData" class="footnote-1 basic-500"> - +
+
+
+
From 24c97844c0d3a93a35863c3f1a78a5bb8742e24b Mon Sep 17 00:00:00 2001 From: Alexand Andreev Date: Wed, 20 Mar 2019 15:40:09 +0300 Subject: [PATCH 02/45] CLIENT-1618: fix warning-plate --- src/modules/restore/templates/restore.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html index 650d406322..1d6f33c16b 100644 --- a/src/modules/restore/templates/restore.html +++ b/src/modules/restore/templates/restore.html @@ -50,9 +50,9 @@ w-i18n="seedForm.saveUserData" class="footnote-1 basic-500">
-
-
-
+
+
+
From 807db424f217c6694c37846985d899f2262e2f6a Mon Sep 17 00:00:00 2001 From: Alexand Andreev Date: Wed, 20 Mar 2019 16:03:53 +0300 Subject: [PATCH 03/45] CLIENT-1618: fix margin --- src/modules/restore/templates/restore.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html index 1d6f33c16b..874fbf14ae 100644 --- a/src/modules/restore/templates/restore.html +++ b/src/modules/restore/templates/restore.html @@ -50,7 +50,7 @@ w-i18n="seedForm.saveUserData" class="footnote-1 basic-500">
-
+
From d49d49f05837998faf5e389d81e3a29f4195b033 Mon Sep 17 00:00:00 2001 From: ekomarovskaya Date: Tue, 9 Apr 2019 14:24:50 +0300 Subject: [PATCH 04/45] CLIENT-1785: change asset info --- .../ui/directives/transaction/transactions.less | 13 ++++++++++++- .../ui/directives/transaction/types/exchange.html | 6 +++--- src/modules/utils/modals/sendAsset/send.modal.less | 8 +++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/modules/ui/directives/transaction/transactions.less b/src/modules/ui/directives/transaction/transactions.less index 6c798e90df..71e71709f4 100644 --- a/src/modules/ui/directives/transaction/transactions.less +++ b/src/modules/ui/directives/transaction/transactions.less @@ -173,13 +173,24 @@ w-transaction .transaction { &:last-child { padding-right: @padding-main-layout * 4.4; text-align: right; + + .top { + word-break: break-all; + } } .top { - word-break: break-all; .spam-label { display: none; } + + .flex { + flex: 0; + + .ellipsis { + max-width: 120px; + } + } } .bottom { color: @color-basic-500; diff --git a/src/modules/ui/directives/transaction/types/exchange.html b/src/modules/ui/directives/transaction/types/exchange.html index 7ae73977d5..f031f2c30e 100644 --- a/src/modules/ui/directives/transaction/types/exchange.html +++ b/src/modules/ui/directives/transaction/types/exchange.html @@ -1,9 +1,9 @@
-
- +
+ - + {{$ctrl.getAssetName($ctrl.transaction.amount.asset)}} Date: Fri, 12 Apr 2019 16:10:53 +0300 Subject: [PATCH 05/45] CLIENT-1385: lock gateways from config --- mocks/waves-client-config/master/config.json | 5 +++- .../components/singleSend/SingleSend.js | 26 ++++++++++++++++++- .../components/singleSend/single-send.html | 19 +++++--------- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/mocks/waves-client-config/master/config.json b/mocks/waves-client-config/master/config.json index d58bc3d936..62a78a1a89 100644 --- a/mocks/waves-client-config/master/config.json +++ b/mocks/waves-client-config/master/config.json @@ -7,7 +7,10 @@ "ZEC", "BCH", "DASH", - "XMR" + "XMR", + "USD", + "EUR", + "TRY" ], "CAN_TRANSFER_TRANSACTION": true, "CAN_SET_ASSET_SCRIPT_TRANSACTION": true, diff --git a/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js b/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js index b8680828cf..b74195baf4 100644 --- a/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js +++ b/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js @@ -21,6 +21,7 @@ * @param {$rootScope.Scope} $scope * @param {app.utils} utils * @param {IPollCreate} createPoll + * @param {ConfigService} configService * @param {IOuterBlockchains} outerBlockchains * @param {User} user * @param {GatewayService} gatewayService @@ -31,6 +32,7 @@ utils, createPoll, waves, + configService, outerBlockchains, user, gatewayService) { @@ -138,6 +140,15 @@ return this.toBankMode && this.termsLoadError; } + get isCoinomatAccepted() { + return configService + .get('PERMISSIONS.CAN_TRANSFER_COINOMAT').indexOf(this.balance.asset.displayName) !== -1; + } + + get isBankAccepted() { + return this.toBankMode ? this.isCoinomatAccepted : true; + } + get isBankPendingOrError() { return this.isBankError || this.isBankPending; } @@ -256,7 +267,6 @@ } $postLink() { - this.receive(utils.observe(this.tx, 'fee'), this._currentHasCommission, this); const onHasMoneyHash = () => { this.receive(utils.observe(this.state, 'toBankMode'), this._onChangeBankMode, this); @@ -272,6 +282,9 @@ this.receive(utils.observe(this.state, 'paymentId'), this._updateGatewayDetails, this); this.receive(utils.observe(this.tx, 'recipient'), this._updateGatewayDetails, this); + this.receive(utils.observe(this.state, 'paymentId'), this._updateGatewayPermisson, this); + this.receive(utils.observe(this.tx, 'recipient'), this._updateGatewayPermisson, this); + this.receive(utils.observe(this.tx, 'amount'), this._onChangeAmount, this); this.observe('gatewayDetails', this._updateWavesTxObject); @@ -284,6 +297,7 @@ this._currentHasCommission(); this._onChangeBaseAssets(); this._updateGatewayDetails(); + this._updateGatewayPermisson(); }; if (!this.state.moneyHash) { this.receiveOnce(utils.observe(this.state, 'moneyHash'), onHasMoneyHash); @@ -460,6 +474,7 @@ } this._setMinAmount(); + this._updateGatewayPermisson(); } /** @@ -515,6 +530,7 @@ this.tx.amount = this.moneyHash[this.assetId].cloneWithTokens('0'); this.mirror = this.moneyHash[this.mirrorId].cloneWithTokens('0'); this._updateGatewayDetails(); + this._updateGatewayPermisson(); // analytics.push('Send', `Send.ChangeCurrency.${WavesApp.type}`, this.assetId); } @@ -661,6 +677,13 @@ return Promise.resolve(); } + /** + * @private + */ + _updateGatewayPermisson() { + this.gatewayDetailsError = !this.isCoinomatAccepted; + } + } return new SingleSend(); @@ -672,6 +695,7 @@ 'utils', 'createPoll', 'waves', + 'configService', 'outerBlockchains', 'user', 'gatewayService' diff --git a/src/modules/utils/modals/sendAsset/components/singleSend/single-send.html b/src/modules/utils/modals/sendAsset/components/singleSend/single-send.html index 64ffb0575d..76a9085d4e 100644 --- a/src/modules/utils/modals/sendAsset/components/singleSend/single-send.html +++ b/src/modules/utils/modals/sendAsset/components/singleSend/single-send.html @@ -58,18 +58,18 @@
+ ng-if="$ctrl.toBankMode && $ctrl.termsIsPending && !$ctrl.isLira && $ctrl.isBankAccepted">
-
+
-
+
@@ -99,17 +99,12 @@
-
+
- - -
@@ -143,7 +138,7 @@
-
@@ -243,7 +238,7 @@
-
+
-
+
Date: Fri, 12 Apr 2019 16:22:04 +0300 Subject: [PATCH 06/45] CLIENT-1385: remove lira --- mocks/waves-client-config/master/config.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mocks/waves-client-config/master/config.json b/mocks/waves-client-config/master/config.json index 62a78a1a89..2207043792 100644 --- a/mocks/waves-client-config/master/config.json +++ b/mocks/waves-client-config/master/config.json @@ -9,8 +9,7 @@ "DASH", "XMR", "USD", - "EUR", - "TRY" + "EUR" ], "CAN_TRANSFER_TRANSACTION": true, "CAN_SET_ASSET_SCRIPT_TRANSACTION": true, From c4cec85f595fa174f2a2a8718659b866e0397c4a Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Fri, 12 Apr 2019 16:35:44 +0300 Subject: [PATCH 07/45] CLIENT-1385: edit layout --- src/modules/utils/modals/sendAsset/send.modal.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/utils/modals/sendAsset/send.modal.less b/src/modules/utils/modals/sendAsset/send.modal.less index f75daafffe..22f616903b 100644 --- a/src/modules/utils/modals/sendAsset/send.modal.less +++ b/src/modules/utils/modals/sendAsset/send.modal.less @@ -110,6 +110,7 @@ md-dialog.modal-send { .plate-warning { &.server-error { margin-bottom: 30px; + justify-content: center; } } From f19ecca7ede00249f78891af40b88d7b197c3a05 Mon Sep 17 00:00:00 2001 From: ekomarovskaya Date: Thu, 25 Apr 2019 18:22:26 +0300 Subject: [PATCH 08/45] CLIENT-1785: change asset info --- .../directives/transaction/transactions.less | 9 ++++- .../transaction/types/transfer.html | 2 +- .../utils/modals/sendAsset/send-header.html | 12 +++--- .../utils/modals/sendAsset/send.modal.less | 38 ++++++++++--------- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/modules/ui/directives/transaction/transactions.less b/src/modules/ui/directives/transaction/transactions.less index 71e71709f4..bc89b37439 100644 --- a/src/modules/ui/directives/transaction/transactions.less +++ b/src/modules/ui/directives/transaction/transactions.less @@ -154,7 +154,7 @@ w-transaction .transaction { .transaction-info { display: flex; flex-direction: row; - width: 100%; + width: ~'calc(100% - 88px)'; .full-width { width: 100%; @@ -168,6 +168,8 @@ w-transaction .transaction { .line { height: 50%; flex-basis: 50%; + box-sizing: border-box; + overflow: hidden; color: @color-basic-700; &:last-child { @@ -250,6 +252,11 @@ w-transaction .transaction { } } +.transaction-amounts { + max-width: 100%; + display: inline-block; +} + @media screen and (max-width: 960px) { .leasing w-transaction .transaction { .icon { diff --git a/src/modules/ui/directives/transaction/types/transfer.html b/src/modules/ui/directives/transaction/types/transfer.html index 0c1e183ccc..2561750200 100644 --- a/src/modules/ui/directives/transaction/types/transfer.html +++ b/src/modules/ui/directives/transaction/types/transfer.html @@ -12,7 +12,7 @@
-
diff --git a/src/modules/utils/modals/sendAsset/send-header.html b/src/modules/utils/modals/sendAsset/send-header.html index dd6d8098be..cf9a029669 100644 --- a/src/modules/utils/modals/sendAsset/send-header.html +++ b/src/modules/utils/modals/sendAsset/send-header.html @@ -4,11 +4,11 @@ class="input-like big flex-row split-half">
-
{{$ctrl.balance.asset.name}}
+
{{$ctrl.balance.asset.name}}
- -  {{$ctrl.balance.asset.displayName}} + +  {{$ctrl.balance.asset.displayName}}
-
{{::option.asset.name}}
+
{{::option.asset.name}}
- -  {{::option.asset.displayName}} + +  {{::option.asset.displayName}}
diff --git a/src/modules/utils/modals/sendAsset/send.modal.less b/src/modules/utils/modals/sendAsset/send.modal.less index d2e8c5ddae..d526798a92 100644 --- a/src/modules/utils/modals/sendAsset/send.modal.less +++ b/src/modules/utils/modals/sendAsset/send.modal.less @@ -171,6 +171,7 @@ md-dialog.modal-send { .asset__name { margin-left: 10px; + max-width: 122px; } .flex-row { @@ -229,30 +230,16 @@ md-dialog.modal-send { font-size: 13px; } } - } - } - .input-like { - position: relative; - padding: 0 20px; - border-radius: @border-radius; - width: 100%; - display: flex; - flex-direction: row; - align-items: center; - overflow-x: hidden; - } + &__amount { + max-width: 100px; + } + } - w-select { .title { overflow-x: hidden; } - span { - max-width: 82px; - white-space: nowrap; - } - .expanded { .select-list { margin-bottom: 40px; @@ -265,6 +252,17 @@ md-dialog.modal-send { } } + .input-like { + position: relative; + padding: 0 20px; + border-radius: @border-radius; + width: 100%; + display: flex; + flex-direction: row; + align-items: center; + overflow-x: hidden; + } + .amount-wrap { display: flex; flex-direction: row; @@ -283,6 +281,10 @@ md-dialog.modal-send { w-balance { vertical-align: top; white-space: nowrap; + + &.asset__amount { + max-width: 100px; + } } w-balance-input { From 9a2f5a04ca91abb8f729370e6cea4910f427ed9f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 26 Apr 2019 15:50:59 +0300 Subject: [PATCH 09/45] CLIENT-1822: hide usd save --- src/modules/ui/directives/transaction/Transaction.js | 6 +++--- .../ui/directives/transaction/TransactionInfoRow.js | 6 ++++-- src/modules/ui/directives/transaction/TransferGeneral.js | 1 + src/modules/ui/directives/transaction/transaction.html | 7 ++++--- .../ui/directives/transaction/transfer-general.html | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/modules/ui/directives/transaction/Transaction.js b/src/modules/ui/directives/transaction/Transaction.js index 5e0ea3f288..28a33673a8 100644 --- a/src/modules/ui/directives/transaction/Transaction.js +++ b/src/modules/ui/directives/transaction/Transaction.js @@ -20,10 +20,10 @@ this.typeName = this.transaction.typeName; this.isScam = !!user.scam[this.transaction.assetId]; if (this.transaction.type === 7) { - this.isScamAmount = !!user.scam[this.transaction.amount.asset]; - this.isScamPrice = !!user.scam[this.transaction.price.asset]; + const isScamAmount = !!user.scam[this.transaction.amount.asset]; + const isScamPrice = !!user.scam[this.transaction.price.asset]; + this.isScam = this.isScam || isScamAmount || isScamPrice; } - } cancelLeasing() { diff --git a/src/modules/ui/directives/transaction/TransactionInfoRow.js b/src/modules/ui/directives/transaction/TransactionInfoRow.js index 342f4df15c..e88801b392 100644 --- a/src/modules/ui/directives/transaction/TransactionInfoRow.js +++ b/src/modules/ui/directives/transaction/TransactionInfoRow.js @@ -14,7 +14,8 @@ this.type = this.transaction.type; this.props = { ...this.transaction, - time: $filter('date')(this.transaction.timestamp, this.datePattern || 'HH:mm') + time: $filter('date')(this.transaction.timestamp, this.datePattern || 'HH:mm'), + isScam: this.isScam }; } @@ -30,7 +31,8 @@ angular.module('app.ui').component('wTransactionInfoRow', { bindings: { transaction: '<', - datePattern: '<' + datePattern: '<', + isScam: '<' }, templateUrl: 'modules/ui/directives/transaction/transaction-info-row.html', controller diff --git a/src/modules/ui/directives/transaction/TransferGeneral.js b/src/modules/ui/directives/transaction/TransferGeneral.js index 96e3d6f7ba..83c269b9d0 100644 --- a/src/modules/ui/directives/transaction/TransferGeneral.js +++ b/src/modules/ui/directives/transaction/TransferGeneral.js @@ -24,6 +24,7 @@ time: this.props.time, address: this.props.shownAddress }; + this.isScam = this.props.isScam; const TYPES = waves.node.transactions.TYPES; diff --git a/src/modules/ui/directives/transaction/transaction.html b/src/modules/ui/directives/transaction/transaction.html index 2c13d9aac0..837fd4701c 100644 --- a/src/modules/ui/directives/transaction/transaction.html +++ b/src/modules/ui/directives/transaction/transaction.html @@ -1,9 +1,10 @@ -
+
+ date-pattern="$ctrl.datePattern" + is-scam="$ctrl.isScam"> diff --git a/src/modules/ui/directives/transaction/transfer-general.html b/src/modules/ui/directives/transaction/transfer-general.html index b839f36675..480c8f0a01 100644 --- a/src/modules/ui/directives/transaction/transfer-general.html +++ b/src/modules/ui/directives/transaction/transfer-general.html @@ -15,7 +15,7 @@
-
+
From b45faaac75e238fc5ef212f83ed779f88f19f363 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 29 Apr 2019 12:18:39 +0300 Subject: [PATCH 10/45] CLIENT-1822: delele value, price and 24hChange for spam --- .../portfolio/directives/portfolioRow/PortfolioRow.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js index ac609d6414..fa82214988 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js @@ -345,6 +345,14 @@ return null; } + if (balance.isOnScamList) { + this.node.querySelector(`.${SELECTORS.CHANGE_24}`).innerHTML = '0.00%'; + this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = '0.00'; + this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = '0.00'; + + return null; + } + this.waves.utils.getChange(balance.asset.id, baseAssetId) .then(change24 => { const change24Node = this.node.querySelector(`.${SELECTORS.CHANGE_24}`); From f2a92221f1af9ae06eef7ffb61c426298baf7edb Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 29 Apr 2019 16:24:16 +0300 Subject: [PATCH 11/45] CLIENT-1822: save --- .../portfolio/directives/portfolioRow/PortfolioRow.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js index fa82214988..2a6fad53cd 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js @@ -346,9 +346,9 @@ } if (balance.isOnScamList) { - this.node.querySelector(`.${SELECTORS.CHANGE_24}`).innerHTML = '0.00%'; - this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = '0.00'; - this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = '0.00'; + this.node.querySelector(`.${SELECTORS.CHANGE_24}`).innerHTML = '—'; + this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = '—'; + this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = '—'; return null; } From 46f52368f3434126d31e36f8c4ff4051ec04f8c8 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 29 Apr 2019 16:39:58 +0300 Subject: [PATCH 12/45] CLIENT-1822: delete usd value from transaction transfer and mass-transfer info --- .../directives/transactionInfo/types/mass-transfer/header.html | 2 +- .../transactionInfo/types/transfer/transfer-header.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/ui/directives/transactionInfo/types/mass-transfer/header.html b/src/modules/ui/directives/transactionInfo/types/mass-transfer/header.html index 4dceece4a9..3fdacc0b98 100644 --- a/src/modules/ui/directives/transactionInfo/types/mass-transfer/header.html +++ b/src/modules/ui/directives/transactionInfo/types/mass-transfer/header.html @@ -7,7 +7,7 @@ class="status-label-min inactive" w-i18n="transaction.headers.suspicious">
-
+
≈ {{::$ctrl.mirrorBalance.toFormat()}} {{::$ctrl.mirrorBalance.asset.name}}
diff --git a/src/modules/ui/directives/transactionInfo/types/transfer/transfer-header.html b/src/modules/ui/directives/transactionInfo/types/transfer/transfer-header.html index 758eb90e1d..f3d31044bb 100644 --- a/src/modules/ui/directives/transactionInfo/types/transfer/transfer-header.html +++ b/src/modules/ui/directives/transactionInfo/types/transfer/transfer-header.html @@ -7,7 +7,7 @@ class="status-label-min inactive" w-i18n="transaction.headers.suspicious">
-
+
≈ {{::$ctrl.mirrorBalance.toFormat()}} {{::$ctrl.mirrorBalance.asset.name}}
From 9f435a497631da1d3a5675d02b2344f1a047158f Mon Sep 17 00:00:00 2001 From: Alexand Andreev Date: Mon, 29 Apr 2019 16:47:35 +0300 Subject: [PATCH 13/45] CLIENT-1618: fix border --- src/modules/restore/templates/restore.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html index 10138958e0..5539f27b1c 100644 --- a/src/modules/restore/templates/restore.html +++ b/src/modules/restore/templates/restore.html @@ -46,7 +46,7 @@ w-i18n="seedForm.saveUserData" class="footnote-1 basic-500">
-
+
From 31fbe4459e36e91b9348d57a6652d1b8eb20474d Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Mon, 29 Apr 2019 17:07:40 +0300 Subject: [PATCH 14/45] CLIENT-1385: replace names of assets to ids in config --- mocks/waves-client-config/master/config.json | 20 +++---- .../master/testnet.config.json | 53 +++++++++++++++++++ server.ts | 7 ++- .../components/singleSend/SingleSend.js | 2 +- 4 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 mocks/waves-client-config/master/testnet.config.json diff --git a/mocks/waves-client-config/master/config.json b/mocks/waves-client-config/master/config.json index 18b7ee9245..2f78c5b440 100644 --- a/mocks/waves-client-config/master/config.json +++ b/mocks/waves-client-config/master/config.json @@ -1,15 +1,15 @@ { "PERMISSIONS": { "CAN_TRANSFER_COINOMAT": [ - "BTC", - "ETH", - "LTC", - "ZEC", - "BCH", - "DASH", - "XMR", - "USD", - "EUR" + "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS", + "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu", + "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk", + "BrjUWjndUanm5VsJkbUip8VRYy6LWJePtxya3FNv4TQa", + "zMFqXuoyrn5w17PFurTqxB7GsS71fp9dfk6XFwxbPCy", + "B3uGHFRpSUuGEDWjqB9LWWxafQj8VTvpMucEyoxzws5H", + "5WvPKSJXzVE2orvbkJ8wsQmmQKqTv9sGBPksV4adViw3", + "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck", + "Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU" ], "CAN_TRANSFER_TRANSACTION": true, "CAN_SET_ASSET_SCRIPT_TRANSACTION": true, @@ -58,5 +58,5 @@ ] } }, - "SERVICE_TEMPORARILY_UNAVAILABLE": true + "SERVICE_TEMPORARILY_UNAVAILABLE": false } diff --git a/mocks/waves-client-config/master/testnet.config.json b/mocks/waves-client-config/master/testnet.config.json new file mode 100644 index 0000000000..af47d7900c --- /dev/null +++ b/mocks/waves-client-config/master/testnet.config.json @@ -0,0 +1,53 @@ +{ + "PERMISSIONS": { + "CAN_TRANSFER_COINOMAT": [ + "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn", + "BrmjyAWT5jjr3Wpsiyivyvg5vDuzoX2s93WgiexXetB3", + "BNdAstuFogzSyN2rY3beJbnBYwYcu7RzTHFjW88g8roK", + "CFg2KQfkUgUVM2jFCMC5Xh8T8zrebvPc4HjHPfAugU1S", + "8HT8tXwrXAYqwm8XrZ2hywWWTUAXxobHB5DakVC1y6jn", + "DGgBtwVoXKAKKvV2ayUpSoPzTJxt7jo9KiXMJRzTH2ET", + "8oPbSCKFHkXBy1hCGSg9pJkSARE7zhTQTLpc8KZwdtr7", + "D6N2rAqWN6ZCWnCeNFWLGqqjS6nJLeK4m19XiuhdDenr", + "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ" + ], + "CAN_TRANSFER_TRANSACTION": true, + "CAN_SET_ASSET_SCRIPT_TRANSACTION": true, + "CAN_MASS_TRANSFER_TRANSACTION": true, + "CAN_CREATE_ALIAS_TRANSACTION": true, + "CAN_ISSUE_TRANSACTION": true, + "CAN_REISSUE_TRANSACTION": true, + "CAN_SET_SCRIPT_TRANSACTION": true, + "CAN_LEASE_TRANSACTION": true, + "CAN_CANCEL_LEASE_TRANSACTION": true, + "CAN_BURN_TRANSACTION": true, + "CAN_SPONSORSHIP_TRANSACTION": true, + "CAN_DATA_TRANSACTION": true, + "CAN_CREATE_ORDER": true, + "CAN_CANCEL_ORDER": true, + "CAN_PAIRING_WITH_MOBILE": true, + "CAN_ANY_TRANSACTION": true + }, + "NOTIFICATIONS": [], + "SETTINGS": { + "DEX": { + "WATCH_LIST_PAIRS": [ + "WAVES", + "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ", + "D6N2rAqWN6ZCWnCeNFWLGqqjS6nJLeK4m19XiuhdDenr", + "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn", + "BrmjyAWT5jjr3Wpsiyivyvg5vDuzoX2s93WgiexXetB3", + "BNdAstuFogzSyN2rY3beJbnBYwYcu7RzTHFjW88g8roK", + "CFg2KQfkUgUVM2jFCMC5Xh8T8zrebvPc4HjHPfAugU1S", + "8HT8tXwrXAYqwm8XrZ2hywWWTUAXxobHB5DakVC1y6jn", + "7itsmgdmomeTXvZzaaxqF3346h4FhciRoWceEw9asNV3", + "DGgBtwVoXKAKKvV2ayUpSoPzTJxt7jo9KiXMJRzTH2ET", + "FvKx3cerSVYGfXKFvUgp7koNuTAcLs8DmtmwRrFVCqJv", + "3P8gkhcLhFQvBkDzMnWeqqwvq3qxkpTNQPs4LUQ95tKD", + "8oPbSCKFHkXBy1hCGSg9pJkSARE7zhTQTLpc8KZwdtr7", + "6KSUNALdYEd1EVTE4dTcSHzNw1dA3Q6ieokSRVuEcALV" + ] + } + }, + "SERVICE_TEMPORARILY_UNAVAILABLE": false +} \ No newline at end of file diff --git a/server.ts b/server.ts index f35f9f54f9..8e949dbf01 100644 --- a/server.ts +++ b/server.ts @@ -154,7 +154,12 @@ function wavesClientConfig(req, res, next) { } let response_json = { error: 'oops' }; - const path = join(__dirname, 'mocks/waves-client-config/master/config.json'); + const connection: string = parseCookie(req.headers.cookie).connection; + const path = join( + __dirname, + `mocks/waves-client-config/master/${connection === 'mainnet' ? '' : 'testnet.'}config.json` + ); + if (fs.existsSync(path)) { response_json = JSON.parse(fs.readFileSync(path, 'utf8')) || ''; } diff --git a/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js b/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js index 5636cc3878..1fabd92f54 100644 --- a/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js +++ b/src/modules/utils/modals/sendAsset/components/singleSend/SingleSend.js @@ -142,7 +142,7 @@ get isCoinomatAccepted() { return configService - .get('PERMISSIONS.CAN_TRANSFER_COINOMAT').indexOf(this.balance.asset.displayName) !== -1; + .get('PERMISSIONS.CAN_TRANSFER_COINOMAT').indexOf(this.balance.asset.id) !== -1; } get isBankAccepted() { From 5253860b3c5dbf4e049ec481932e13106c681070 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Mon, 29 Apr 2019 17:56:51 +0300 Subject: [PATCH 15/45] CLIENT-1385: check connection exist --- server.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server.ts b/server.ts index 8e949dbf01..fe430d5727 100644 --- a/server.ts +++ b/server.ts @@ -1,7 +1,7 @@ import { createSecureServer } from 'http2'; import { createServer } from 'https'; import { route, parseArguments, stat, getLocales } from './ts-scripts/utils'; -import { readFileSync, existsSync,mkdirSync } from 'fs'; +import { readFileSync, existsSync, mkdirSync } from 'fs'; import { serialize, parse as parserCookie } from 'cookie'; import { compile } from 'handlebars'; import { parse } from 'url'; @@ -73,11 +73,11 @@ function createMyServer(port) { console.log('Available urls:'); console.log(url); const cachePath = join(process.cwd(), '.cache-download'); - if (!existsSync(cachePath)){ + if (!existsSync(cachePath)) { mkdirSync(cachePath); } getLocales(cachePath).then(() => { - const localesTimer = setInterval(function() { + const localesTimer = setInterval(function () { getLocales(cachePath) .catch(err => console.log(err)) }, 60 * 10000); @@ -148,13 +148,14 @@ function request(req, res) { } function wavesClientConfig(req, res, next) { - if (!req.url.includes('waves-client-config')) { + const connection: string | null = parseCookie(req.headers.cookie).connection; + + if (!req.url.includes('waves-client-config') || !connection) { next(); return null; } let response_json = { error: 'oops' }; - const connection: string = parseCookie(req.headers.cookie).connection; const path = join( __dirname, `mocks/waves-client-config/master/${connection === 'mainnet' ? '' : 'testnet.'}config.json` From ed5bb203fc9caeb6db5fa76259cc95036b50e122 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 29 Apr 2019 18:54:27 +0300 Subject: [PATCH 16/45] CLIENT-1822: bad fix --- .../directives/transaction/TransactionInfoRow.js | 4 ++++ .../types/mass-transfer/MassTransfer.js | 14 +++----------- .../transaction/types/transfer/Transfer.js | 14 +++----------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/modules/ui/directives/transaction/TransactionInfoRow.js b/src/modules/ui/directives/transaction/TransactionInfoRow.js index e88801b392..b379f460b7 100644 --- a/src/modules/ui/directives/transaction/TransactionInfoRow.js +++ b/src/modules/ui/directives/transaction/TransactionInfoRow.js @@ -17,6 +17,10 @@ time: $filter('date')(this.transaction.timestamp, this.datePattern || 'HH:mm'), isScam: this.isScam }; + + setTimeout(() => { + this.props.isScam = this.isScam; + }, 0); } } diff --git a/src/modules/ui/directives/transaction/types/mass-transfer/MassTransfer.js b/src/modules/ui/directives/transaction/types/mass-transfer/MassTransfer.js index 4243302def..ba65abc8d8 100644 --- a/src/modules/ui/directives/transaction/types/mass-transfer/MassTransfer.js +++ b/src/modules/ui/directives/transaction/types/mass-transfer/MassTransfer.js @@ -1,16 +1,6 @@ (function () { 'use strict'; - angular.module('app.ui').component('wTransfer', { - bindings: { - props: '<' - }, - templateUrl: 'modules/ui/directives/transaction/types/transfer/transfer.html' - }); -})(); -(function () { - 'use strict'; - /** * @param {User} user * @param {BaseAssetService} baseAssetService @@ -32,7 +22,9 @@ this.typeName = this.props.typeName; this.time = this.props.time; this.address = this.props.shownAddress; - this.isScam = this.props.isScam; + setTimeout(() => { + this.isScam = this.props.isScam; + }, 0); const TYPES = waves.node.transactions.TYPES; diff --git a/src/modules/ui/directives/transaction/types/transfer/Transfer.js b/src/modules/ui/directives/transaction/types/transfer/Transfer.js index 7de8fffcf8..505630fcc0 100644 --- a/src/modules/ui/directives/transaction/types/transfer/Transfer.js +++ b/src/modules/ui/directives/transaction/types/transfer/Transfer.js @@ -1,16 +1,6 @@ (function () { 'use strict'; - angular.module('app.ui').component('wTransfer', { - bindings: { - props: '<' - }, - templateUrl: 'modules/ui/directives/transaction/types/transfer/transfer.html' - }); -})(); -(function () { - 'use strict'; - /** * @param {User} user * @param {BaseAssetService} baseAssetService @@ -32,7 +22,9 @@ this.typeName = this.props.typeName; this.time = this.props.time; this.address = this.props.shownAddress; - this.isScam = this.props.isScam; + setTimeout(() => { + this.isScam = this.props.isScam; + }, 0); const TYPES = waves.node.transactions.TYPES; From ee3943202d4e6c3678c263bd99f332d57995e64d Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 30 Apr 2019 12:27:30 +0300 Subject: [PATCH 17/45] CLIENT-1810: set default checkbox value true --- src/modules/app/services/DefaultSettings.js | 1 + .../utils/modals/pinAsset/PinAssetCtrl.js | 7 ++++++- .../utils/modals/settings/SettingsCtrl.js | 17 +++++++++-------- src/modules/utils/modals/settings/settings.html | 4 ++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/modules/app/services/DefaultSettings.js b/src/modules/app/services/DefaultSettings.js index 09ae614c1e..1d0c05a437 100644 --- a/src/modules/app/services/DefaultSettings.js +++ b/src/modules/app/services/DefaultSettings.js @@ -31,6 +31,7 @@ lastOpenVersion: '', whatsNewList: [], closedNotification: [], + dontShowSpam: true, withScam: false, scamListUrl: WavesApp.network.scamListUrl, logoutAfterMin: 5, diff --git a/src/modules/utils/modals/pinAsset/PinAssetCtrl.js b/src/modules/utils/modals/pinAsset/PinAssetCtrl.js index 29a772469b..388d0b5aba 100644 --- a/src/modules/utils/modals/pinAsset/PinAssetCtrl.js +++ b/src/modules/utils/modals/pinAsset/PinAssetCtrl.js @@ -32,6 +32,10 @@ const R = require('ramda'); * @type {boolean} */ this.withScam = null; + /** + * @type {boolean} + */ + this.dontShowSpam = null; /** * @type {Array} */ @@ -52,7 +56,8 @@ const R = require('ramda'); this.syncSettings({ pinnedAssetIdList: 'pinnedAssetIdList', spam: 'wallet.portfolio.spam', - withScam: 'withScam' + withScam: 'withScam', + dontShowSpam: 'dontShowSpam' }); this.observe('search', this._fillList); diff --git a/src/modules/utils/modals/settings/SettingsCtrl.js b/src/modules/utils/modals/settings/SettingsCtrl.js index 97f0e6143f..a2a073fa8f 100644 --- a/src/modules/utils/modals/settings/SettingsCtrl.js +++ b/src/modules/utils/modals/settings/SettingsCtrl.js @@ -60,7 +60,7 @@ node = ''; matcher = ''; scamListUrl = ''; - withScam = false; + dontShowSpam = true; theme = user.getSetting('theme'); candle = user.getSetting('candle'); templatePromise = $templateRequest('modules/utils/modals/settings/loader.html'); @@ -98,10 +98,11 @@ matcher: 'network.matcher', logoutAfterMin: 'logoutAfterMin', scamListUrl: 'scamListUrl', - withScam: 'withScam', + dontShowSpam: 'dontShowSpam', theme: 'theme', candle: 'candle', oracleWaves: 'oracleWaves' + }); this.assetsOracleTmp = this.oracleWaves; @@ -156,12 +157,12 @@ // user.changeCandle(this.candle); // }); - this.observe('withScam', () => { - const withScam = this.withScam; - if (withScam) { - waves.node.assets.giveMyScamBack(); - } else { + this.observe('dontShowSpam', () => { + const dontShowSpam = this.dontShowSpam; + if (dontShowSpam) { waves.node.assets.stopScam(); + } else { + waves.node.assets.giveMyScamBack(); } }); @@ -213,7 +214,7 @@ setNetworkDefault() { this.node = WavesApp.network.node; this.matcher = WavesApp.network.matcher; - this.withScam = false; + this.dontShowSpam = true; this.scamListUrl = WavesApp.network.scamListUrl; this.oracleWaves = WavesApp.oracles.waves; } diff --git a/src/modules/utils/modals/settings/settings.html b/src/modules/utils/modals/settings/settings.html index 04496d5909..b20ae2693b 100644 --- a/src/modules/utils/modals/settings/settings.html +++ b/src/modules/utils/modals/settings/settings.html @@ -268,8 +268,8 @@
- - + +
From 2af0ca642c91db583ca7f7bc90f83f89f1427f2b Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 6 May 2019 11:22:06 +0300 Subject: [PATCH 18/45] CLIENT-1810: add dontShowSpam flag --- src/modules/app/services/User.js | 3 ++- .../utils/modals/settings/SettingsCtrl.js | 11 +++++----- .../portfolio/controllers/PortfolioCtrl.js | 20 +++++++++++++++---- .../portfolio/templates/portfolio.html | 2 +- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/modules/app/services/User.js b/src/modules/app/services/User.js index 4c4e34b6e5..36c64505d3 100644 --- a/src/modules/app/services/User.js +++ b/src/modules/app/services/User.js @@ -341,7 +341,8 @@ hasBackup, lng: i18next.language, theme: themes.getDefaultTheme(), - candle: 'blue' + candle: 'blue', + dontShowSpam: true } }).then(() => { if (restore) { diff --git a/src/modules/utils/modals/settings/SettingsCtrl.js b/src/modules/utils/modals/settings/SettingsCtrl.js index a2a073fa8f..dca48250ff 100644 --- a/src/modules/utils/modals/settings/SettingsCtrl.js +++ b/src/modules/utils/modals/settings/SettingsCtrl.js @@ -159,11 +159,12 @@ this.observe('dontShowSpam', () => { const dontShowSpam = this.dontShowSpam; - if (dontShowSpam) { - waves.node.assets.stopScam(); - } else { - waves.node.assets.giveMyScamBack(); - } + // if (dontShowSpam) { + // waves.node.assets.stopScam(); + // } else { + // waves.node.assets.giveMyScamBack(); + // } + user.setSetting('dontShowSpam', dontShowSpam); }); this.observe(['node', 'matcher'], () => { diff --git a/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js b/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js index 742e438457..a4345ed547 100644 --- a/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js +++ b/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js @@ -81,6 +81,10 @@ * @type {boolean} */ this.pending = true; + /** + * @type {boolean} + */ + this.dontShowSpam = user.getSetting('dontShowSpam'); waves.node.assets.getAsset(this.mirrorId) .then((mirror) => { @@ -132,7 +136,8 @@ this.syncSettings({ pinned: 'pinnedAssetIdList', spam: 'wallet.portfolio.spam', - filter: 'wallet.portfolio.filter' + filter: 'wallet.portfolio.filter', + dontShowSpam: 'dontShowSpam' }); balanceWatcher.ready @@ -144,7 +149,7 @@ this.receive(balanceWatcher.change, onChange); this.receive(utils.observe(user, 'scam'), onChange); - this.observe(['pinned', 'spam'], onChange); + this.observe(['pinned', 'spam', 'dontShowSpam'], onChange); this._updateBalances(); }); @@ -310,6 +315,7 @@ }) .reduce((acc, item) => { const oracleData = ds.dataManager.getOraclesAssetData(item.asset.id); + const spam = item.isOnScamList || item.isSpam; if (item.asset.sender === user.address) { acc.my.push(item); @@ -317,9 +323,15 @@ if (oracleData && oracleData.status > 0) { acc.verified.push(item); } - if (item.isOnScamList || item.isSpam) { - acc.spam.push(item); + + if (this.dontShowSpam) { + if (!spam) { + acc.active.push(item); + } } else { + if (spam) { + acc.spam.push(item); + } acc.active.push(item); } diff --git a/src/modules/wallet/modules/portfolio/templates/portfolio.html b/src/modules/wallet/modules/portfolio/templates/portfolio.html index 8fef20a9a5..bc96f59b34 100644 --- a/src/modules/wallet/modules/portfolio/templates/portfolio.html +++ b/src/modules/wallet/modules/portfolio/templates/portfolio.html @@ -39,7 +39,7 @@ w-i18n-ns="app.wallet.portfolio" params="{count: $ctrl.details.verified.length || 0}"> - + From 74baf167591eee45290cb7d58ac721f948cb55a0 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 6 May 2019 13:09:56 +0300 Subject: [PATCH 19/45] CLIENT-1810: delete spam from transaction list --- .../transactionList/TransactionList.js | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/modules/ui/directives/transactionList/TransactionList.js b/src/modules/ui/directives/transactionList/TransactionList.js index 293ee64c21..dda5ca7620 100644 --- a/src/modules/ui/directives/transactionList/TransactionList.js +++ b/src/modules/ui/directives/transactionList/TransactionList.js @@ -27,8 +27,16 @@ * @type {boolean} */ this.pending = false; + /** + * @type {boolean} + */ + this.dontShowSpam = user.getSetting('dontShowSpam'); + + this.syncSettings({ + dontShowSpam: 'dontShowSpam' + }); - this.observe('_transactions', this._onChangeTransactions); + this.observe(['_transactions', 'dontShowSpam'], this._onChangeTransactions); } $postLink() { @@ -39,7 +47,11 @@ * @private */ _onChangeTransactions() { - const transactions = (this._transactions || []); + let transactions = (this._transactions || []); + if (this.dontShowSpam) { + transactions = transactions.filter(this._filterSpam); + } + const hash = Object.create(null); const toDate = tsUtils.date('DD.MM.YYYY'); @@ -61,6 +73,16 @@ })); } + _filterSpam(transaction) { + const isScam = !!user.scam[transaction.assetId]; + let isScamAmount, isScamPrice; + if (transaction.type === 7) { + isScamAmount = !!user.scam[transaction.amount.asset]; + isScamPrice = !!user.scam[transaction.price.asset]; + } + return !(isScam || isScamAmount || isScamPrice); + } + } return new TransactionList(); From 3c4c88a51a39dc203059b576e4aaca9ba8d46ff6 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 6 May 2019 16:34:12 +0300 Subject: [PATCH 20/45] CLIENT-1810: disable spam view in portfolio --- .../ui/directives/actions/actions.less | 4 +++ .../portfolioRow/portfolio-row.less | 34 ++++++++++++------- .../modules/portfolio/less/portfolio.less | 10 ++++++ .../portfolio/templates/portfolio.html | 2 +- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/modules/ui/directives/actions/actions.less b/src/modules/ui/directives/actions/actions.less index d4df55faa4..2e75d8105b 100644 --- a/src/modules/ui/directives/actions/actions.less +++ b/src/modules/ui/directives/actions/actions.less @@ -57,6 +57,10 @@ w-actions { height: 4px; border-radius: 100%; background-color: @color-basic-500; + + .spam & { + background-color: @color-basic-200; + } } } diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less b/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less index 087ae0f72d..88beabb732 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less @@ -4,23 +4,27 @@ w-portfolio-row { display: flex; width: 100%; - .asset { - &__logo { - position: relative; - left: 0; + .asset { + &__logo { + position: relative; + left: 0; - .marker { - display: none; - position: absolute; - bottom: calc(50% ~'- 16px'); + .marker { + display: none; + position: absolute; + bottom: calc(50% ~'- 16px'); - &.smart-asset, - &.sponsored-asset { - display: block; - } + &.smart-asset, + &.sponsored-asset { + display: block; } } + + .spam &, .spam & .marker { + background-color: @color-basic-200 !important; + } } + } .asset { &__logo { @@ -71,4 +75,8 @@ w-portfolio-row { } } } -} \ No newline at end of file + + .spam & { + color: @color-basic-500; + } +} diff --git a/src/modules/wallet/modules/portfolio/less/portfolio.less b/src/modules/wallet/modules/portfolio/less/portfolio.less index 6b4afad336..1d1285140f 100644 --- a/src/modules/wallet/modules/portfolio/less/portfolio.less +++ b/src/modules/wallet/modules/portfolio/less/portfolio.less @@ -122,6 +122,16 @@ i.toggler { display: none; } + + &.spam { + .smart-table__cell:last-child { + .cell { + span.icon svg { + fill: @color-basic-200; + } + } + } + } } .z-top { diff --git a/src/modules/wallet/modules/portfolio/templates/portfolio.html b/src/modules/wallet/modules/portfolio/templates/portfolio.html index bc96f59b34..910bb1fb01 100644 --- a/src/modules/wallet/modules/portfolio/templates/portfolio.html +++ b/src/modules/wallet/modules/portfolio/templates/portfolio.html @@ -55,7 +55,7 @@ header-info="$ctrl.tableHeaders"> - + From 328d4a8a548212c63af6d73462b69de1b768e965 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 6 May 2019 17:01:40 +0300 Subject: [PATCH 21/45] CLIENT-1810: save --- .../portfolio/controllers/PortfolioCtrl.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js b/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js index a4345ed547..4719ade88f 100644 --- a/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js +++ b/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js @@ -317,20 +317,21 @@ const oracleData = ds.dataManager.getOraclesAssetData(item.asset.id); const spam = item.isOnScamList || item.isSpam; - if (item.asset.sender === user.address) { - acc.my.push(item); - } if (oracleData && oracleData.status > 0) { acc.verified.push(item); } - if (this.dontShowSpam) { - if (!spam) { + if (spam) { + if (!this.dontShowSpam) { + if (item.asset.sender === user.address) { + acc.my.push(item); + } + acc.spam.push(item); acc.active.push(item); } } else { - if (spam) { - acc.spam.push(item); + if (item.asset.sender === user.address) { + acc.my.push(item); } acc.active.push(item); } From 541f8999d012a88fe05705e439d070f2b5e92a4c Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 6 May 2019 17:30:59 +0300 Subject: [PATCH 22/45] CLIENT-1810: fix help icon content --- src/modules/utils/modals/settings/settings.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/utils/modals/settings/settings.html b/src/modules/utils/modals/settings/settings.html index b20ae2693b..febaa71c10 100644 --- a/src/modules/utils/modals/settings/settings.html +++ b/src/modules/utils/modals/settings/settings.html @@ -262,6 +262,7 @@
+
From 7936e5201284e0c315d8828f79c4d0772ee6b0bf Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 7 May 2019 11:48:05 +0300 Subject: [PATCH 23/45] CLIENT-1810: add scamListUrl observe --- .../app/services/waves/node/content/Assets.js | 14 ++++++++------ src/modules/utils/modals/settings/SettingsCtrl.js | 12 +++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/modules/app/services/waves/node/content/Assets.js b/src/modules/app/services/waves/node/content/Assets.js index 89bdf03606..0a2a47dab9 100644 --- a/src/modules/app/services/waves/node/content/Assets.js +++ b/src/modules/app/services/waves/node/content/Assets.js @@ -21,9 +21,10 @@ constructor() { super(); user.onLogin().then(() => { - - if (!user.getSetting('withScam')) { + if (user.getSetting('scamListUrl')) { this.stopScam(); + } else { + this.giveMyScamBack(); } }); } @@ -133,9 +134,9 @@ } stopScam() { - if (this._pollScam) { - return null; - } + // if (this._pollScam) { + // return null; + // } /** * @type {Poll} * @private @@ -158,7 +159,8 @@ } }); return hash; - }); + }) + .catch(() => Object.create(null)); } /** diff --git a/src/modules/utils/modals/settings/SettingsCtrl.js b/src/modules/utils/modals/settings/SettingsCtrl.js index dca48250ff..3a43d0cc8c 100644 --- a/src/modules/utils/modals/settings/SettingsCtrl.js +++ b/src/modules/utils/modals/settings/SettingsCtrl.js @@ -159,14 +159,16 @@ this.observe('dontShowSpam', () => { const dontShowSpam = this.dontShowSpam; - // if (dontShowSpam) { - // waves.node.assets.stopScam(); - // } else { - // waves.node.assets.giveMyScamBack(); - // } user.setSetting('dontShowSpam', dontShowSpam); }); + this.observe('scamListUrl', () => { + ds.config.setConfig({ + scamListUrl: this.scamListUrl + }); + waves.node.assets.stopScam(); + }); + this.observe(['node', 'matcher'], () => { ds.config.setConfig({ node: this.node, From 7a028920785964a9e5ab22207949c782556c8aca Mon Sep 17 00:00:00 2001 From: ekomarovskaya Date: Tue, 7 May 2019 12:54:20 +0300 Subject: [PATCH 24/45] CLIENT-1842: add-class-active-button --- src/img/icons/orderbook-to-spread-active.svg | 3 +++ src/modules/app/less/app-icons.less | 7 +++++++ src/modules/dex/directives/dexBlock/dexBlock.less | 8 ++++++++ src/themeConfig/black/icons.less | 1 + src/themeConfig/default/icons.less | 1 + 5 files changed, 20 insertions(+) create mode 100644 src/img/icons/orderbook-to-spread-active.svg diff --git a/src/img/icons/orderbook-to-spread-active.svg b/src/img/icons/orderbook-to-spread-active.svg new file mode 100644 index 0000000000..72e63883ba --- /dev/null +++ b/src/img/icons/orderbook-to-spread-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/modules/app/less/app-icons.less b/src/modules/app/less/app-icons.less index ed7b9237a3..780d8f62f2 100644 --- a/src/modules/app/less/app-icons.less +++ b/src/modules/app/less/app-icons.less @@ -394,6 +394,13 @@ background-position: center center; } +.icon-dex-tospread-active { + display: inline-block; + background-repeat: no-repeat; + background-position: center center; + background-image: @orderbook-to-spread-icon-active; +} + .apple-store-btn, .google-play-btn { width: 135px; diff --git a/src/modules/dex/directives/dexBlock/dexBlock.less b/src/modules/dex/directives/dexBlock/dexBlock.less index b48b2d93f7..ca81a2169d 100644 --- a/src/modules/dex/directives/dexBlock/dexBlock.less +++ b/src/modules/dex/directives/dexBlock/dexBlock.less @@ -59,6 +59,14 @@ w-dex-block { i.tospread:hover { background-color: @color-basic-100; } + + &.active { + cursor: default; + i.tospread { + background: @color-submit-400; + .icon-dex-tospread-active(); + } + } } .dex-block-content { diff --git a/src/themeConfig/black/icons.less b/src/themeConfig/black/icons.less index 6bcdde70e0..69035d2e8d 100644 --- a/src/themeConfig/black/icons.less +++ b/src/themeConfig/black/icons.less @@ -11,6 +11,7 @@ @dex-toggle-icon: url(/img/icons/dark/dex-toggle.svg); @dex-copybalance-icon: url(/img/icons/dark/dex-copy-icon.svg); @orderbook-to-spread-icon: url(/img/icons/dark/orderbook-to-spread.svg); +@orderbook-to-spread-icon-active: url(/img/icons/orderbook-to-spread-active.svg); @arrow-orderbook-top-icon: url(/img/icons/dark/arrow-orderbook-top.svg); @arrow-orderbook-down-icon: url(/img/icons/dark/arrow-orderbook-down.svg); @empty-icon: url(/img/icons/dark/icon-empty.svg); diff --git a/src/themeConfig/default/icons.less b/src/themeConfig/default/icons.less index a16690abd4..8ce3846085 100644 --- a/src/themeConfig/default/icons.less +++ b/src/themeConfig/default/icons.less @@ -11,6 +11,7 @@ @dex-toggle-icon: url(/img/icons/dex-toggle.svg); @dex-copybalance-icon: url(/img/icons/dex-copy-icon.svg); @orderbook-to-spread-icon: url(/img/icons/orderbook-to-spread.svg); +@orderbook-to-spread-icon-active: url(/img/icons/orderbook-to-spread-active.svg); @arrow-orderbook-top-icon: url(/img/icons/arrow-orderbook-top.svg); @arrow-orderbook-down-icon: url(/img/icons/arrow-orderbook-down.svg); @empty-icon: url(/img/icons/icon-empty.svg); From e3e3bb4168cd34727d2ddb9962ffbca477ddf7f0 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 7 May 2019 18:16:52 +0300 Subject: [PATCH 25/45] CLIENT-1810: save --- src/modules/app/services/waves/node/content/Assets.js | 1 + .../portfolio/directives/portfolioRow/portfolio-row.less | 5 +++++ .../wallet/modules/portfolio/directives/portfolioRow/row.hbs | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/app/services/waves/node/content/Assets.js b/src/modules/app/services/waves/node/content/Assets.js index 0a2a47dab9..a70711a2f3 100644 --- a/src/modules/app/services/waves/node/content/Assets.js +++ b/src/modules/app/services/waves/node/content/Assets.js @@ -170,6 +170,7 @@ _setScamAssetList(hash) { if (!equals(hash, user.scam)) { user.scam = hash; + user.setSetting('scam', hash); } } diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less b/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less index 88beabb732..7bba869890 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less @@ -79,4 +79,9 @@ w-portfolio-row { .spam & { color: @color-basic-500; } + + //div:not(.spam) > & .cell span.suspicious-label { + // display: none; + //} + } diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs b/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs index ce14d5e700..e91c19044a 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs @@ -23,7 +23,7 @@ {{/if}} {{#if isSpam}} - + {{/if}}
From 635e2541ef7a88f7b4b9973117fc56d892ef0a72 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 7 May 2019 18:37:35 +0300 Subject: [PATCH 26/45] CLIENT-1810: transaction observe user scam --- .../ui/directives/transaction/Transaction.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/ui/directives/transaction/Transaction.js b/src/modules/ui/directives/transaction/Transaction.js index 5e0ea3f288..50c6a20d56 100644 --- a/src/modules/ui/directives/transaction/Transaction.js +++ b/src/modules/ui/directives/transaction/Transaction.js @@ -16,13 +16,25 @@ const { SIGN_TYPE } = require('@waves/signature-adapter'); class Transaction extends Base { - $postLink() { - this.typeName = this.transaction.typeName; + setScam() { this.isScam = !!user.scam[this.transaction.assetId]; if (this.transaction.type === 7) { this.isScamAmount = !!user.scam[this.transaction.amount.asset]; this.isScamPrice = !!user.scam[this.transaction.price.asset]; } + } + + $postLink() { + this.typeName = this.transaction.typeName; + this.setScam(); + + this.syncSettings({ + scam: 'scam' + }); + + this.observe('scam', () => { + this.setScam(); + }); } From d4f962aab4a19aeadbb3eee4399550c3910b5bef Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Tue, 7 May 2019 18:50:20 +0300 Subject: [PATCH 27/45] CLIENT-1842: added logic to scroll to spread btn --- src/modules/dex/directives/dexBlock/DexBlock.js | 3 ++- src/modules/dex/directives/dexBlock/dexBlock.html | 6 +++++- src/modules/dex/directives/orderBook/OrderBook.js | 13 +++++++++++++ src/modules/dex/templates/dex.html | 3 ++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/modules/dex/directives/dexBlock/DexBlock.js b/src/modules/dex/directives/dexBlock/DexBlock.js index 0e36211c44..77c561e3e5 100644 --- a/src/modules/dex/directives/dexBlock/DexBlock.js +++ b/src/modules/dex/directives/dexBlock/DexBlock.js @@ -99,7 +99,8 @@ block: '@', hasSearch: '@', canCollapse: '@', - analyticsText: '<' + analyticsText: '<', + isActiveScroll: '<' }, templateUrl: 'modules/dex/directives/dexBlock/dexBlock.html', transclude: true, diff --git a/src/modules/dex/directives/dexBlock/dexBlock.html b/src/modules/dex/directives/dexBlock/dexBlock.html index d7a254a8bc..8f5d3e95e1 100644 --- a/src/modules/dex/directives/dexBlock/dexBlock.html +++ b/src/modules/dex/directives/dexBlock/dexBlock.html @@ -14,7 +14,11 @@
-
+
+ +
diff --git a/src/modules/dex/directives/orderBook/OrderBook.js b/src/modules/dex/directives/orderBook/OrderBook.js index 6619fc1366..2182934157 100644 --- a/src/modules/dex/directives/orderBook/OrderBook.js +++ b/src/modules/dex/directives/orderBook/OrderBook.js @@ -107,6 +107,11 @@ * @private */ this._dom = null; + /** + * @type {boolean} + * @public + */ + this.isScrolled = false; this.receive(dexDataService.showSpread, () => { this._dom.$box.stop().animate({ scrollTop: this._getSpreadScrollPosition() }, 300); @@ -176,6 +181,11 @@ $lastPrice: { get: () => this._dom.$info.find(SECTIONS.LAST_PRICE) }, $spread: { get: () => this._dom.$info.find(SECTIONS.SPREAD) } }); + this._dom.$box.on('scroll', () => { + const scrollPos = this._dom.$box[0].scrollTop; + const spreadPos = this._getSpreadScrollPosition(); + this.isScrolled = Math.abs(scrollPos - spreadPos) >= 2; + }); } nothingFound() { @@ -470,6 +480,9 @@ angular.module('app.dex').component('wDexOrderBook', { templateUrl: 'modules/dex/directives/orderBook/orderBook.html', + bindings: { + isScrolled: '=' + }, controller }); })(); diff --git a/src/modules/dex/templates/dex.html b/src/modules/dex/templates/dex.html index d9b0986fd3..8adb51e598 100644 --- a/src/modules/dex/templates/dex.html +++ b/src/modules/dex/templates/dex.html @@ -10,8 +10,9 @@ - + Date: Wed, 8 May 2019 11:55:07 +0300 Subject: [PATCH 28/45] CLIENT-1810: add updating scam in balance --- .../directives/portfolioRow/PortfolioRow.js | 39 ++++++++++++------- .../portfolioRow/portfolio-row.less | 4 -- .../portfolio/directives/portfolioRow/row.hbs | 4 +- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js index d532c2267f..9aed8163be 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js @@ -83,7 +83,8 @@ SPONSORSHIP_EDIT: 'js-action-button-sponsorship_edit', SPONSORSHIP_STOP: 'js-action-button-cancel-sponsorship', SET_ASSET_SCRIPT: 'js-action-button-set-asset-script' - } + }, + SUSPICIOUS_LABEL: 'js-suspicious-label' }; const ds = require('data-service'); @@ -249,8 +250,7 @@ canShowToggleSpam: this._canShowToggleSpam(), canSponsored: this._isMyAsset, canPayFee, - canStopSponsored, - isSpam: this.balance.isOnScamList + canStopSponsored }); this.node.innerHTML = html; @@ -260,7 +260,8 @@ set: (value) => { if (this.balance.asset.id !== value.asset.id || !this.balance.available.getTokens().eq(value.available.getTokens()) || - !this.balance.inOrders.getTokens().eq(value.inOrders.getTokens()) + !this.balance.inOrders.getTokens().eq(value.inOrders.getTokens()) || + this.balance.isOnScamList !== value.isOnScamList ) { balance = value; this._onUpdateBalance(); @@ -334,6 +335,21 @@ this._initSpamState(); const balance = this.balance; + + if (balance.isOnScamList) { + this.node.querySelector(`.${SELECTORS.CHANGE_24}`).innerHTML = '—'; + this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = '—'; + this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = '—'; + this.node.querySelector(`.${SELECTORS.SUSPICIOUS_LABEL}`).classList.remove('hidden'); + + return null; + } else { + const suspiciousSelector = this.node.querySelector(`.${SELECTORS.SUSPICIOUS_LABEL}`); + if (suspiciousSelector) { + suspiciousSelector.classList.add('hidden'); + } + } + const baseAssetId = this.user.getSetting('baseAssetId'); if (baseAssetId === balance.asset.id) { @@ -347,14 +363,6 @@ return null; } - if (balance.isOnScamList) { - this.node.querySelector(`.${SELECTORS.CHANGE_24}`).innerHTML = '—'; - this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = '—'; - this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = '—'; - - return null; - } - this.waves.utils.getChange(balance.asset.id, baseAssetId) .then(change24 => { const change24Node = this.node.querySelector(`.${SELECTORS.CHANGE_24}`); @@ -573,10 +581,11 @@ this.node.querySelector(`.${SELECTORS.BUTTONS.TOGGLE_SPAM}`), this.node.querySelector(`.${SELECTORS.ACTION_BUTTONS.TOGGLE_SPAM}`) ]; - elements.forEach(toggleSpam => { - toggleSpam.classList.toggle('icon-hide', !isSpam); - toggleSpam.classList.toggle('icon-show', isSpam); + if (toggleSpam) { + toggleSpam.classList.toggle('icon-hide', !isSpam); + toggleSpam.classList.toggle('icon-show', isSpam); + } }); } diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less b/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less index 7bba869890..a96b6988f5 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less @@ -80,8 +80,4 @@ w-portfolio-row { color: @color-basic-500; } - //div:not(.spam) > & .cell span.suspicious-label { - // display: none; - //} - } diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs b/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs index e91c19044a..d196585b47 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs @@ -22,9 +22,7 @@ {{#if isTokenomica}} {{/if}} - {{#if isSpam}} - - {{/if}} +
From 916da9751193da7cefe4d6969d1c660b8fc212c1 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 13 May 2019 12:31:18 +0300 Subject: [PATCH 29/45] CLIENT-1810: add TODO --- src/modules/ui/directives/transaction/TransactionInfoRow.js | 1 + .../ui/directives/transaction/types/transfer/Transfer.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/modules/ui/directives/transaction/TransactionInfoRow.js b/src/modules/ui/directives/transaction/TransactionInfoRow.js index b379f460b7..be9f5d2988 100644 --- a/src/modules/ui/directives/transaction/TransactionInfoRow.js +++ b/src/modules/ui/directives/transaction/TransactionInfoRow.js @@ -18,6 +18,7 @@ isScam: this.isScam }; + // TODO: delete setTimeout setTimeout(() => { this.props.isScam = this.isScam; }, 0); diff --git a/src/modules/ui/directives/transaction/types/transfer/Transfer.js b/src/modules/ui/directives/transaction/types/transfer/Transfer.js index 505630fcc0..978ada43ee 100644 --- a/src/modules/ui/directives/transaction/types/transfer/Transfer.js +++ b/src/modules/ui/directives/transaction/types/transfer/Transfer.js @@ -22,6 +22,8 @@ this.typeName = this.props.typeName; this.time = this.props.time; this.address = this.props.shownAddress; + + // TODO: delete setTimeout setTimeout(() => { this.isScam = this.props.isScam; }, 0); From f1f784df48afe14eb437d564830442521defadc2 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 13 May 2019 16:38:17 +0300 Subject: [PATCH 30/45] CLIENT-1810: refactoring setScam --- src/modules/app/services/User.js | 16 ++++++++++ .../app/services/waves/node/content/Assets.js | 6 +--- .../ui/directives/transaction/Transaction.js | 29 +++++++++---------- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/modules/app/services/User.js b/src/modules/app/services/User.js index 36c64505d3..360ff75aa3 100644 --- a/src/modules/app/services/User.js +++ b/src/modules/app/services/User.js @@ -2,6 +2,8 @@ (function () { 'use strict'; + const { equals } = require('ramda'); + /* global Mousetrap */ @@ -11,6 +13,7 @@ 'extraFee', 'networkError', 'changeScript', + 'setScamSignal', 'scam' ]; @@ -104,6 +107,10 @@ * @type {Signal} */ changeScript = new tsUtils.Signal(); + /** + * @type {Signal} + */ + setScamSignal = new tsUtils.Signal(); /** * @type {Record} */ @@ -174,7 +181,16 @@ setTimeout(() => { this._scriptInfoPoll = new Poll(() => this.updateScriptAccountData(), () => null, 10000); }, 30000); + }); + + } + + setScam(hash) { + if (!equals(hash, this.scam)) { + this.scam = hash; + this.setScamSignal.dispatch(); + } } /** diff --git a/src/modules/app/services/waves/node/content/Assets.js b/src/modules/app/services/waves/node/content/Assets.js index a70711a2f3..91f3a121b9 100644 --- a/src/modules/app/services/waves/node/content/Assets.js +++ b/src/modules/app/services/waves/node/content/Assets.js @@ -3,7 +3,6 @@ 'use strict'; const entities = require('@waves/data-entities'); - const { equals } = require('ramda'); /** * @param {BaseNodeComponent} BaseNodeComponent @@ -168,10 +167,7 @@ * @private */ _setScamAssetList(hash) { - if (!equals(hash, user.scam)) { - user.scam = hash; - user.setSetting('scam', hash); - } + user.setScam(hash); } /** diff --git a/src/modules/ui/directives/transaction/Transaction.js b/src/modules/ui/directives/transaction/Transaction.js index de3f26b76a..140d12f2ee 100644 --- a/src/modules/ui/directives/transaction/Transaction.js +++ b/src/modules/ui/directives/transaction/Transaction.js @@ -8,14 +8,25 @@ * @param {INotification} notification * @param {Waves} waves * @param {User} user + * @param {$rootScope.Scope} $scope * @return {Transaction} */ const controller = function (Base, $filter, modalManager, notification, - waves, user) { + waves, user, $scope) { const { SIGN_TYPE } = require('@waves/signature-adapter'); class Transaction extends Base { + $postLink() { + this.typeName = this.transaction.typeName; + this.setScam(); + + this.receive(user.setScamSignal, () => { + this.setScam(); + $scope.$apply(); + }); + } + setScam() { this.isScam = !!user.scam[this.transaction.assetId]; if (this.transaction.type === 7) { @@ -25,19 +36,6 @@ } } - $postLink() { - this.typeName = this.transaction.typeName; - this.setScam(); - - this.syncSettings({ - scam: 'scam' - }); - - this.observe('scam', () => { - this.setScam(); - }); - } - cancelLeasing() { const lease = this.transaction; const leaseId = lease.id; @@ -128,7 +126,8 @@ 'modalManager', 'notification', 'waves', - 'user' + 'user', + '$scope' ]; angular.module('app.ui') From 64d4ff7989c063e840679a14856ba61d5344510f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 14 May 2019 11:46:06 +0300 Subject: [PATCH 31/45] CLIENT-1851: align price with zeros --- src/modules/dex/less/dex.less | 4 ---- src/modules/utils/services/utils.js | 33 +++++++++++++++++------------ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/modules/dex/less/dex.less b/src/modules/dex/less/dex.less index 76e9f12041..1d2bb930d1 100644 --- a/src/modules/dex/less/dex.less +++ b/src/modules/dex/less/dex.less @@ -424,10 +424,6 @@ body.dex, body.dex-demo { &__cell { white-space: nowrap; - - .decimal-muted { - display: none; - } } } diff --git a/src/modules/utils/services/utils.js b/src/modules/utils/services/utils.js index df75e20bea..7e61e8e50c 100644 --- a/src/modules/utils/services/utils.js +++ b/src/modules/utils/services/utils.js @@ -1018,15 +1018,11 @@ } else { const separatorDecimal = WavesApp.getLocaleData().separators.decimal; const [int, decimal] = formatted.split(separatorDecimal); - if (decimal) { - const decimalTpl = _processDecimal(decimal, separatorDecimal); - return ( - `${int}` + - `${decimalTpl}` - ); - } else { - return `${int}`; - } + const decimalTpl = _processDecimal(decimal, separatorDecimal); + return ( + `${int}` + + `${decimalTpl}` + ); } }, @@ -1776,6 +1772,18 @@ */ function _processDecimal(decimal, separator) { const mute = []; + const maxPrecision = 8; + + const getZerosString = (length) => { + return Array(length).fill('0').join(''); + }; + + if (!decimal) { + decimal = getZerosString(maxPrecision); + } else if (decimal.length < maxPrecision) { + decimal += getZerosString(maxPrecision - decimal.length); + } + decimal.split('') .reverse() .some((char) => { @@ -1785,11 +1793,10 @@ } return true; }); + const end = decimal.length - mute.length; - if (end) { - return `${separator}${decimal.substr(0, end)}${mute.join('')}`; - } - return `${separator}${mute.join('')}`; + + return `${separator}${decimal.substr(0, end)}${mute.join('')}`; } function _getObserver(target) { From ad10765345732734d97de9644d71e530e6e013bd Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 14 May 2019 16:23:35 +0300 Subject: [PATCH 32/45] CLIENT-1851: revert and add color --- src/modules/dex/less/dex.less | 4 ++++ src/modules/utils/services/utils.js | 33 ++++++++++++----------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/modules/dex/less/dex.less b/src/modules/dex/less/dex.less index 1d2bb930d1..6fee149461 100644 --- a/src/modules/dex/less/dex.less +++ b/src/modules/dex/less/dex.less @@ -424,6 +424,10 @@ body.dex, body.dex-demo { &__cell { white-space: nowrap; + + .decimal-muted { + color: @color-disabled-500; + } } } diff --git a/src/modules/utils/services/utils.js b/src/modules/utils/services/utils.js index 7e61e8e50c..df75e20bea 100644 --- a/src/modules/utils/services/utils.js +++ b/src/modules/utils/services/utils.js @@ -1018,11 +1018,15 @@ } else { const separatorDecimal = WavesApp.getLocaleData().separators.decimal; const [int, decimal] = formatted.split(separatorDecimal); - const decimalTpl = _processDecimal(decimal, separatorDecimal); - return ( - `${int}` + - `${decimalTpl}` - ); + if (decimal) { + const decimalTpl = _processDecimal(decimal, separatorDecimal); + return ( + `${int}` + + `${decimalTpl}` + ); + } else { + return `${int}`; + } } }, @@ -1772,18 +1776,6 @@ */ function _processDecimal(decimal, separator) { const mute = []; - const maxPrecision = 8; - - const getZerosString = (length) => { - return Array(length).fill('0').join(''); - }; - - if (!decimal) { - decimal = getZerosString(maxPrecision); - } else if (decimal.length < maxPrecision) { - decimal += getZerosString(maxPrecision - decimal.length); - } - decimal.split('') .reverse() .some((char) => { @@ -1793,10 +1785,11 @@ } return true; }); - const end = decimal.length - mute.length; - - return `${separator}${decimal.substr(0, end)}${mute.join('')}`; + if (end) { + return `${separator}${decimal.substr(0, end)}${mute.join('')}`; + } + return `${separator}${mute.join('')}`; } function _getObserver(target) { From 3dc72b2aaeada8a9f19aa9cb345189cb26d62ce2 Mon Sep 17 00:00:00 2001 From: tsigel Date: Wed, 15 May 2019 12:55:52 +0300 Subject: [PATCH 33/45] CLIENT-1822: fix transaction --- .../transaction/types/transfer/Transfer.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/modules/ui/directives/transaction/types/transfer/Transfer.js b/src/modules/ui/directives/transaction/types/transfer/Transfer.js index 505630fcc0..ae626e1532 100644 --- a/src/modules/ui/directives/transaction/types/transfer/Transfer.js +++ b/src/modules/ui/directives/transaction/types/transfer/Transfer.js @@ -2,29 +2,33 @@ 'use strict'; /** + * @param {typeof Base} Base * @param {User} user * @param {BaseAssetService} baseAssetService * @param {Waves} waves * @param {$rootScope.Scope} $scope + * @param {app.utils} utils * @return {Transfer} */ - const controller = function (user, baseAssetService, waves, $scope) { + const controller = function (Base, user, baseAssetService, waves, $scope, utils) { - class Transfer { + class Transfer extends Base { /** - * {object} + * @type object */ - props = null; + props = Object.create(null); $postLink() { this.typeName = this.props.typeName; this.time = this.props.time; this.address = this.props.shownAddress; - setTimeout(() => { + + this.receive(utils.observe(this.props, 'isScam'), () => { this.isScam = this.props.isScam; - }, 0); + utils.safeApply($scope); + }); const TYPES = waves.node.transactions.TYPES; @@ -82,10 +86,12 @@ }; controller.$inject = [ + 'Base', 'user', 'baseAssetService', 'waves', - '$scope' + '$scope', + 'utils' ]; angular.module('app.ui').component('wTransferRow', { From 24514f8ee1db5c4678454165df430d5fefdd8b8d Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 15 May 2019 17:54:03 +0300 Subject: [PATCH 34/45] CLIENT-1497: fix --- data-service/api/transactions/interface.d.ts | 9 ++++++++- data-service/api/transactions/parse.ts | 12 ++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/data-service/api/transactions/interface.d.ts b/data-service/api/transactions/interface.d.ts index 5f6f447d1e..2f2840f269 100644 --- a/data-service/api/transactions/interface.d.ts +++ b/data-service/api/transactions/interface.d.ts @@ -288,7 +288,7 @@ export interface IMassTransfer extends IBaseTransaction { export interface IData extends IBaseTransaction { type: TRANSACTION_TYPE_NUMBER.DATA; version?: number; - data: Array; + data: Array; stringifiedData: string; fee: Money; } @@ -340,6 +340,7 @@ export interface ICall { } export type TDataEntry = TDataEntryInteger | TDataEntryBoolean | TDataEntryBinary | TDataEntryString; +export type TDataReturned = TDataBigNumber | TDataEntryBoolean | TDataEntryBinary | TDataEntryString; export interface TDataEntryInteger { type: 'integer'; @@ -365,6 +366,12 @@ export interface TDataEntryString { value: string; } +export interface TDataBigNumber { + type: 'integer'; + key: string; + value: BigNumber; +} + export type TCallArgs = TCallArgsInteger | TCallArgsBoolean | TCallArgsBinary | TCallArgsString; export interface TCallArgsInteger { diff --git a/data-service/api/transactions/parse.ts b/data-service/api/transactions/parse.ts index 4a9f7d743e..01a3b36131 100644 --- a/data-service/api/transactions/parse.ts +++ b/data-service/api/transactions/parse.ts @@ -264,8 +264,16 @@ export function parseExchangeOrder(factory: IFactory, order: txApi.IExchangeOrde export function parseDataTx(tx: txApi.IData, assetsHash: IHash, isUTX: boolean): IData { const fee = new Money(tx.fee, assetsHash[WAVES_ID]); - const stringifiedData = JSON.stringify(tx.data, null, 4); - return { ...tx, stringifiedData, fee, isUTX }; + const data = tx.data.map((dataItem) => { + if (dataItem.type === 'integer') { + return { ...dataItem, value: new BigNumber(dataItem.value) }; + } else { + return dataItem; + } + }); + const txWithBigNumber = { ...tx, data }; + const stringifiedData = JSON.stringify(txWithBigNumber.data, null, 4); + return { ...txWithBigNumber, stringifiedData, fee, isUTX }; } export function parseInvocationTx(tx: txApi.IScriptInvocation, assetsHash: IHash, isUTX: boolean): IScriptInvocation { From e46def2ac70a2d7f95d52e580a178ebdfdcff0a7 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 16 May 2019 16:17:22 +0300 Subject: [PATCH 35/45] CLIENT-1497: remove useless interface --- data-service/api/transactions/interface.d.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/data-service/api/transactions/interface.d.ts b/data-service/api/transactions/interface.d.ts index 2f2840f269..d7dd6379c8 100644 --- a/data-service/api/transactions/interface.d.ts +++ b/data-service/api/transactions/interface.d.ts @@ -288,7 +288,7 @@ export interface IMassTransfer extends IBaseTransaction { export interface IData extends IBaseTransaction { type: TRANSACTION_TYPE_NUMBER.DATA; version?: number; - data: Array; + data: Array; stringifiedData: string; fee: Money; } @@ -340,12 +340,11 @@ export interface ICall { } export type TDataEntry = TDataEntryInteger | TDataEntryBoolean | TDataEntryBinary | TDataEntryString; -export type TDataReturned = TDataBigNumber | TDataEntryBoolean | TDataEntryBinary | TDataEntryString; export interface TDataEntryInteger { type: 'integer'; key: string; - value: number; + value: number | BigNumber; } export interface TDataEntryBoolean { @@ -366,12 +365,6 @@ export interface TDataEntryString { value: string; } -export interface TDataBigNumber { - type: 'integer'; - key: string; - value: BigNumber; -} - export type TCallArgs = TCallArgsInteger | TCallArgsBoolean | TCallArgsBinary | TCallArgsString; export interface TCallArgsInteger { From faae4a5816f8ce334d76e2592231280734def38b Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Mon, 20 May 2019 15:52:15 +0300 Subject: [PATCH 36/45] CLIENT-1861: fix assetHash for script invocation --- data-service/api/transactions/parse.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data-service/api/transactions/parse.ts b/data-service/api/transactions/parse.ts index 4a9f7d743e..8613f26e8f 100644 --- a/data-service/api/transactions/parse.ts +++ b/data-service/api/transactions/parse.ts @@ -33,6 +33,7 @@ import { factory, IFactory } from '../matcher/getOrders'; import { getSignatureApi } from '../../sign'; import { pipe } from 'ramda'; +const SCRIPT_INVOCATION_NUMBER = 16; const parseAttachment: (data: string | number) => Uint8Array = pipe( String, @@ -101,7 +102,7 @@ export function parseTx(transactions: Array, isUTX: boolean, isTokens? return parseScriptTx(transaction, hash, isUTX); case TRANSACTION_TYPE_NUMBER.SET_ASSET_SCRIPT: return parseAssetScript(transaction, hash, isUTX); - case 16: + case SCRIPT_INVOCATION_NUMBER: return parseInvocationTx(transaction, hash, isUTX); default: return transaction; @@ -127,6 +128,11 @@ export function getAssetsHashFromTx(transaction: T_API_TX, hash = Object.create( hash[normalizeAssetId(transaction.order1.assetPair.amountAsset)] = true; hash[normalizeAssetId(transaction.order1.assetPair.priceAsset)] = true; break; + case SCRIPT_INVOCATION_NUMBER: + transaction.payment.forEach(payment => { + hash[normalizeAssetId(payment.assetId)] = true; + }); + break; } return hash; } From 02249554f2abaa3741ca358f38d037a6b90ddcc0 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Tue, 21 May 2019 15:18:29 +0300 Subject: [PATCH 37/45] CLIENT-1385: fix connection lack --- server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.ts b/server.ts index 60396d928f..5a3a11e1eb 100644 --- a/server.ts +++ b/server.ts @@ -141,7 +141,8 @@ function request(req, res) { } function wavesClientConfig(req, res, next) { - const connection: string | null = parseCookie(req.headers.cookie).connection; + const connection: string | null = parseCookie(req.headers.cookie) ? + parseCookie(req.headers.cookie).connection : null; if (!req.url.includes('waves-client-config') || !connection) { next(); From 0d1093ea9fa3576e1cd5e89469abb97b9d9cbe36 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Tue, 21 May 2019 15:20:34 +0300 Subject: [PATCH 38/45] CLIENT-1385: refactor connection --- server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.ts b/server.ts index 5a3a11e1eb..f921568718 100644 --- a/server.ts +++ b/server.ts @@ -141,8 +141,8 @@ function request(req, res) { } function wavesClientConfig(req, res, next) { - const connection: string | null = parseCookie(req.headers.cookie) ? - parseCookie(req.headers.cookie).connection : null; + const cookies = parseCookie(req.headers.cookie); + const connection: string | null = cookies ? cookies.connection : null; if (!req.url.includes('waves-client-config') || !connection) { next(); From fe82424e24e84bc93d83015fe8276495f859aa84 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Tue, 21 May 2019 15:23:40 +0300 Subject: [PATCH 39/45] CLIENT-1385: remove whitespace --- server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.ts b/server.ts index f921568718..2e2e0dcb06 100644 --- a/server.ts +++ b/server.ts @@ -1,7 +1,7 @@ import { createSecureServer } from 'http2'; import { createServer } from 'https'; import { route, parseArguments, stat, loadLocales } from './ts-scripts/utils'; -import { readFileSync, existsSync,mkdirSync } from 'fs'; +import { readFileSync, existsSync, mkdirSync } from 'fs'; import { serialize, parse as parserCookie } from 'cookie'; import { compile } from 'handlebars'; import { parse } from 'url'; @@ -141,7 +141,7 @@ function request(req, res) { } function wavesClientConfig(req, res, next) { - const cookies = parseCookie(req.headers.cookie); + const cookies = parseCookie(req.headers.cookie); const connection: string | null = cookies ? cookies.connection : null; if (!req.url.includes('waves-client-config') || !connection) { From bf3ca98e6c9543e3142e5630dbada21dc01d7bb5 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Tue, 21 May 2019 15:29:07 +0300 Subject: [PATCH 40/45] CLIENT-1385: rename cookie --- server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.ts b/server.ts index 2e2e0dcb06..a5982a01de 100644 --- a/server.ts +++ b/server.ts @@ -141,8 +141,8 @@ function request(req, res) { } function wavesClientConfig(req, res, next) { - const cookies = parseCookie(req.headers.cookie); - const connection: string | null = cookies ? cookies.connection : null; + const parsedCookie = parseCookie(req.headers.cookie); + const connection: string | null = parsedCookie ? parsedCookie.connection : null; if (!req.url.includes('waves-client-config') || !connection) { next(); From 7f37b4ad0831eb63665b432aa1df8edc84a6b1b2 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 21 May 2019 16:19:44 +0300 Subject: [PATCH 41/45] CLIENT-1536: save --- src/modules/utils/modals/settings/SettingsCtrl.js | 8 ++++++-- src/modules/utils/modals/settings/settings.html | 13 +++++++++++++ src/modules/utils/modals/settings/settings.less | 5 +++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/modules/utils/modals/settings/SettingsCtrl.js b/src/modules/utils/modals/settings/SettingsCtrl.js index 97f0e6143f..06f7b3f35c 100644 --- a/src/modules/utils/modals/settings/SettingsCtrl.js +++ b/src/modules/utils/modals/settings/SettingsCtrl.js @@ -59,6 +59,7 @@ shownKey = false; node = ''; matcher = ''; + api = ''; scamListUrl = ''; withScam = false; theme = user.getSetting('theme'); @@ -96,6 +97,7 @@ this.syncSettings({ node: 'network.node', matcher: 'network.matcher', + api: 'network.api', logoutAfterMin: 'logoutAfterMin', scamListUrl: 'scamListUrl', withScam: 'withScam', @@ -165,10 +167,11 @@ } }); - this.observe(['node', 'matcher'], () => { + this.observe(['node', 'matcher', 'api'], () => { ds.config.setConfig({ node: this.node, - matcher: this.matcher + matcher: this.matcher, + api: this.api }); }); @@ -216,6 +219,7 @@ this.withScam = false; this.scamListUrl = WavesApp.network.scamListUrl; this.oracleWaves = WavesApp.oracles.waves; + this.api = WavesApp.network.api; } showPairingWithMobile() { diff --git a/src/modules/utils/modals/settings/settings.html b/src/modules/utils/modals/settings/settings.html index b442ce0e5e..babfb14316 100644 --- a/src/modules/utils/modals/settings/settings.html +++ b/src/modules/utils/modals/settings/settings.html @@ -252,6 +252,19 @@
+
+
+ + +
+
+ + +
+
+
+
+
diff --git a/src/modules/utils/modals/settings/settings.less b/src/modules/utils/modals/settings/settings.less index 9831b78556..aad9716f82 100644 --- a/src/modules/utils/modals/settings/settings.less +++ b/src/modules/utils/modals/settings/settings.less @@ -255,6 +255,11 @@ md-dialog.settings-modal { } .asset-verification { + z-index: 3; + position: relative; + } + + .asset-api { z-index: 2; position: relative; } From 784e1e3281eaf83bee0db5801403aa94767b6048 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 22 May 2019 16:48:16 +0300 Subject: [PATCH 42/45] CLIENT-1810: fix csv export with scam --- .../modules/transactions/controllers/TransactionsCtrl.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js b/src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js index f37efdf629..81b90f8a6f 100644 --- a/src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js +++ b/src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js @@ -82,7 +82,10 @@ } - allTransactions = allTransactions.concat(transactions.filter(el => !user.scam[el.assetId])); + if (user.getSetting('dontShowSpam')) { + transactions = transactions.filter(el => !user.scam[el.assetId]); + } + allTransactions = allTransactions.concat(transactions); if (transactions.length < MAX_LIMIT || allTransactions.length > maxTransactions) { return { allTransactions, downloadError }; From cb56c30cd7f4b27fae351be13572552a7adb015e Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 22 May 2019 17:28:22 +0300 Subject: [PATCH 43/45] CLIENT-1810: delete s --- .../ui/directives/transaction/types/transfer/Transfer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ui/directives/transaction/types/transfer/Transfer.js b/src/modules/ui/directives/transaction/types/transfer/Transfer.js index 80af9c9f6a..ae626e1532 100644 --- a/src/modules/ui/directives/transaction/types/transfer/Transfer.js +++ b/src/modules/ui/directives/transaction/types/transfer/Transfer.js @@ -24,7 +24,7 @@ this.typeName = this.props.typeName; this.time = this.props.time; this.address = this.props.shownAddress; -s + this.receive(utils.observe(this.props, 'isScam'), () => { this.isScam = this.props.isScam; utils.safeApply($scope); From 45840dfae5de0620f8b0980b8f77de1f3f02b1ff Mon Sep 17 00:00:00 2001 From: Valentin Kuzmenkov Date: Thu, 23 May 2019 14:36:35 +0300 Subject: [PATCH 44/45] CLIENT-1874: update version and whatsnew --- package.json | 2 +- src/modules/utils/services/whatsNew.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4b1d3f880b..da1ede15b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "waves-client", - "version": "1.2.7", + "version": "1.2.8", "description": "The official client application for the Waves platform", "private": true, "repository": { diff --git a/src/modules/utils/services/whatsNew.js b/src/modules/utils/services/whatsNew.js index 7465454588..7288d31a7c 100644 --- a/src/modules/utils/services/whatsNew.js +++ b/src/modules/utils/services/whatsNew.js @@ -39,7 +39,8 @@ '1.2.1', '1.2.2', '1.2.3', - '1.2.6' + '1.2.6', + '1.2.7' ]; /** From 06a26eb82bb5eae943a191b31695d94b75989810 Mon Sep 17 00:00:00 2001 From: Grigory Ivanov <36446723+GIvanovWaves@users.noreply.github.com> Date: Thu, 23 May 2019 14:55:54 +0300 Subject: [PATCH 45/45] CLIENT-1874: Fixed release version in whats new --- src/modules/utils/services/whatsNew.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/utils/services/whatsNew.js b/src/modules/utils/services/whatsNew.js index 7288d31a7c..4002de6ff0 100644 --- a/src/modules/utils/services/whatsNew.js +++ b/src/modules/utils/services/whatsNew.js @@ -40,7 +40,7 @@ '1.2.2', '1.2.3', '1.2.6', - '1.2.7' + '1.2.8' ]; /**