From eb3d6297cc0eecfb7343bc8e7fd538ed9d531d7a Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Mon, 21 Aug 2023 14:50:21 +0700 Subject: [PATCH 001/142] merge code --- src/app/core/constants/account.constant.ts | 7 +- src/app/core/constants/account.enum.ts | 12 +- src/app/core/pipes/common-pipe.module.ts | 7 +- src/app/core/pipes/common.pipe.ts | 20 + src/app/core/services/user.service.ts | 206 +++++++++ src/app/core/utils/common/parsing.ts | 2 +- src/app/global/global.ts | 142 ++++++ .../account-detail.component.html | 406 ++++-------------- .../account-detail.component.scss | 103 ++--- .../account-detail.component.ts | 280 +----------- .../account-detail/account-detail.module.ts | 20 +- .../account-stake.component.html | 135 ++++++ .../account-stake.component.scss | 48 +++ .../account-stake/account-stake.component.ts | 175 ++++++++ .../account-transaction-table.component.html | 402 +++++++++++++++++ .../account-transaction-table.component.scss | 256 +++++++++++ .../account-transaction-table.component.ts | 389 +++++++++++++++++ .../account-transaction.component.html | 59 +++ .../account-transaction.component.scss | 51 +++ .../account-transaction.component.ts | 33 ++ .../nft-list/nft-list.component.html | 134 +++--- .../nft-list/nft-list.component.scss | 97 ++++- .../nft-list/nft-list.component.ts | 37 +- .../soulbound-token.component.html | 18 +- .../token-table/token-table.component.html | 333 +++++++------- .../token-table/token-table.component.scss | 157 +++++-- .../token-table/token-table.component.ts | 94 ++-- .../block-detail/block-detail.component.ts | 2 +- .../code-id-contracts-tab.component.ts | 2 +- .../code-id-list/code-id-list.component.ts | 2 +- .../contracts-register.component.ts | 2 +- .../pages/dashboard/dashboard.component.html | 2 +- .../pages/dashboard/dashboard.component.ts | 2 +- .../token-inventory-tab.component.html | 56 +-- .../token-inventory-tab.component.scss | 2 +- .../transaction/transaction.component.html | 2 +- .../card-mob-account.component.html | 89 ++++ .../card-mob-account.component.scss | 59 +++ .../card-mob-account.component.ts | 82 ++++ .../card-mob-account.module.ts | 15 + .../shared/components/qr/qr.component.scss | 1 - .../soulbound-feature-tokens.component.html | 99 +++-- .../soulbound-feature-tokens.component.scss | 41 +- .../soulbound-feature-tokens.component.ts | 18 +- .../soulbound-feature-tokens.module.ts | 4 +- .../table-no-data.component.html | 6 +- .../table-no-data/table-no-data.component.ts | 1 + src/app/shared/shared.module.ts | 6 +- src/assets/scss/aura-theme/cards.scss | 27 +- src/assets/scss/aura-theme/reboot.scss | 8 +- src/assets/scss/custom.scss | 4 +- 51 files changed, 3050 insertions(+), 1105 deletions(-) create mode 100644 src/app/pages/account/account-detail/account-stake/account-stake.component.html create mode 100644 src/app/pages/account/account-detail/account-stake/account-stake.component.scss create mode 100644 src/app/pages/account/account-detail/account-stake/account-stake.component.ts create mode 100644 src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html create mode 100644 src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss create mode 100644 src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts create mode 100644 src/app/pages/account/account-detail/account-transaction/account-transaction.component.html create mode 100644 src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss create mode 100644 src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts create mode 100644 src/app/shared/components/cards/card-mob-account/card-mob-account.component.html create mode 100644 src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss create mode 100644 src/app/shared/components/cards/card-mob-account/card-mob-account.component.ts create mode 100644 src/app/shared/components/cards/card-mob-account/card-mob-account.module.ts diff --git a/src/app/core/constants/account.constant.ts b/src/app/core/constants/account.constant.ts index 9abf414c7..3e9c6bc45 100644 --- a/src/app/core/constants/account.constant.ts +++ b/src/app/core/constants/account.constant.ts @@ -18,7 +18,8 @@ export const ACCOUNT_WALLET_COLOR = [ ]; export const TABS_TITLE_ACCOUNT = [ - { label: TabsAccount.Assets }, - { label: TabsAccount.Transactions }, - { label: TabsAccount.Stake }, + { label: TabsAccount.ExecutedTxs }, + { label: TabsAccount.AuraTxs }, + { label: TabsAccount.FtsTxs }, + { label: TabsAccount.NftTxs }, ]; diff --git a/src/app/core/constants/account.enum.ts b/src/app/core/constants/account.enum.ts index 50c7a9b64..4b4c6d22f 100644 --- a/src/app/core/constants/account.enum.ts +++ b/src/app/core/constants/account.enum.ts @@ -46,9 +46,10 @@ export enum WalletAcount { } export enum TabsAccount { - Assets = 'ASSETS', - Transactions = 'TRANSACTIONS', - Stake = 'STAKE', + ExecutedTxs = 'EXECUTED', + AuraTxs = 'AURA TRANSFER', + FtsTxs = 'FTs TRANSFER', + NftTxs = 'NFTs TRANSFER', } export enum StakeModeAccount { @@ -64,3 +65,8 @@ export enum EAccountType { PeriodicVestingAccount = 'cosmos-sdk/PeriodicVestingAccount', DelayedVestingAccount = 'cosmos-sdk/DelayedVestingAccount', } + +export enum AccountTxType { + Sent = 'Sent', + Received = 'Received', +} diff --git a/src/app/core/pipes/common-pipe.module.ts b/src/app/core/pipes/common-pipe.module.ts index 713bbd954..617dde07b 100644 --- a/src/app/core/pipes/common-pipe.module.ts +++ b/src/app/core/pipes/common-pipe.module.ts @@ -11,6 +11,7 @@ import { ConvertUauraToAura, convertLogAmount, decodeData, + displayTypeToolTip, } from './common.pipe'; import { JsonPipe } from './json.pipe'; @@ -26,7 +27,8 @@ import { JsonPipe } from './json.pipe'; ReplaceIpfs, ConvertUauraToAura, convertLogAmount, - decodeData + decodeData, + displayTypeToolTip ], imports: [CommonModule], exports: [ @@ -40,7 +42,8 @@ import { JsonPipe } from './json.pipe'; ReplaceIpfs, ConvertUauraToAura, convertLogAmount, - decodeData + decodeData, + displayTypeToolTip ], }) export class CommonPipeModule {} diff --git a/src/app/core/pipes/common.pipe.ts b/src/app/core/pipes/common.pipe.ts index 7519e2fa1..2378a461a 100644 --- a/src/app/core/pipes/common.pipe.ts +++ b/src/app/core/pipes/common.pipe.ts @@ -121,3 +121,23 @@ export class decodeData implements PipeTransform { return atob(value); } } + +@Pipe({ name: 'displayTypeToolTip' }) +export class displayTypeToolTip implements PipeTransform { + transform(value: any): string { + let result = ''; + value.forEach((element, index) => { + if (index <= 4) { + if (result?.length > 0) { + result += ', ' + element.type; + } else { + result += element.type; + } + } + }); + if (value?.length > 4) { + result += ', ...'; + } + return result; + } +} diff --git a/src/app/core/services/user.service.ts b/src/app/core/services/user.service.ts index 61b5bf9c6..feae7ef2c 100644 --- a/src/app/core/services/user.service.ts +++ b/src/app/core/services/user.service.ts @@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { EnvironmentService } from '../data-services/environment.service'; import { CommonService } from './common.service'; +import { map } from 'rxjs/operators'; @Injectable() export class UserService extends CommonService { @@ -43,4 +44,209 @@ export class UserService extends CommonService { refreshToken(payload): Observable { return this.http.post(`${this.apiUrl}/auth/refresh-token`, payload); } + + getListTypeFilter() { + const operationsDoc = ` + query GetListType { + ${this.envDB} { + transaction_message(distinct_on: type) { + type + } + } + } + `; + return this.http + .post(this.graphUrl, { + query: operationsDoc, + variables: {}, + operationName: 'GetListType', + }) + .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); + } + + getListTxByAddress(payload) { + const operationsDoc = ` + query QueryTxOfAccount( + $compositeKey: String = null, + $address: String = null, + $startTime: timestamptz = null, + $endTime: timestamptz = null, + $limit: Int = null, + $listTxMsgType: [String!] = null, + $heightGT: Int = null, + $heightLT: Int = null, + $orderHeight: order_by = desc + ) { + ${this.envDB} { + transaction( + where: { + event_attribute_index: { + composite_key: {_eq: $compositeKey}, + value: {_eq: $address}}, + timestamp: {_lte: $endTime, _gte: $startTime} + transaction_messages: {type: {_in: $listTxMsgType}} + _and: [{height: {_gt: $heightGT, _lt: $heightLT}}] + }, + limit: $limit, + order_by: {height: $orderHeight} + ) { + hash + height + fee + timestamp + code + transaction_messages { + type + content + } + } + } + } + `; + return this.http + .post(this.graphUrl, { + query: operationsDoc, + variables: { + limit: payload.limit || 40, + compositeKey: payload.compositeKey, + address: payload.address, + heightLT: payload.heightLT, + listTxMsgType: payload.listTxMsgType, + startTime: payload.startTime, + endTime: payload.endTime, + }, + operationName: 'QueryTxOfAccount', + }) + .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); + } + + getListTxAuraByAddress(payload) { + const operationsDoc = ` + query QueryTxMsgOfAccount($compositeKey: String = null, $address: String = null, $startTime: timestamptz = null, $endTime: timestamptz = null, $limit: Int = null, $listTxMsgType: [String!] = null, $heightGT: Int = null, $heightLT: Int = null, $orderHeight: order_by = desc) { + ${this.envDB} { + transaction(where: {event_attribute_index: {composite_key: {_eq: $compositeKey}, value: {_eq: $address}}, timestamp: {_lte: $endTime, _gte: $startTime}, transaction_messages: {type: {_in: $listTxMsgType}}, _and: [{height: {_gt: $heightGT, _lt: $heightLT}}]}, limit: $limit, order_by: {height: $orderHeight}) { + hash + height + fee + timestamp + code + transaction_messages { + type + content + } + } + } + } + `; + return this.http + .post(this.graphUrl, { + query: operationsDoc, + variables: { + limit: payload.limit || 100, + compositeKey: payload.compositeKey, + address: payload.address, + heightLT: payload.heightLT, + listTxMsgType: payload.listTxMsgType, + startTime: payload.startTime, + endTime: payload.endTime, + }, + operationName: 'QueryTxMsgOfAccount', + }) + .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); + } + + getListFTByAddress(payload) { + const operationsDoc = ` + query Cw20TXOfAccount($receiver: String = null, $sender: String = null, $startTime: timestamptz = null, $endTime: timestamptz = null, $listTxMsgType: [String!] = null, $heightGT: Int = null, $heightLT: Int = null, $limit: Int = null) { + ${this.envDB} { + transaction(where: {events: {smart_contract_events: {cw20_activities: {to: {_eq: $receiver}, from: {_eq: $sender}}}}, timestamp: {_gte: $startTime, _lte: $endTime}, _and: {height: {_gt: $heightGT, _lt: $heightLT}}, transaction_messages: {type: {_in: $listTxMsgType}}}, order_by: {height: desc}, limit: $limit) { + gas_used + hash + height + timestamp + code + transaction_messages { + content + type + } + events(where: {smart_contract_events: {cw20_activities: {from: {_eq: $sender}, to: {_eq: $receiver}, id: {_is_null: false}}}}) { + smart_contract_events { + cw20_activities { + amount + action + from + to + sender + } + smart_contract { + cw20_contract { + symbol + decimal + } + } + } + } + } + } + } + `; + return this.http + .post(this.graphUrl, { + query: operationsDoc, + variables: { + sender: payload.sender, + receiver: payload.receiver, + listTxMsgType: payload.listTxMsgType, + startTime: payload.startTime, + endTime: payload.endTime, + }, + operationName: 'Cw20TXOfAccount', + }) + .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); + } + + getListNFTByAddress(payload) { + const operationsDoc = ` + query Cw721TXOfAccount($receiver: String = null, $sender: String = null, $startTime: timestamptz = null, $endTime: timestamptz = null, $listTxMsgType: [String!] = null, $heightGT: Int = null, $heightLT: Int = null, $limit: Int = null) { + ${this.envDB} { + transaction(where: {events: {smart_contract_events: {cw721_activity: {to: {_eq: $receiver}, from: {_eq: $sender}}}}, timestamp: {_gte: $startTime, _lte: $endTime}, _and: {height: {_gt: $heightGT, _lt: $heightLT}}, transaction_messages: {type: {_in: $listTxMsgType}}}, order_by: {height: desc}, limit: $limit) { + gas_used + hash + height + timestamp + code + transaction_messages { + content + type + } + events(where: {smart_contract_events: {cw721_activity: {id: {_is_null: false}, from: {_eq: $sender}, to: {_eq: $receiver}}}}) { + smart_contract_events { + cw721_activity { + action + from + to + sender + cw721_token_id + } + } + } + } + } + } + + `; + return this.http + .post(this.graphUrl, { + query: operationsDoc, + variables: { + sender: payload.sender, + receiver: payload.receiver, + listTxMsgType: payload.listTxMsgType, + startTime: payload.startTime, + endTime: payload.endTime, + }, + operationName: 'Cw721TXOfAccount', + }) + .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); + } } diff --git a/src/app/core/utils/common/parsing.ts b/src/app/core/utils/common/parsing.ts index 0bc1f9f10..430536b10 100644 --- a/src/app/core/utils/common/parsing.ts +++ b/src/app/core/utils/common/parsing.ts @@ -1,7 +1,7 @@ import BigNumber from 'bignumber.js'; export function balanceOf(amount: string | number, decimal = 6): number { - return +(new BigNumber(amount).toNumber() / Math.pow(10, 6)).toFixed(decimal); + return +(new BigNumber(amount).toNumber() / Math.pow(10, decimal)).toFixed(decimal); } export function parseLabel(label: number) { diff --git a/src/app/global/global.ts b/src/app/global/global.ts index 9aca48524..a353e0643 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -11,6 +11,7 @@ import { } from '../core/constants/transaction.enum'; import { CommonDataDto } from '../core/models/common.model'; import { balanceOf } from '../core/utils/common/parsing'; +import { TabsAccount } from '../core/constants/account.enum'; Injectable(); export class Globals { @@ -290,6 +291,14 @@ export function convertDataTransaction(data, coinInfo) { } } catch (e) {} + if (typeOrigin === TRANSACTION_TYPE_ENUM.ExecuteContract) { + try { + let dataTemp = JSON.parse(messages[0]?.msg); + let action = Object.keys(dataTemp)[0]; + type = 'Execute_' + action[0]?.toUpperCase() + action.substr(1)?.toLowerCase(); + } catch {} + } + const status = _.get(element, 'code') == CodeTransaction.Success ? StatusTransaction.Success : StatusTransaction.Fail; @@ -337,3 +346,136 @@ export function convertDataBlock(data) { }); return block; } + +export function convertDataAccountTransaction(data, coinInfo, modeQuery, setReceive = false) { + const txs = _.get(data, 'transaction').map((element) => { + const code = _.get(element, 'code'); + const tx_hash = _.get(element, 'hash'); + + const lstTypeTemp = _.get(element, 'transaction_messages'); + let type; + if (lstTypeTemp) { + if (lstTypeTemp[0]['type'] === TRANSACTION_TYPE_ENUM.GetReward) { + type = TypeTransaction.GetReward; + } else if (lstTypeTemp?.length > 1) { + if (lstTypeTemp[0]['type'] === TRANSACTION_TYPE_ENUM.MultiSend) { + type = TypeTransaction.MultiSend; + } else { + type = 'Multiple'; + } + } + } + + let denom = coinInfo.coinDenom; + const _amount = _.get(element, 'events[0].event_attributes[2].value'); + let amount = balanceOf(_amount?.match(/\d+/g)[0]); + + const status = + _.get(element, 'code') == CodeTransaction.Success ? StatusTransaction.Success : StatusTransaction.Fail; + + const fee = balanceOf(_.get(element, 'fee[0].amount') || 0, coinInfo.coinDecimals).toFixed(coinInfo.coinDecimals); + const height = _.get(element, 'height'); + const timestamp = _.get(element, 'timestamp'); + let limit = 5; + let fromAddress; + let toAddress; + let arrEvent; + let tokenId; + let contractAddress; + + switch (modeQuery) { + case TabsAccount.ExecutedTxs: + type = getTypeTx(element); + break; + case TabsAccount.AuraTxs: + arrEvent = _.get(element, 'transaction_messages')?.map((item, index) => { + let type = _.get(item, 'type'); + let fromAddress = _.get(item, 'event_attributes[1].value'); + let toAddress = _.get(item, 'event_attributes[0].value'); + let amountTemp = _.get(item, 'event_attributes[2].value')?.match(/\d+/g)[0]; + let denom = coinInfo.coinDenom; + let amount = balanceOf(Number(amountTemp) || 0, denom); + return { type, fromAddress, toAddress, amount, denom }; + }); + break; + case TabsAccount.FtsTxs: + arrEvent = _.get(element, 'events')?.map((item, index) => { + let type = getTypeTx(element); + let fromAddress = _.get(item, 'smart_contract_events[0].cw20_activities[0].from') || NULL_ADDRESS; + let toAddress = _.get(item, 'smart_contract_events[0].cw20_activities[0].to') || NULL_ADDRESS; + let denom = _.get(item, 'smart_contract_events[0].smart_contract.cw20_contract.symbol'); + let amountTemp = _.get(item, 'smart_contract_events[0].cw20_activities[0].amount'); + let decimal = _.get(item, 'smart_contract_events[0].smart_contract.cw20_contract.decimal'); + let amount = balanceOf(amountTemp || 0, +decimal); + return { type, fromAddress, toAddress, amount, denom }; + }); + break; + case TabsAccount.NftTxs: + arrEvent = _.get(element, 'events')?.map((item, index) => { + let type = getTypeTx(element); + let fromAddress = _.get(item, 'smart_contract_events[0].cw721_activity.from') || NULL_ADDRESS; + let toAddress = _.get(item, 'smart_contract_events[0].cw721_activity.to') || NULL_ADDRESS; + let contractAddress = _.get(element, 'transaction_messages[0].content.contract'); + let dataTemp = _.get(element, 'transaction_messages[0].content.msg'); + let tokenId; + if (typeof dataTemp === 'string') { + try { + dataTemp = JSON.parse(dataTemp); + tokenId = dataTemp[Object.keys(dataTemp)[0]]?.token_id || ''; + } catch (e) {} + } + + return { type, fromAddress, toAddress, tokenId, contractAddress }; + }); + break; + } + + if (modeQuery !== TabsAccount.ExecutedTxs) { + fromAddress = arrEvent[0]?.fromAddress; + toAddress = arrEvent[0]?.toAddress; + denom = arrEvent[0]?.denom; + amount = arrEvent[0]?.amount; + type = arrEvent[0]?.type || lstTypeTemp[0]?.type?.split('.').pop(); + tokenId = arrEvent[0]?.tokenId; + contractAddress = arrEvent[0]?.contractAddress; + } + + if (type === 'Send' && setReceive) { + type = 'Receive'; + } + + return { + code, + tx_hash, + type, + status, + amount, + fee, + height, + timestamp, + denom, + fromAddress, + toAddress, + tokenId, + contractAddress, + arrEvent, + limit, + }; + }); + return txs; +} + +export function getTypeTx(element) { + let type = _.get(element, 'transaction_messages[0].content["@type"]'); + if (type === TRANSACTION_TYPE_ENUM.ExecuteContract) { + try { + let dataTemp = _.get(element, 'transaction_messages[0].content.msg'); + dataTemp = JSON.parse(dataTemp); + let action = Object.keys(dataTemp)[0]; + type = 'Execute_' + action[0]?.toUpperCase() + action.substr(1)?.toLowerCase(); + } catch (e) {} + } else { + type = _.find(TYPE_TRANSACTION, { label: type })?.value || type.split('.').pop(); + } + return type; +} diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 865cd09ba..34218690c 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -3,41 +3,43 @@ + +
@@ -397,4 +151,4 @@

Coins & Tokens ({{ totalAssets || 0 }})

-
+ \ No newline at end of file diff --git a/src/app/pages/account/account-detail/account-detail.component.scss b/src/app/pages/account/account-detail/account-detail.component.scss index f465a704d..5421fa1df 100644 --- a/src/app/pages/account/account-detail/account-detail.component.scss +++ b/src/app/pages/account/account-detail/account-detail.component.scss @@ -1,21 +1,8 @@ section.account-detail { .qr-code { - border-right: 1px solid var(--aura-gray-9); - vertical-align: middle; - } - .soulbound-feature-tokens { - flex: 1 0 100%; - border-top: 1px solid var(--aura-gray-9); - @media (min-width: 1199.98px) { - flex: 0 1 auto; - display: flex; - align-items: center; - justify-content: flex-end; - flex-shrink: 0; - flex-grow: 1; - border-top: none; - border-left: 1px solid var(--aura-gray-9); - } + background-color: var(--aura-gray-9); + border-top-left-radius: 12px; + border-top-right-radius: 12px; } form.search-form { .input-group { @@ -34,47 +21,11 @@ section.account-detail { } } } - @media (max-width: 991.98px) { - .row-eq-height { - flex-direction: column-reverse; - } - } - - .box-chart { - width: 180px; - height: 180px; - border: 1px solid #d3d3d3; - border-radius: 50%; - div { - width: 100px; - height: 100px; - border: 1px solid #d3d3d3; - border-radius: 50%; - } - } - .article-2 { - min-height: 500px; - } } -.chart-legend-item { - border-bottom: 1px solid var(--aura-gray-9); - &:last-of-type { - border-bottom: none; - } - .item-color-balance { - width: 12px; - height: 12px; - border-radius: 50%; - @media (min-width: 992px) { - width: 16px; - height: 16px; - } - } -} .button { &.button-circle { - aspect-ratio : 1 / 1 !important; + aspect-ratio: 1 / 1 !important; padding: 0; border-radius: 50%; background-color: #363843; @@ -82,14 +33,6 @@ section.account-detail { align-items: center; justify-content: center; } - &.button--md { - width: 40px; - height: 40px; - } - &.button--xxs { - width: 24px; - height: 24px; - } } .link-reset-data { text-decoration: underline; @@ -109,12 +52,13 @@ section.account-detail { } ::ng-deep { .modal-dialog .modal-content { - padding-bottom: 52px !important; - } + padding-bottom: 52px !important; + } } .header-mob { padding-bottom: 0px !important; font-size: 2rem !important; + font-weight: 500; } .aura-form { .select-input-field { @@ -133,7 +77,7 @@ section.account-detail { ::ng-deep.account-search-form { width: 100%; @media (min-width: 992px) { - width: 410px; + width: 320px; } } .account__tab-item { @@ -148,17 +92,32 @@ section.account-detail { .aura-table.transaction-table th.mat-header-cell:nth-child(7) { min-width: 200px; } -.box-manage-abt { - margin-left: auto; - display: flex; - align-items: center; -} -app-soulbound-feature-tokens { - width: 100%; + +.button-switch-stage { + &__1 { + width: 100%; + @media (min-width: 568.98px) { + max-width: 168px; + } + button { + padding: 0 14px; + } + } + &__2 { + width: 100%; + max-width: unset; + @media (min-width: 991.98px) { + max-width: 239px; + } + } } .name-tag:not(.private-name-tag) { &:after { border-right: 15px solid var(--aura-gray-10); } -} \ No newline at end of file +} + +.btn-private { + width: fit-content; +} diff --git a/src/app/pages/account/account-detail/account-detail.component.ts b/src/app/pages/account/account-detail/account-detail.component.ts index 95d59150a..f1296e535 100644 --- a/src/app/pages/account/account-detail/account-detail.component.ts +++ b/src/app/pages/account/account-detail/account-detail.component.ts @@ -13,7 +13,6 @@ import { LIMIT_NUM_SBT } from 'src/app/core/constants/soulbound.constant'; import { SoulboundService } from 'src/app/core/services/soulbound.service'; import { EnvironmentService } from '../../../../app/core/data-services/environment.service'; import { WalletService } from '../../../../app/core/services/wallet.service'; -import local from '../../../../app/core/utils/storage/local'; import { ACCOUNT_WALLET_COLOR, TABS_TITLE_ACCOUNT } from '../../../core/constants/account.constant'; import { ACCOUNT_WALLET_COLOR_ENUM, @@ -23,7 +22,6 @@ import { WalletAcount, } from '../../../core/constants/account.enum'; import { DATE_TIME_WITH_MILLISECOND, PAGE_EVENT } from '../../../core/constants/common.constant'; -import { IAccountDetail } from '../../../core/models/account.model'; import { TableTemplate } from '../../../core/models/common.model'; import { AccountService } from '../../../core/services/account.service'; import { CommonService } from '../../../core/services/common.service'; @@ -36,7 +34,7 @@ import { CHART_OPTION, ChartOptions, chartCustomOptions } from './chart-options' templateUrl: './account-detail.component.html', styleUrls: ['./account-detail.component.scss'], }) -export class AccountDetailComponent implements OnInit, AfterViewInit { +export class AccountDetailComponent implements OnInit { @ViewChild('assetTypeSelect') assetTypeSelect: MatSelect; @HostListener('window:scroll', ['$event']) closeOptionPanelSection(_) { @@ -50,101 +48,12 @@ export class AccountDetailComponent implements OnInit, AfterViewInit { currentAddress: string; currentKey = null; - currentAccountDetail: IAccountDetail; + currentAccountDetail: any; textSearch = ''; - dataSourceToken: MatTableDataSource; - dataSourceTokenBk: MatTableDataSource; - templates: Array = [ - { matColumnDef: 'tx_hash', headerCellDef: 'Tx Hash' }, - { matColumnDef: 'type', headerCellDef: 'Type' }, - { matColumnDef: 'status', headerCellDef: 'Result' }, - { matColumnDef: 'fee', headerCellDef: 'Fee' }, - { matColumnDef: 'height', headerCellDef: 'Height' }, - { matColumnDef: 'timestamp', headerCellDef: 'Time' }, - ]; - - templatesDelegation: Array = [ - { matColumnDef: 'validator_name', headerCellDef: 'Validator' }, - { matColumnDef: 'amount', headerCellDef: 'Amount' }, - { matColumnDef: 'reward', headerCellDef: 'Reward' }, - ]; - displayedColumnsDelegation: string[] = this.templatesDelegation.map((dta) => dta.matColumnDef); - dataSourceDelegation: MatTableDataSource; - - templatesUnBonding: Array = [ - { matColumnDef: 'validator_name', headerCellDef: 'Validator' }, - { matColumnDef: 'amount', headerCellDef: 'Amount' }, - { matColumnDef: 'completion_time', headerCellDef: 'Completion Time' }, - ]; - displayedColumnsUnBonding: string[] = this.templatesUnBonding.map((dta) => dta.matColumnDef); - dataSourceUnBonding: MatTableDataSource; - - templatesReDelegation: Array = [ - { matColumnDef: 'validator_src_name', headerCellDef: 'From' }, - { matColumnDef: 'validator_dst_name', headerCellDef: 'To' }, - { matColumnDef: 'amount', headerCellDef: 'Amount' }, - { matColumnDef: 'completion_time', headerCellDef: 'Time' }, - ]; - displayedColumnsReDelegation: string[] = this.templatesReDelegation.map((dta) => dta.matColumnDef); - dataSourceReDelegation: MatTableDataSource; - - templatesVesting: Array = [ - { matColumnDef: 'type_format', headerCellDef: 'Type' }, - { matColumnDef: 'amount', headerCellDef: 'Amount' }, - { matColumnDef: 'vesting_schedule', headerCellDef: 'Vesting Schedule' }, - ]; - displayedColumnsVesting: string[] = this.templatesVesting.map((dta) => dta.matColumnDef); - dataSourceVesting: MatTableDataSource; - - pageData: PageEvent = { - length: PAGE_EVENT.LENGTH, - pageSize: 20, - pageIndex: PAGE_EVENT.PAGE_INDEX, - }; - nextKey = null; - - pageDataToken: PageEvent = { - length: PAGE_EVENT.LENGTH, - pageSize: PAGE_EVENT.PAGE_SIZE, - pageIndex: PAGE_EVENT.PAGE_INDEX, - }; - - pageDataDelegation: PageEvent = { - length: PAGE_EVENT.LENGTH, - pageSize: PAGE_EVENT.PAGE_SIZE, - pageIndex: PAGE_EVENT.PAGE_INDEX, - }; - - pageDataUnbonding: PageEvent = { - length: PAGE_EVENT.LENGTH, - pageSize: PAGE_EVENT.PAGE_SIZE, - pageIndex: PAGE_EVENT.PAGE_INDEX, - }; - - pageDataRedelegation: PageEvent = { - length: PAGE_EVENT.LENGTH, - pageSize: PAGE_EVENT.PAGE_SIZE, - pageIndex: PAGE_EVENT.PAGE_INDEX, - }; - - pageDataVesting: PageEvent = { - length: PAGE_EVENT.LENGTH, - pageSize: PAGE_EVENT.PAGE_SIZE, - pageIndex: PAGE_EVENT.PAGE_INDEX, - }; - - displayedColumns: string[] = this.templates.map((dta) => dta.matColumnDef); - dataSource: MatTableDataSource = new MatTableDataSource(); - dataSourceMobile: any[]; - pageEventType = PageEventType; - searchNullData = false; chartCustomOptions = chartCustomOptions; // loading param check - transactionLoading = true; - accDetailLoading = true; - chartLoading = true; userAddress = ''; modalReference: any; isNoData = false; @@ -158,33 +67,16 @@ export class AccountDetailComponent implements OnInit, AfterViewInit { denom = this.environmentService.configValue.chain_info.currencies[0].coinDenom; TABS = TABS_TITLE_ACCOUNT; - tabsData = TabsAccount; - stakeMode = StakeModeAccount; - TABS_STAKE = [ - { - key: StakeModeAccount.Delegations, - label: 'Delegations', - }, - { - key: StakeModeAccount.Unbondings, - label: 'Unbondings', - }, - { - key: StakeModeAccount.Redelegations, - label: 'Redelegations', - }, - { - key: StakeModeAccount.Vestings, - label: 'Vestings', - }, - ]; - currentTab = TabsAccount.Assets; + currentStake = StakeModeAccount.Delegations; + stakeMode = StakeModeAccount; totalValueToken = 0; totalValueNft = 0; totalAssets = 0; totalSBT = 0; + isSent = true; + constructor( private transactionService: TransactionService, public commonService: CommonService, @@ -200,28 +92,14 @@ export class AccountDetailComponent implements OnInit, AfterViewInit { this.chartOptions = CHART_OPTION(); } - ngAfterViewInit(): void { - this.dataSource.sort = this.sort; - } - ngOnInit(): void { this.timeStaking = (Number(this.timeStaking) / DATE_TIME_WITH_MILLISECOND).toString(); this.chartCustomOptions = [...ACCOUNT_WALLET_COLOR]; this.route.params.subscribe((params) => { if (params?.address) { this.currentAddress = params?.address; - this.transactionLoading = true; - this.accDetailLoading = true; - - this.dataSourceToken = new MatTableDataSource(); - this.dataSourceDelegation = new MatTableDataSource(); - this.dataSourceUnBonding = new MatTableDataSource(); - this.dataSourceReDelegation = new MatTableDataSource(); - this.dataSource = new MatTableDataSource(); - this.loadDataTemp(); this.getAccountDetail(); - this.getTxsFromHoroscope(); } }); } @@ -252,88 +130,13 @@ export class AccountDetailComponent implements OnInit, AfterViewInit { let data = JSON.parse(retrievedObject); let dataAccount = JSON.parse(data?.dataAccount); if (dataAccount && dataAccount.acc_address === this.currentAddress) { - this.accDetailLoading = false; - this.chartLoading = false; this.currentAccountDetail = dataAccount; - this.dataSourceToken.data = dataAccount.balances; - this.pageDataToken.length = dataAccount?.balances?.length; this.chartOptions = JSON.parse(data?.dataChart); } } } - changePage(page: any): void { - switch (page.pageEventType) { - case this.pageEventType.Delegation: - this.pageDataDelegation.pageIndex = page.pageIndex; - break; - case this.pageEventType.Unbonding: - this.pageDataUnbonding.pageIndex = page.pageIndex; - break; - case this.pageEventType.Redelegation: - this.pageDataRedelegation.pageIndex = page.pageIndex; - break; - case this.pageEventType.Vestings: - this.pageDataVesting.pageIndex = page.pageIndex; - break; - case this.pageEventType.Token: - this.pageDataToken.pageIndex = page.pageIndex; - break; - default: - break; - } - } - - getTxsFromHoroscope(nextKey = null): void { - const address = this.currentAddress; - let payload = { - limit: 40, - value: address, - heightLT: nextKey, - }; - this.transactionService.getListTxCondition(payload).subscribe({ - next: (data) => { - if (data?.transaction?.length > 0) { - this.nextKey = null; - if (data?.transaction?.length >= 40) { - this.nextKey = data?.transaction[data?.transaction?.length - 1].height; - } - const txs = convertDataTransaction(data, this.coinInfo); - txs.forEach((element) => { - if (element.type === 'Send') { - if (!element.messages.find((k) => k.from_address === this.currentAddress)) { - element.type = 'Receive'; - } - } else if (element.type === 'Multisend') { - if (element.messages[0]?.inputs[0]?.address !== this.currentAddress) { - element.type = 'Receive'; - } - } - }); - - if (this.dataSource.data.length > 0) { - this.dataSource.data = [...this.dataSource.data, ...txs]; - } else { - this.dataSource.data = [...txs]; - } - this.dataSourceMobile = this.dataSource.data.slice( - this.pageData.pageIndex * this.pageData.pageSize, - this.pageData.pageIndex * this.pageData.pageSize + this.pageData.pageSize, - ); - - this.pageData.length = this.dataSource.data.length; - } - }, - error: () => { - this.transactionLoading = false; - }, - complete: () => { - this.transactionLoading = false; - }, - }); - } - getAccountDetail(): void { this.isNoData = false; const halftime = 15000; @@ -388,82 +191,13 @@ export class AccountDetailComponent implements OnInit, AfterViewInit { f.amount = f.amount || '0'; this.chartOptions.series.push(Number(f.amount)); }); - this.dataSourceToken.data = this.currentAccountDetail?.balances; - this.pageDataToken.length = this.currentAccountDetail?.balances?.length; - this.dataSourceTokenBk = this.dataSourceToken; - - this.dataSourceDelegation.data = this.currentAccountDetail?.delegations; - this.pageDataDelegation.length = this.currentAccountDetail?.delegations?.length; - - this.dataSourceUnBonding.data = this.currentAccountDetail?.unbonding_delegations; - this.pageDataUnbonding.length = this.currentAccountDetail?.unbonding_delegations?.length; - this.dataSourceReDelegation.data = this.currentAccountDetail?.redelegations; - this.pageDataRedelegation.length = this.currentAccountDetail?.redelegations?.length; - - if (this.currentAccountDetail?.vesting) { - this.dataSourceVesting = new MatTableDataSource([this.currentAccountDetail?.vesting]); - this.pageDataVesting.length = 1; - } - - if (this.userAddress === this.currentAddress) { - local.removeItem('accountDetail'); - //store data wallet info - let accountDetail = {}; - accountDetail['dataAccount'] = JSON.stringify(this.currentAccountDetail); - accountDetail['dataChart'] = JSON.stringify(this.chartOptions); - local.setItem('accountDetail', accountDetail); - } } }, () => {}, - () => { - this.accDetailLoading = false; - this.chartLoading = false; - }, + () => {}, ); } - searchToken(): void { - this.searchNullData = false; - - if (this.textSearch.length > 0) { - const data = this.dataSourceTokenBk.data.filter( - (f) => f.name.toLowerCase().indexOf(this.textSearch.toLowerCase().trim()) > -1, - ); - if (data && data.length === 0) { - this.searchNullData = true; - } - this.dataSourceToken = this.dataSourceTokenBk; - this.dataSourceToken = new MatTableDataSource(data); - } else { - this.dataSourceToken = this.dataSourceTokenBk; - } - } - - paginatorEmit(e: MatPaginator): void { - if (this.dataSource.paginator) { - e.page.next({ - length: this.dataSource.paginator.length, - pageIndex: 0, - pageSize: this.dataSource.paginator.pageSize, - previousPageIndex: this.dataSource.paginator.pageIndex, - }); - this.dataSource.paginator = e; - } else this.dataSource.paginator = e; - } - - pageEvent(e: PageEvent): void { - const { length, pageIndex, pageSize } = e; - const next = length <= (pageIndex + 2) * pageSize; - this.dataSourceMobile = this.dataSource.data.slice(pageIndex * pageSize, pageIndex * pageSize + pageSize); - this.pageData = e; - - if (next && this.nextKey && this.currentKey !== this.nextKey) { - this.getTxsFromHoroscope(this.nextKey); - this.currentKey = this.nextKey; - } - } - viewQrAddress(staticDataModal: any): void { this.modalReference = this.modalService.open(staticDataModal, { keyboard: false, diff --git a/src/app/pages/account/account-detail/account-detail.module.ts b/src/app/pages/account/account-detail/account-detail.module.ts index ebb1a9ffb..c859caad0 100644 --- a/src/app/pages/account/account-detail/account-detail.module.ts +++ b/src/app/pages/account/account-detail/account-detail.module.ts @@ -24,12 +24,27 @@ import { SharedModule } from '../../../shared/shared.module'; import { AccountDetailRoutingModule } from './account-detail-routing.module'; import { AccountDetailTableModule } from './account-detail-table/account-detail-table.module'; import { AccountDetailComponent } from './account-detail.component'; +import { AccountStakeComponent } from './account-stake/account-stake.component'; +import { AccountTransactionComponent } from './account-transaction/account-transaction.component'; import { NftListComponent } from './nft-list/nft-list.component'; import { SoulboundTokenComponent } from './soulbound-token/soulbound-token.component'; import { TokenTableComponent } from './token-table/token-table.component'; +import { AccountTransactionTableComponent } from './account-transaction-table/account-transaction-table.component'; +import { UserService } from 'src/app/core/services/user.service'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatNativeDateModule } from '@angular/material/core'; +import { RouterModule } from '@angular/router'; @NgModule({ - declarations: [AccountDetailComponent, TokenTableComponent, NftListComponent, SoulboundTokenComponent], + declarations: [ + AccountDetailComponent, + TokenTableComponent, + NftListComponent, + SoulboundTokenComponent, + AccountStakeComponent, + AccountTransactionComponent, + AccountTransactionTableComponent, + ], imports: [ CommonModule, AccountDetailRoutingModule, @@ -54,7 +69,8 @@ import { TokenTableComponent } from './token-table/token-table.component'; NameTagModule, TooltipCustomizeModule, ClipboardModule, + RouterModule ], - providers: [TransactionService, AccountService, DecimalPipe], + providers: [TransactionService, AccountService, DecimalPipe, UserService], }) export class AccountDetailModule {} diff --git a/src/app/pages/account/account-detail/account-stake/account-stake.component.html b/src/app/pages/account/account-detail/account-stake/account-stake.component.html new file mode 100644 index 000000000..ffe0dcdf2 --- /dev/null +++ b/src/app/pages/account/account-detail/account-stake/account-stake.component.html @@ -0,0 +1,135 @@ +
+
+

Stake

+
+
+
+
+
+ + + + + + + + + +
+
+ 1. {{ 'NOTICE.REDELEGATE_WAITING' | translate : { timeStaking: timeStaking } }}
+ 2. {{ 'NOTICE.NUMBER_REDELEGATE' | translate }} +
+ +
+ + + +
+
+ +
+
+
+
+
+
+
+ +
+ + + + + +
+
+
+
+
+
+
+
+
+ {{ denom }} + +
+ +
+
+
+ {{ item.name }} +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/app/pages/account/account-detail/account-stake/account-stake.component.scss b/src/app/pages/account/account-detail/account-stake/account-stake.component.scss new file mode 100644 index 000000000..2789eede5 --- /dev/null +++ b/src/app/pages/account/account-detail/account-stake/account-stake.component.scss @@ -0,0 +1,48 @@ +.right-border { + @media (min-width: 991.98px) { + border-right: 1px solid #363843 !important; + } +} + +.account__tab-item { + min-width: 160px; +} + +.chart-legend-item { + border-bottom: 1px solid var(--aura-gray-9); + &:last-of-type { + border-bottom: none; + } + + .item-color-balance { + width: 12px; + height: 12px; + border-radius: 50%; + @media (min-width: 992px) { + width: 16px; + height: 16px; + } + } +} + +@media (max-width: 991.98px) { + .row-eq-height { + flex-direction: column-reverse; + } +} + +.box-chart { + width: 180px; + height: 180px; + border: 1px solid #d3d3d3; + border-radius: 50%; + div { + width: 100px; + height: 100px; + border: 1px solid #d3d3d3; + border-radius: 50%; + } +} +.article-2 { + min-height: 500px; +} diff --git a/src/app/pages/account/account-detail/account-stake/account-stake.component.ts b/src/app/pages/account/account-detail/account-stake/account-stake.component.ts new file mode 100644 index 000000000..63643159a --- /dev/null +++ b/src/app/pages/account/account-detail/account-stake/account-stake.component.ts @@ -0,0 +1,175 @@ +import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; +import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { PageEvent } from '@angular/material/paginator'; +import { MatTableDataSource } from '@angular/material/table'; +import { Subject } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; +import { ACCOUNT_WALLET_COLOR } from 'src/app/core/constants/account.constant'; +import { PageEventType, StakeModeAccount } from 'src/app/core/constants/account.enum'; +import { DATE_TIME_WITH_MILLISECOND, PAGE_EVENT } from 'src/app/core/constants/common.constant'; +import { EnvironmentService } from 'src/app/core/data-services/environment.service'; +import { IAccountDetail } from 'src/app/core/models/account.model'; +import { TableTemplate } from 'src/app/core/models/common.model'; +import { AccountService } from 'src/app/core/services/account.service'; +import { Globals } from 'src/app/global/global'; +import { ChartOptions, chartCustomOptions } from '../chart-options'; + +@Component({ + selector: 'app-account-stake', + templateUrl: './account-stake.component.html', + styleUrls: ['./account-stake.component.scss'], +}) +export class AccountStakeComponent implements OnChanges { + @Input() chartOptions: Partial; + @Input() chartCustomOptions = chartCustomOptions; + @Input() currentAccountDetail: IAccountDetail; + + accDetailLoading = true; + isNoData = false; + currentStake = StakeModeAccount.Delegations; + stakeMode = StakeModeAccount; + pageEventType = PageEventType; + chartLoading = false; + + TABS_STAKE = [ + { + key: StakeModeAccount.Delegations, + label: 'Delegations', + }, + { + key: StakeModeAccount.Unbondings, + label: 'Unbondings', + }, + { + key: StakeModeAccount.Redelegations, + label: 'Redelegations', + }, + { + key: StakeModeAccount.Vestings, + label: 'Vestings', + }, + ]; + + templatesDelegation: Array = [ + { matColumnDef: 'validator_name', headerCellDef: 'Validator' }, + { matColumnDef: 'amount', headerCellDef: 'Amount' }, + { matColumnDef: 'reward', headerCellDef: 'Reward' }, + ]; + displayedColumnsDelegation: string[] = this.templatesDelegation.map((dta) => dta.matColumnDef); + dataSourceDelegation: MatTableDataSource; + + templatesUnBonding: Array = [ + { matColumnDef: 'validator_name', headerCellDef: 'Validator' }, + { matColumnDef: 'amount', headerCellDef: 'Amount' }, + { matColumnDef: 'completion_time', headerCellDef: 'Completion Time' }, + ]; + displayedColumnsUnBonding: string[] = this.templatesUnBonding.map((dta) => dta.matColumnDef); + dataSourceUnBonding: MatTableDataSource; + + templatesReDelegation: Array = [ + { matColumnDef: 'validator_src_name', headerCellDef: 'From' }, + { matColumnDef: 'validator_dst_name', headerCellDef: 'To' }, + { matColumnDef: 'amount', headerCellDef: 'Amount' }, + { matColumnDef: 'completion_time', headerCellDef: 'Time' }, + ]; + displayedColumnsReDelegation: string[] = this.templatesReDelegation.map((dta) => dta.matColumnDef); + dataSourceReDelegation: MatTableDataSource; + + templatesVesting: Array = [ + { matColumnDef: 'type_format', headerCellDef: 'Message' }, + { matColumnDef: 'amount', headerCellDef: 'Amount' }, + { matColumnDef: 'vesting_schedule', headerCellDef: 'Vesting Schedule' }, + ]; + displayedColumnsVesting: string[] = this.templatesVesting.map((dta) => dta.matColumnDef); + dataSourceVesting: MatTableDataSource; + + pageDataDelegation: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: PAGE_EVENT.PAGE_SIZE, + pageIndex: PAGE_EVENT.PAGE_INDEX, + }; + + pageDataUnbonding: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: PAGE_EVENT.PAGE_SIZE, + pageIndex: PAGE_EVENT.PAGE_INDEX, + }; + + pageDataRedelegation: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: PAGE_EVENT.PAGE_SIZE, + pageIndex: PAGE_EVENT.PAGE_INDEX, + }; + + pageDataVesting: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: PAGE_EVENT.PAGE_SIZE, + pageIndex: PAGE_EVENT.PAGE_INDEX, + }; + destroyed$ = new Subject(); + + breakpoint$ = this.layout.observe([Breakpoints.Small, Breakpoints.XSmall]).pipe(takeUntil(this.destroyed$)); + + timeStaking = `${this.environmentService.configValue.timeStaking}`; + denom = this.environmentService.configValue.chain_info.currencies[0].coinDenom; + + constructor( + public global: Globals, + private environmentService: EnvironmentService, + private layout: BreakpointObserver, + ) {} + + ngOnInit(): void { + this.timeStaking = (Number(this.timeStaking) / DATE_TIME_WITH_MILLISECOND).toString(); + this.chartCustomOptions = [...ACCOUNT_WALLET_COLOR]; + + this.dataSourceDelegation = new MatTableDataSource(); + this.dataSourceUnBonding = new MatTableDataSource(); + this.dataSourceReDelegation = new MatTableDataSource(); + + this.dataSourceDelegation.data = this.currentAccountDetail?.delegations; + this.pageDataDelegation.length = this.currentAccountDetail?.delegations?.length; + + setTimeout(() => { + this.accDetailLoading = false; + }, 2000); + } + + ngOnChanges(changes: SimpleChanges): void { + if (this.currentAccountDetail) { + this.accDetailLoading = false; + this.dataSourceDelegation.data = this.currentAccountDetail?.delegations; + this.pageDataDelegation.length = this.currentAccountDetail?.delegations?.length; + + this.dataSourceUnBonding.data = this.currentAccountDetail?.unbonding_delegations; + this.pageDataUnbonding.length = this.currentAccountDetail?.unbonding_delegations?.length; + + this.dataSourceReDelegation.data = this.currentAccountDetail?.redelegations; + this.pageDataRedelegation.length = this.currentAccountDetail?.redelegations?.length; + + if (this.currentAccountDetail?.vesting) { + this.dataSourceVesting = new MatTableDataSource([this.currentAccountDetail?.vesting]); + this.pageDataVesting.length = 1; + } + } + } + + changePage(page: any): void { + switch (page.pageEventType) { + case this.pageEventType.Delegation: + this.pageDataDelegation.pageIndex = page.pageIndex; + break; + case this.pageEventType.Unbonding: + this.pageDataUnbonding.pageIndex = page.pageIndex; + break; + case this.pageEventType.Redelegation: + this.pageDataRedelegation.pageIndex = page.pageIndex; + break; + case this.pageEventType.Vestings: + this.pageDataVesting.pageIndex = page.pageIndex; + break; + default: + break; + } + } +} diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html new file mode 100644 index 000000000..0664eabce --- /dev/null +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -0,0 +1,402 @@ +
+
+
+ + +
+
+ +
+
+
+ {{ nextKey ? 'More than' : 'A total of' }} {{ pageData?.length }} transaction{{ pageData?.length > 1 ? 's' : '' }} + found +
+
+ + + +
+

Filter

+ +
+ From - To +
+ + + + + +
+ +
+ +
+ Tnx Type + + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ +
+
+ +
+ + +
+
+
+
+
+
+
+ {{ nextKey ? 'More than' : 'A total of' }} {{ pageData?.length }} transaction{{ pageData?.length > 1 ? 's' : '' }} + found +
+ + + +
+ + + + + + + + + + + + + + + +
+
+ +
+ + +
+ + + + +
+
+ +
diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss new file mode 100644 index 000000000..77cdf8db5 --- /dev/null +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -0,0 +1,256 @@ +.contract-address { + width: 125px; +} + +.aura__change { + font-size: 1.4rem; + line-height: 1.8rem; + + &--desc, + &--asc { + &::after { + top: -3px; + left: 0; + transform: unset; + } + } +} + +.table-token { + overflow-y: scroll; + height: 380px; + + ::ng-deep table thead { + display: none; + } +} + +.token-filter-form.aura-form.single-input-field .input-group { + height: 40px; + + @media (min-width: 991.99px) { + width: 312px; + } + width: 100%; +} + +.image-token { + width: 24px; + height: 24px; + border-radius: 50%; +} + +.token-asset { + min-width: 175px; +} + +@media (max-width: 991.99px) { + .button-filter { + padding: 8px; + } + ::ng-deep { + .mat-form-field[tokenFilter] { + background-color: var(--aura-gray-10); + border-radius: 8px; + display: flex; + align-items: center; + width: 150px; + height: 40px; + // border: 1px solid transparent; + + @media (min-width: 991.98px) { + width: 100%; + } + + &.mat-focused { + border-color: var(--aura-white); + } + + .mat-form-field-wrapper { + width: 100%; + padding-bottom: 0; + } + + .mat-form-field-flex { + padding: 0 16px; + background: transparent; + height: 40px; + } + + .mat-form-field-infix { + padding: 4px 0 0.75em 0; + } + + .mat-select-placeholder, + mat-select-trigger { + position: relative; + color: var(--aura-gray-5); + font-size: 1.4rem; + line-height: 1.6rem; + } + + .mat-select-value { + color: var(--aura-gray-1); + } + + .mat-form-field-underline { + display: none; + } + + .mat-select-arrow-wrapper { + transform: translateY(-26%); + + .mat-select-arrow { + border: solid var(--aura-white); + border-width: 0 1px 1px 0; + display: inline-block; + padding: 4px; + transform: rotate(45deg); + -webkit-transform: rotate(45deg); + } + } + } + + mat-select.token-filter[aria-expanded='true'] { + .mat-select-arrow { + border-width: 1px 0 0 1px !important; + } + .mat-select-arrow-wrapper { + transform: translateY(2%); + } + } + + .token-filter-none::after, + .token-filter-none::before { + display: none; + } + + .filter-dropdown { + right: unset !important; + transform: translateX(-50%) !important; + width: 200px; + } + + .tokenFilterPanel { + border: 1px solid var(--aura-gray-8); + background: #25252c; + width: 214px !important; + min-width: 214px !important; + transform: translate3D(1px, 29px, 0) !important; + padding: var(--spacer-2) !important; + border-radius: 8px; + } + + .mat-option { + border-radius: 4px; + color: var(--aura-white) !important; + padding: 0 8px !important; + } + } +} + +::ng-deep { + @media (max-width: 414px) { + .nav-item { + min-width: 138px; + } + } +} + +.tnx-filter-item { + height: 44px; +} + +.tnx-filter-box { + max-height: 356px; + overflow-y: auto; + ::ng-deep { + .form-group label { + line-height: 18px !important; + } + } +} + +.box-type-selected { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 90%; +} + +.icon-expand { + &.active { + cursor: pointer; + color: var(--aura-white) !important; + } +} + +.row-tx:has(.ph-caret-up) { + background: linear-gradient(0deg, #262838, #262838), linear-gradient(0deg, #0e7e6b, #0e7e6b); + ::ng-deep { + .box-name-tag:not(.private-name-tag) { + &:after { + border-right: 15px solid #262838 !important; + } + } + } +} + +.account-transaction-table { + .aura-status .status { + background-color: unset; + padding: 0; + } + app-name-tag { + min-height: 30px; + display: flex; + align-items: center; + } + .item-show { + height: 30px; + display: flex; + align-items: center; + margin-bottom: var(--spacer-4); + } + tr td { + vertical-align: top; + padding-top: var(--spacer-4); + &:nth-child(5), + &:nth-child(6), + &:nth-child(7) { + padding-top: var(--spacer-3); + } + &:nth-child(2) { + padding-top: var(--spacer-2); + } + } + .aura-status.aura-tooltip-contain { + // transform: translateY(-8px); + } + .explain-data { + transition: max-height 0.35s ease-in-out; + max-height: 0; + overflow: hidden; + &.show { + max-height: 99999px; + } + } + .box-number { + border: solid 1px var(--aura-gray-8); + border-radius: 4px; + margin-left: var(--spacer-3); + padding: 2px 6px 2px 6px; + display: flex; + align-items: center; + font-size: 12px; + cursor: pointer; + .icon-expand { + margin-bottom: 2px; + } + } +} + +.btn-select-type{ + background-color: unset; + color: white; +} diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts new file mode 100644 index 000000000..972df7f68 --- /dev/null +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -0,0 +1,389 @@ +import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; +import { DatePipe } from '@angular/common'; +import { Component, Input, ViewChild } from '@angular/core'; +import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { MatTableDataSource } from '@angular/material/table'; +import { ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import { AccountTxType, TabsAccount } from 'src/app/core/constants/account.enum'; +import { DATEFORMAT, PAGE_EVENT } from 'src/app/core/constants/common.constant'; +import { MAX_LENGTH_SEARCH_TOKEN } from 'src/app/core/constants/token.constant'; +import { TYPE_TRANSACTION } from 'src/app/core/constants/transaction.constant'; +import { EnvironmentService } from 'src/app/core/data-services/environment.service'; +import { TableTemplate } from 'src/app/core/models/common.model'; +import { CommonService } from 'src/app/core/services/common.service'; +import { UserService } from 'src/app/core/services/user.service'; +import { Globals, convertDataAccountTransaction } from 'src/app/global/global'; +import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; + +@Component({ + selector: 'app-account-transaction-table', + templateUrl: './account-transaction-table.component.html', + styleUrls: ['./account-transaction-table.component.scss'], +}) +export class AccountTransactionTableComponent { + @ViewChild(PaginatorComponent) pageChange: PaginatorComponent; + @Input() address: string; + @Input() modeQuery: string; + @Input() displayType: boolean = false; + + transactionLoading = false; + currentAddress: string; + tokenFilter = ''; + textSearch = ''; + searchValue = ''; + templates: Array; + tabsData = TabsAccount; + + templatesExecute: Array = [ + { matColumnDef: 'tx_hash', headerCellDef: 'Tx Hash', headerWidth: 18 }, + { matColumnDef: 'type', headerCellDef: 'Message', headerWidth: 20 }, + { matColumnDef: 'status', headerCellDef: 'Result', headerWidth: 12 }, + { matColumnDef: 'timestamp', headerCellDef: 'Time', headerWidth: 15 }, + { matColumnDef: 'fee', headerCellDef: 'Fee', headerWidth: 20 }, + { matColumnDef: 'height', headerCellDef: 'Height', headerWidth: 12 }, + ]; + + templatesToken: Array = [ + { matColumnDef: 'tx_hash', headerCellDef: 'Tx Hash', headerWidth: 14 }, + { matColumnDef: 'type', headerCellDef: 'Message', headerWidth: 15 }, + { matColumnDef: 'status', headerCellDef: 'Result', headerWidth: 8 }, + { matColumnDef: 'timestamp', headerCellDef: 'Time', headerWidth: 12 }, + { matColumnDef: 'fromAddress', headerCellDef: 'From', headerWidth: 17 }, + { matColumnDef: 'toAddress', headerCellDef: 'To', headerWidth: 17 }, + ]; + + displayedColumns: string[]; + + pageData: PageEvent = { + length: PAGE_EVENT.LENGTH, + pageSize: 5, + pageIndex: PAGE_EVENT.PAGE_INDEX, + }; + nextKey = null; + currentKey = null; + + dataSource: MatTableDataSource = new MatTableDataSource([]); + dataSourceMobile: any[]; + maxLengthSearch = MAX_LENGTH_SEARCH_TOKEN; + assetsLoading = true; + total = 0; + dataTable = []; + transactionFilter: any; + transactionTypeKeyWord = ''; + tnxType = []; + tnxTypeOrigin = []; + listTypeSelected = ''; + currentType = AccountTxType.Sent; + accountTxType = AccountTxType; + isSearch = false; + minDate; + maxDate; + linkToken = 'token-nft'; + typeTx = [AccountTxType.Sent, AccountTxType.Received]; + + breakpoint$ = this.layout.observe([Breakpoints.Small, Breakpoints.XSmall]); + denom = this.environmentService.configValue.chain_info.currencies[0].coinDenom; + coinMiniDenom = this.environmentService.configValue.chain_info.currencies[0].coinMinimalDenom; + coinInfo = this.environmentService.configValue.chain_info.currencies[0]; + + constructor( + public global: Globals, + private environmentService: EnvironmentService, + private layout: BreakpointObserver, + public commonService: CommonService, + private userService: UserService, + private route: ActivatedRoute, + private datePipe: DatePipe, + ) { + this.minDate = new Date(2023, 2, 20); + this.maxDate = new Date().toISOString().slice(0, 10); + } + + ngOnInit(): void { + this.initTnxFilter(); + if (this.tnxTypeOrigin?.length === 0) { + this.getListTypeFilter(); + } + this.route.params.subscribe((params) => { + if (params?.address) { + this.currentAddress = params?.address; + this.transactionLoading = true; + + this.dataSource = new MatTableDataSource(); + this.getTxsAddress(); + } + }); + } + + initTnxFilter() { + this.transactionTypeKeyWord = ''; + this.listTypeSelected = ''; + this.transactionFilter = { + startDate: null, + endDate: null, + type: [], + }; + } + + onChangeTnxFilterType(event, type: any) { + if (event.target.checked) { + if (type === 'all') { + this.transactionFilter.type = null; + this.listTypeSelected = 'All'; + } else { + this.transactionFilter.type.push(type.label); + if (!this.listTypeSelected) { + this.listTypeSelected = type.value; + } else { + this.listTypeSelected += ', ' + type.value; + } + } + } else { + this.listTypeSelected = this.listTypeSelected?.replace(', ' + type?.value, '').replace(type?.value, ''); + if (type === 'all') { + this.transactionFilter.type = []; + this.listTypeSelected = ''; + } else { + this.transactionFilter.type.forEach((element, index) => { + if (element === type.label) { + this.transactionFilter.type.splice(index, 1); + } + }); + } + } + } + + searchTransactionType() { + this.tnxType = this.tnxType.filter( + (k) => k.value.toLowerCase().indexOf(this.transactionTypeKeyWord.toLowerCase().trim()) > -1, + ); + } + + clearFilterSearch() { + this.tnxType = this.tnxTypeOrigin; + this.transactionTypeKeyWord = ''; + this.listTypeSelected = ''; + } + + searchType(isSearch = true) { + this.transactionLoading = true; + this.dataSource = new MatTableDataSource(); + this.pageData.length = 0; + this.pageData.pageIndex = 0; + this.nextKey = null; + this.isSearch = isSearch; + this.getTxsAddress(); + } + + changeType(currentType = AccountTxType.Sent) { + this.currentType = currentType; + this.searchType(); + } + + getConvertDate(date, lastDate = false) { + if (!date) { + return null; + } + + let temp = this.datePipe.transform(date, DATEFORMAT.DATE_ONLY); + let subStringDate = lastDate ? 'T24:00:000Z' : 'T00:00:000Z'; + return temp + subStringDate; + } + + getTxsAddress(nextKey = null): void { + const address = this.currentAddress; + + let payload = { + limit: 100, + address: address, + heightLT: nextKey, + compositeKey: null, + listTxMsgType: null, + startTime: this.getConvertDate(this.transactionFilter.startDate) || null, + endTime: this.getConvertDate(this.transactionFilter.endDate, true) || null, + }; + + if (this.transactionFilter?.type?.length > 0) { + payload.listTxMsgType = this.transactionFilter?.type; + } + + switch (this.modeQuery) { + case TabsAccount.ExecutedTxs: + payload.compositeKey = 'message.sender'; + this.templates = this.templatesExecute; + this.displayedColumns = this.templatesExecute.map((dta) => dta.matColumnDef); + this.getListTxByAddress(payload); + break; + case TabsAccount.AuraTxs: + payload.compositeKey = 'coin_spent.spender'; + if (this.currentType !== AccountTxType.Sent) { + payload.compositeKey = 'coin_received.receiver'; + } + this.templates = [...this.templatesToken]; + this.templates.push({ matColumnDef: 'amount', headerCellDef: 'Amount', headerWidth: 15 }); + this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); + // this.getListTxAuraByAddress(payload); + break; + case TabsAccount.FtsTxs: + if (this.currentType === AccountTxType.Sent) { + payload['sender'] = address; + } else { + payload['receiver'] = address; + } + this.templates = [...this.templatesToken]; + this.templates.push({ matColumnDef: 'amount', headerCellDef: 'Amount', headerWidth: 17 }); + this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); + this.getListFTByAddress(payload); + break; + case TabsAccount.NftTxs: + if (this.currentType === AccountTxType.Sent) { + payload['sender'] = address; + } else { + payload['receiver'] = address; + } + this.templates = [...this.templatesToken]; + this.templates.push({ matColumnDef: 'tokenId', headerCellDef: 'Token ID', headerWidth: 17 }); + this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); + this.getListNFTByAddress(payload); + break; + default: + break; + } + + setTimeout(() => { + this.transactionLoading = false; + }, 5000); + } + + getListTypeFilter() { + this.userService.getListTypeFilter().subscribe((res) => { + this.tnxType = res?.transaction_message?.map((element) => { + let type = _.find(TYPE_TRANSACTION, { label: element?.type })?.value; + const obj = { label: element?.type, value: type }; + return obj; + }); + this.tnxType = this.tnxType?.filter((k) => k.value); + this.tnxTypeOrigin = [...this.tnxType]; + }); + } + + getListTxByAddress(payload) { + this.userService.getListTxByAddress(payload).subscribe({ + next: (data) => { + this.handleGetData(data); + }, + error: () => { + this.transactionLoading = false; + }, + complete: () => { + this.transactionLoading = false; + }, + }); + } + + getListTxAuraByAddress(payload) { + this.userService.getListTxAuraByAddress(payload).subscribe({ + next: (data) => { + this.handleGetData(data); + }, + error: () => { + this.transactionLoading = false; + }, + complete: () => { + this.transactionLoading = false; + }, + }); + } + + getListFTByAddress(payload) { + this.userService.getListFTByAddress(payload).subscribe({ + next: (data) => { + this.handleGetData(data); + }, + error: () => { + this.transactionLoading = false; + }, + complete: () => { + this.transactionLoading = false; + }, + }); + } + + getListNFTByAddress(payload) { + this.userService.getListNFTByAddress(payload).subscribe({ + next: (data) => { + this.handleGetData(data); + }, + error: () => { + this.transactionLoading = false; + }, + complete: () => { + this.transactionLoading = false; + }, + }); + } + + handleGetData(data) { + if (data?.transaction?.length > 0) { + if (data?.transaction?.length >= 100) { + this.nextKey = data?.transaction[data?.transaction?.length - 1]?.height; + } + + let setReceive = false; + if (this.modeQuery !== TabsAccount.ExecutedTxs && this.currentType !== AccountTxType.Sent) { + setReceive = true; + } + + let txs = convertDataAccountTransaction(data, this.coinInfo, this.modeQuery, setReceive); + if (this.dataSource.data.length > 0) { + this.dataSource.data = [...this.dataSource.data, ...txs]; + } else { + this.dataSource.data = [...txs]; + } + + this.dataSourceMobile = this.dataSource.data.slice( + this.pageData.pageIndex * this.pageData.pageSize, + this.pageData.pageIndex * this.pageData.pageSize + this.pageData.pageSize, + ); + + this.pageData.length = this.dataSource.data.length; + } + } + + seeMoreData(data) { + data.limit += 6; + } + + expandData(data) { + if (data.arrEvent?.length <= 1) { + return; + } + data.limit = 6; + data.expand = !data.expand; + } + + paginatorEmit(e: MatPaginator): void { + if (this.dataSource.paginator) { + e.page.next({ + length: this.dataSource.paginator.length, + pageIndex: 0, + pageSize: this.dataSource.paginator.pageSize, + previousPageIndex: this.dataSource.paginator.pageIndex, + }); + this.dataSource.paginator = e; + } else this.dataSource.paginator = e; + } + + pageEvent(e: PageEvent): void { + const { length, pageIndex, pageSize } = e; + const next = length <= (pageIndex + 2) * pageSize; + this.dataSourceMobile = this.dataSource.data.slice(pageIndex * pageSize, pageIndex * pageSize + pageSize); + this.pageData = e; + + if (next && this.nextKey && this.currentKey !== this.nextKey) { + this.getTxsAddress(this.nextKey); + this.currentKey = this.nextKey; + } + } +} diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html new file mode 100644 index 000000000..9f75a8c14 --- /dev/null +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html @@ -0,0 +1,59 @@ +
+
+

Transactions

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ +
+ Fetching data, might take longer than usual.
+ Please come back later or + refresh the page +
+
+
+
diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss new file mode 100644 index 000000000..4278e97cc --- /dev/null +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss @@ -0,0 +1,51 @@ +.filter-container { + width: 420px; +} +::ng-deep .mat-menu-panel.tnx-type-panel { + width: 388px; + max-width: unset; + @media (max-width: 414px) { + transform: translateX(16px); + } +} +::ng-deep .mat-menu-panel.tsx-filter-panel { + max-width: unset; + border-radius: var(--spacer-2); + .mat-menu-content { + padding: 0; + } + .mat-date-range-input { + width: auto; + } + .mat-date-range-input-start-wrapper { + width: 100%; + } + .aura-form .input-group { + background-color: transparent; + border-color: var(--aura-gray-8) !important; + input { + width: 110px; + max-width: 100%; + white-space: unset; + overflow: unset; + text-overflow: unset; + } + } + @media (min-width: 991.98px) { + .aura-form { + width: 388px; + } + } +} +.button-apply:disabled { + background-color: var(--aura-gray-8); + span { + color: var(--aura-black); + } + &:hover { + border-color: transparent; + } +} +.input-group.tnx-type-search { + height: 40px; +} diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts new file mode 100644 index 000000000..2c71fe8aa --- /dev/null +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts @@ -0,0 +1,33 @@ +import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; +import { AfterViewInit, Component, OnInit } from '@angular/core'; +import { Subject } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; +import { TABS_TITLE_ACCOUNT } from 'src/app/core/constants/account.constant'; +import { TabsAccount } from 'src/app/core/constants/account.enum'; + +@Component({ + selector: 'app-account-transaction', + templateUrl: './account-transaction.component.html', + styleUrls: ['./account-transaction.component.scss'], +}) +export class AccountTransactionComponent implements OnInit, AfterViewInit { + // loading param check + isNoData = false; + + destroyed$ = new Subject(); + breakpoint$ = this.layout.observe([Breakpoints.Small, Breakpoints.XSmall]).pipe(takeUntil(this.destroyed$)); + + TABS = TABS_TITLE_ACCOUNT; + tabsData = TabsAccount; + currentTab = TabsAccount.ExecutedTxs; + + constructor(private layout: BreakpointObserver) {} + + ngAfterViewInit(): void {} + + ngOnInit(): void {} + + reloadData() { + location.reload(); + } +} diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.html b/src/app/pages/account/account-detail/nft-list/nft-list.component.html index cc676ce99..f2f53821f 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.html +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.html @@ -1,39 +1,60 @@ -

NFTs ({{ pageData?.length || 0 }} NFTs)

-
+
-
- -
-
-
- -
- @@ -88,7 +109,10 @@

NFTs ({{ pageData?.length || 0 }} NFTs)

- +
diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.scss b/src/app/pages/account/account-detail/nft-list/nft-list.component.scss index a28106e91..d10d904d4 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.scss +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.scss @@ -1,9 +1,104 @@ .aura-form.single-input-field { .input-group { - padding: 0 var(--spacer-6); + padding: 0 var(--spacer-3); input { font-size: 1.4rem; line-height: 1.9rem; } } } + +.nft-filter-form.aura-form.single-input-field .input-group { + height: 40px; + min-width: 312px; +} + +::ng-deep { + .mat-form-field[nftFilter] { + background-color: var(--aura-gray-10); + border-radius: 8px; + display: flex; + align-items: center; + width: 150px; + height: 40px; + // border: 1px solid transparent; + @media (min-width: 991.98px) { + width: 100%; + } + &.mat-focused { + border-color: var(--aura-white); + } + + .mat-form-field-wrapper { + width: 100%; + padding-bottom: 0; + } + + .mat-form-field-flex { + padding: 0 16px; + background: transparent; + height: 40px; + } + + .mat-form-field-infix { + padding: 4px 0 0.75em 0; + } + + .mat-select-placeholder, + mat-select-trigger { + position: relative; + color: var(--aura-gray-5); + font-size: 1.4rem; + line-height: 1.6rem; + } + + .mat-select-value { + color: var(--aura-gray-1); + } + + .mat-form-field-underline { + display: none; + } + + .mat-select-arrow-wrapper { + transform: translateY(-26%); + + .mat-select-arrow { + border: solid var(--aura-white); + border-width: 0 1px 1px 0; + display: inline-block; + padding: 4px; + transform: rotate(45deg); + -webkit-transform: rotate(45deg); + } + } + } + mat-select.nft-filter[aria-expanded='true'] { + .mat-select-arrow { + border-width: 1px 0 0 1px !important; + } + .mat-select-arrow-wrapper { + transform: translateY(2%); + } + } + + .nftFilterPanel { + border: 1px solid var(--aura-gray-8); + background: #25252c; + min-width: calc(100% + 20px) !important; + transform: translate3D(5px, 32px, 0) !important; + padding: var(--spacer-2) !important; + border-radius: 8px; + } + .mat-option { + border-radius: 4px; + color: var(--aura-white) !important; + padding: 0 8px !important; + } +} + +.box-nft { + .input-group { + height: 40px; + } +} diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.ts b/src/app/pages/account/account-detail/nft-list/nft-list.component.ts index 294302e5f..0d2676d98 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.ts +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.ts @@ -21,13 +21,21 @@ export class NftListComponent implements OnChanges { loading = true; pageData: PageEvent = { length: PAGE_EVENT.LENGTH, - pageSize: 20, + pageSize: 10, pageIndex: 1, }; + nftFilter = null; nftList = []; maxLengthSearch = MAX_LENGTH_SEARCH_TOKEN; totalValue = 0; textSearch = ''; + listCollection = [ + { + label: 'All', + quantity: 0, + address: null, + }, + ]; constructor( private accountService: AccountService, @@ -47,6 +55,7 @@ export class NftListComponent implements OnChanges { limit: this.pageData.pageSize, keyword: this.textSearch, offset: (this.pageData.pageIndex - 1) * this.pageData.pageSize, + address: this.nftFilter, }; this.accountService.getAssetCW721ByOwner(payload).subscribe( @@ -55,7 +64,7 @@ export class NftListComponent implements OnChanges { this.nftList = res?.cw721_token; this.pageData.length = res.cw721_token_aggregate?.aggregate?.count; - this.nftList.forEach((element) => { + this.nftList?.forEach((element) => { element.contract_address = _.get(element, 'cw721_contract.smart_contract.address'); element.token_name = _.get(element, 'cw721_contract.name'); if (!this.searchValue) { @@ -74,6 +83,29 @@ export class NftListComponent implements OnChanges { ); } + getListCollection() { + const payload = { + owner: this.address, + }; + + this.accountService.getListCollectionByOwner(payload).subscribe( + (res) => { + if (res?.cw721_contract?.length > 0) { + res.cw721_contract.forEach((item) => { + this.listCollection.push({ + label: item.name, + quantity: item.cw721_tokens_aggregate.aggregate.count, + address: item.smart_contract.address, + }); + }); + this.listCollection[0].quantity = res?.cw721_token_aggregate?.aggregate?.count; + } + }, + () => {}, + () => {}, + ); + } + resetSearch(): void { this.searchValue = ''; this.textSearch = ''; @@ -92,6 +124,7 @@ export class NftListComponent implements OnChanges { this.pageData.pageIndex = 1; } this.getNftData(); + this.getListCollection(); } handleRouterLink(link): void { diff --git a/src/app/pages/account/account-detail/soulbound-token/soulbound-token.component.html b/src/app/pages/account/account-detail/soulbound-token/soulbound-token.component.html index efb40709e..e0b8ff71d 100644 --- a/src/app/pages/account/account-detail/soulbound-token/soulbound-token.component.html +++ b/src/app/pages/account/account-detail/soulbound-token/soulbound-token.component.html @@ -1,4 +1,4 @@ -

ABT Creators ({{ assetSoulBound?.length || 0 }})

+

Account Bound Tokens ({{ assetSoulBound?.length || 0 }})

@@ -50,13 +50,15 @@

ABT Creators ({{ assetSoulBound?.length || 0 }})CW-721

-
- Token: - {{ item.name }} -
-
- Status: - {{ item.status }} +
+
+ Token: + {{ item.name }} +
+
+ Status: + {{ item.status }} +
diff --git a/src/app/pages/account/account-detail/token-table/token-table.component.html b/src/app/pages/account/account-detail/token-table/token-table.component.html index 7dd08868d..662749699 100644 --- a/src/app/pages/account/account-detail/token-table/token-table.component.html +++ b/src/app/pages/account/account-detail/token-table/token-table.component.html @@ -1,120 +1,192 @@ -
-
-
+
+
+
-
-
$ {{ total || 0 | number : global.formatNumber2Decimal }}
-
-
@@ -151,4 +149,4 @@

Total Value

- \ No newline at end of file + diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 0664eabce..eba6a603c 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -292,7 +292,7 @@

Filter

> Collapse all
-
+
dta.matColumnDef); - // this.getListTxAuraByAddress(payload); + this.getListTxAuraByAddress(payload); break; case TabsAccount.FtsTxs: if (this.currentType === AccountTxType.Sent) { @@ -243,7 +243,7 @@ export class AccountTransactionTableComponent { payload['receiver'] = address; } this.templates = [...this.templatesToken]; - this.templates.push({ matColumnDef: 'tokenId', headerCellDef: 'Token ID', headerWidth: 17 }); + this.templates.push({ matColumnDef: 'tokenId', headerCellDef: 'Token ID', headerWidth: 21 }); this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); this.getListNFTByAddress(payload); break; @@ -335,7 +335,7 @@ export class AccountTransactionTableComponent { setReceive = true; } - let txs = convertDataAccountTransaction(data, this.coinInfo, this.modeQuery, setReceive); + let txs = convertDataAccountTransaction(data, this.coinInfo, this.modeQuery, setReceive, this.currentAddress); if (this.dataSource.data.length > 0) { this.dataSource.data = [...this.dataSource.data, ...txs]; } else { diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts index 2c71fe8aa..2de07108a 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts @@ -1,5 +1,5 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; -import { AfterViewInit, Component, OnInit } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { TABS_TITLE_ACCOUNT } from 'src/app/core/constants/account.constant'; @@ -10,8 +10,7 @@ import { TabsAccount } from 'src/app/core/constants/account.enum'; templateUrl: './account-transaction.component.html', styleUrls: ['./account-transaction.component.scss'], }) -export class AccountTransactionComponent implements OnInit, AfterViewInit { - // loading param check +export class AccountTransactionComponent implements OnInit { isNoData = false; destroyed$ = new Subject(); @@ -23,8 +22,6 @@ export class AccountTransactionComponent implements OnInit, AfterViewInit { constructor(private layout: BreakpointObserver) {} - ngAfterViewInit(): void {} - ngOnInit(): void {} reloadData() { diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.html b/src/app/pages/account/account-detail/nft-list/nft-list.component.html index f2f53821f..f54b88f99 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.html +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html index 79b830b7d..fdd7aad3f 100644 --- a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html @@ -41,7 +41,7 @@ {{ (commonService.setNameTag(userAddress) | cutStringPipe : 8 : 8) || '-' }} - +
-
+
diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html index 18a4d17c7..2da734fec 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html @@ -5,8 +5,7 @@

ABTs ({{ soulboundList?.length || 0 }}) [routerLink]="['/accountbound/account', accountAddress]" (click)="setLinkTab()" [class.mr-2]="soulboundUnclaimedNum > 0" - class="button button-pill button-outline button--sm position-relative aura-tooltip-contain d-inline-flex" - *ngIf="wallet === accountAddress"> + class="button button-pill button-outline button--sm position-relative aura-tooltip-contain d-inline-flex"> {{ wallet === accountAddress ? 'Manage your ABTs' : 'See more' }} From 4bde7e426879f7244a80f76868211585191bec5e Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 24 Aug 2023 09:51:03 +0700 Subject: [PATCH 011/142] fix loading abt creator --- src/app/pages/fee-grant/fee-grant.component.ts | 1 - .../soulbound-contract-list.component.html | 12 ++++++------ .../soulbound-contract-list.component.ts | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/pages/fee-grant/fee-grant.component.ts b/src/app/pages/fee-grant/fee-grant.component.ts index 269e6b84b..2e01a8b28 100644 --- a/src/app/pages/fee-grant/fee-grant.component.ts +++ b/src/app/pages/fee-grant/fee-grant.component.ts @@ -31,7 +31,6 @@ export class FeeGrantComponent implements OnInit { mergeMap((_) => this.walletService.wallet$), ) .subscribe((wallet) => { - const urlPath = window.location.pathname.replace(/^\/([^\/]*).*$/, '$1'); if (wallet) { this.currentAddress = wallet.bech32Address; } diff --git a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html index 66f0ae41d..671d40fd2 100644 --- a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html @@ -2,10 +2,10 @@

ABT Creator

- -
Smart Contracts
+ +
Smart Contracts
@@ -114,11 +114,11 @@

ABT Creator

- + - + *ngIf="isNoData"> + this.walletService.wallet$), ) .subscribe((wallet) => { - const urlPath = window.location.pathname.replace(/^\/([^\/]*).*$/, '$1'); if (wallet) { window.addEventListener('keplr_keystorechange', () => { this.isNoData = true; @@ -104,6 +103,7 @@ export class SoulboundContractListComponent implements OnInit { } getListSmartContract() { + this.loading = true; if (this.currentAddress === null) { return; } From 2337e76a77c175f95efa3b1dad9e14f0a0eaf22a Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 24 Aug 2023 11:12:56 +0700 Subject: [PATCH 012/142] update text --- .../soulbound-contract-list.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html index 66f0ae41d..e2f03d492 100644 --- a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html @@ -122,7 +122,7 @@

ABT Creator

From db3065b36e0b4ac5eb4dbff82b6e0fc3b1c1509a Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 24 Aug 2023 09:51:03 +0700 Subject: [PATCH 013/142] fix loading abt creator (cherry picked from commit 4bde7e426879f7244a80f76868211585191bec5e) --- src/app/pages/fee-grant/fee-grant.component.ts | 1 - .../soulbound-contract-list.component.html | 12 ++++++------ .../soulbound-contract-list.component.ts | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/pages/fee-grant/fee-grant.component.ts b/src/app/pages/fee-grant/fee-grant.component.ts index 269e6b84b..2e01a8b28 100644 --- a/src/app/pages/fee-grant/fee-grant.component.ts +++ b/src/app/pages/fee-grant/fee-grant.component.ts @@ -31,7 +31,6 @@ export class FeeGrantComponent implements OnInit { mergeMap((_) => this.walletService.wallet$), ) .subscribe((wallet) => { - const urlPath = window.location.pathname.replace(/^\/([^\/]*).*$/, '$1'); if (wallet) { this.currentAddress = wallet.bech32Address; } diff --git a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html index e2f03d492..d04665faa 100644 --- a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html @@ -2,10 +2,10 @@

ABT Creator

- -
Smart Contracts
+ +
Smart Contracts
@@ -114,11 +114,11 @@

ABT Creator

- + - + *ngIf="isNoData"> + this.walletService.wallet$), ) .subscribe((wallet) => { - const urlPath = window.location.pathname.replace(/^\/([^\/]*).*$/, '$1'); if (wallet) { window.addEventListener('keplr_keystorechange', () => { this.isNoData = true; @@ -104,6 +103,7 @@ export class SoulboundContractListComponent implements OnInit { } getListSmartContract() { + this.loading = true; if (this.currentAddress === null) { return; } From aa058520301b88ff6d1fda46656a21d3cbdd534f Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Wed, 23 Aug 2023 14:44:15 +0700 Subject: [PATCH 014/142] disable mouse wheel --- src/app/pages/dashboard/dashboard-chart-options.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/pages/dashboard/dashboard-chart-options.ts b/src/app/pages/dashboard/dashboard-chart-options.ts index 5fb1792e5..a4f5ee4c1 100644 --- a/src/app/pages/dashboard/dashboard-chart-options.ts +++ b/src/app/pages/dashboard/dashboard-chart-options.ts @@ -31,6 +31,9 @@ export const DASHBOARD_CHART_OPTIONS: DeepPartial = { secondsVisible: true, minBarSpacing: 5, }, + handleScale: { + mouseWheel: false, + }, }; export const DASHBOARD_AREA_SERIES_CHART_OPTIONS: SeriesPartialOptionsMap['Area'] = { From b3d9d0be7781aafb72545ba99ba6da835a72c3b9 Mon Sep 17 00:00:00 2001 From: mtam Date: Thu, 24 Aug 2023 14:36:35 +0700 Subject: [PATCH 015/142] [TamTM6] update transfer nft --- src/app/core/constants/account.constant.ts | 8 ++-- src/app/core/constants/account.enum.ts | 7 +++ src/app/core/services/user.service.ts | 8 +++- src/app/global/global.ts | 46 +++++++++++-------- .../account-detail.component.html | 2 +- .../account-transaction-table.component.html | 9 ++-- .../account-transaction-table.component.ts | 21 ++++++--- .../account-transaction.component.html | 7 ++- .../account-transaction.component.ts | 22 ++++++--- 9 files changed, 87 insertions(+), 43 deletions(-) diff --git a/src/app/core/constants/account.constant.ts b/src/app/core/constants/account.constant.ts index 3e9c6bc45..b38921cb1 100644 --- a/src/app/core/constants/account.constant.ts +++ b/src/app/core/constants/account.constant.ts @@ -18,8 +18,8 @@ export const ACCOUNT_WALLET_COLOR = [ ]; export const TABS_TITLE_ACCOUNT = [ - { label: TabsAccount.ExecutedTxs }, - { label: TabsAccount.AuraTxs }, - { label: TabsAccount.FtsTxs }, - { label: TabsAccount.NftTxs }, + { label: TabsAccount.ExecutedTxs, value: 'execute' }, + { label: TabsAccount.AuraTxs, value: 'aura-transfer' }, + { label: TabsAccount.FtsTxs, value: 'ft-transfer' }, + { label: TabsAccount.NftTxs, value: 'nft-transfer' }, ]; diff --git a/src/app/core/constants/account.enum.ts b/src/app/core/constants/account.enum.ts index 4b4c6d22f..1a7934b5a 100644 --- a/src/app/core/constants/account.enum.ts +++ b/src/app/core/constants/account.enum.ts @@ -52,6 +52,13 @@ export enum TabsAccount { NftTxs = 'NFTs TRANSFER', } +export enum TabsAccountLink { + ExecutedTxs = 'execute', + AuraTxs = 'aura-transfer', + FtsTxs = 'ft-transfer', + NftTxs = 'nft-transfer', +} + export enum StakeModeAccount { Delegations = 0, Unbondings = 1, diff --git a/src/app/core/services/user.service.ts b/src/app/core/services/user.service.ts index bb3257d01..4a35a6298 100644 --- a/src/app/core/services/user.service.ts +++ b/src/app/core/services/user.service.ts @@ -227,7 +227,13 @@ export class UserService extends CommonService { from to sender - cw721_token_id + } + smart_contract { + cw721_contract { + cw721_tokens { + token_id + } + } } } } diff --git a/src/app/global/global.ts b/src/app/global/global.ts index 9910ccb95..05ce32cd2 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; import * as _ from 'lodash'; +import { TabsAccountLink } from '../core/constants/account.enum'; import { LENGTH_CHARACTER, NULL_ADDRESS, NUMBER_CONVERT } from '../core/constants/common.constant'; import { TYPE_TRANSACTION } from '../core/constants/transaction.constant'; import { @@ -11,7 +12,6 @@ import { } from '../core/constants/transaction.enum'; import { CommonDataDto } from '../core/models/common.model'; import { balanceOf } from '../core/utils/common/parsing'; -import { TabsAccount } from '../core/constants/account.enum'; Injectable(); export class Globals { @@ -384,10 +384,10 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece let contractAddress; switch (modeQuery) { - case TabsAccount.ExecutedTxs: + case TabsAccountLink.ExecutedTxs: type = getTypeTx(element); break; - case TabsAccount.AuraTxs: + case TabsAccountLink.AuraTxs: arrEvent = _.get(element, 'transaction_messages')?.map((item, index) => { let type = getTypeTx(element, index); let fromAddress = currentAddress; @@ -406,7 +406,7 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece return { type, fromAddress, toAddress, amount, denom }; }); break; - case TabsAccount.FtsTxs: + case TabsAccountLink.FtsTxs: arrEvent = _.get(element, 'events')?.map((item, index) => { let type = getTypeTx(element, index); let fromAddress = _.get(item, 'smart_contract_events[0].cw20_activities[0].from') || NULL_ADDRESS; @@ -418,12 +418,12 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece return { type, fromAddress, toAddress, amount, denom }; }); break; - case TabsAccount.NftTxs: + case TabsAccountLink.NftTxs: arrEvent = _.get(element, 'events')?.map((item, index) => { + console.log(element); + const typeOrigin = _.get(element, 'transaction_messages[0].content["@type"]'); - let type = item?.smart_contract_events[index] - ? item?.smart_contract_events[index]?.cw721_activity?.action - : null; + let type = item?.smart_contract_events[0] ? item?.smart_contract_events[0]?.cw721_activity?.action : null; if (typeOrigin === TRANSACTION_TYPE_ENUM.ExecuteContract) { type = 'Execute_' + type[0]?.toUpperCase() + type?.substr(1)?.toLowerCase(); } @@ -432,21 +432,25 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece let contractAddress = _.get(element, 'transaction_messages[0].content.contract'); let dataTemp = _.get(element, 'transaction_messages[0].content.msg'); let tokenId; - if (typeof dataTemp === 'string') { - try { - dataTemp = JSON.parse(dataTemp); - let objData = dataTemp[Object.keys(dataTemp)[0]]; - tokenId = objData?.token_id || objData[Object.keys(objData)[0]]?.token_id || ''; - contractAddress = objData[Object.keys(objData)[0]]?.contract_address || contractAddress; - } catch (e) {} - } + + try { + if (typeof dataTemp === 'string') { + try { + dataTemp = JSON.parse(dataTemp); + } catch (e) {} + } + let objData = dataTemp[Object.keys(dataTemp)[0]]; + tokenId = + objData?.token_id || objData[Object.keys(objData)[0]]?.token_id || objData?.token_ids[index] || ''; + contractAddress = objData[Object.keys(objData)[0]]?.contract_address || contractAddress; + } catch {} return { type, fromAddress, toAddress, tokenId, contractAddress }; }); break; } - if (modeQuery !== TabsAccount.ExecutedTxs) { + if (modeQuery !== TabsAccountLink.ExecutedTxs) { fromAddress = arrEvent[0]?.fromAddress; toAddress = arrEvent[0]?.toAddress; denom = arrEvent[0]?.denom; @@ -486,9 +490,13 @@ export function getTypeTx(element, index = 0) { if (type === TRANSACTION_TYPE_ENUM.ExecuteContract) { try { let dataTemp = _.get(element, 'transaction_messages[0].content.msg'); - dataTemp = JSON.parse(dataTemp); + if (typeof dataTemp === 'string') { + try { + dataTemp = JSON.parse(dataTemp); + } catch (e) {} + } let action = Object.keys(dataTemp)[0]; - type = 'Execute_' + action[0]?.toUpperCase() + action.substr(1)?.toLowerCase(); + type = 'Execute_' + action[0]?.toUpperCase() + action?.substr(1)?.toLowerCase(); } catch (e) {} } else { type = _.find(TYPE_TRANSACTION, { label: type })?.value || type.split('.').pop(); diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 23db0e627..cabf7f601 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -135,7 +135,7 @@

Total Value

[currentAccountDetail]="currentAccountDetail"> - + diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index eba6a603c..e3d084825 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -4,14 +4,16 @@ @@ -229,6 +231,7 @@

Filter

+{{ data.arrEvent?.length - 1 }}

+ diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 743a77be0..ee6ea3c63 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -5,7 +5,7 @@ import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; -import { AccountTxType, TabsAccount } from 'src/app/core/constants/account.enum'; +import { AccountTxType, TabsAccountLink } from 'src/app/core/constants/account.enum'; import { DATEFORMAT, PAGE_EVENT } from 'src/app/core/constants/common.constant'; import { MAX_LENGTH_SEARCH_TOKEN } from 'src/app/core/constants/token.constant'; import { TYPE_TRANSACTION } from 'src/app/core/constants/transaction.constant'; @@ -33,7 +33,7 @@ export class AccountTransactionTableComponent { textSearch = ''; searchValue = ''; templates: Array; - tabsData = TabsAccount; + tabsData = TabsAccountLink; templatesExecute: Array = [ { matColumnDef: 'tx_hash', headerCellDef: 'Tx Hash', headerWidth: 18 }, @@ -105,6 +105,13 @@ export class AccountTransactionTableComponent { if (this.tnxTypeOrigin?.length === 0) { this.getListTypeFilter(); } + + this.route.queryParams.subscribe((params) => { + if (params?.type) { + this.currentType = params.type || AccountTxType.Sent; + } + }); + this.route.params.subscribe((params) => { if (params?.address) { this.currentAddress = params?.address; @@ -209,13 +216,13 @@ export class AccountTransactionTableComponent { } switch (this.modeQuery) { - case TabsAccount.ExecutedTxs: + case TabsAccountLink.ExecutedTxs: payload.compositeKey = 'message.sender'; this.templates = this.templatesExecute; this.displayedColumns = this.templatesExecute.map((dta) => dta.matColumnDef); this.getListTxByAddress(payload); break; - case TabsAccount.AuraTxs: + case TabsAccountLink.AuraTxs: payload.compositeKey = 'coin_spent.spender'; if (this.currentType !== AccountTxType.Sent) { payload.compositeKey = 'coin_received.receiver'; @@ -225,7 +232,7 @@ export class AccountTransactionTableComponent { this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); this.getListTxAuraByAddress(payload); break; - case TabsAccount.FtsTxs: + case TabsAccountLink.FtsTxs: if (this.currentType === AccountTxType.Sent) { payload['sender'] = address; } else { @@ -236,7 +243,7 @@ export class AccountTransactionTableComponent { this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); this.getListFTByAddress(payload); break; - case TabsAccount.NftTxs: + case TabsAccountLink.NftTxs: if (this.currentType === AccountTxType.Sent) { payload['sender'] = address; } else { @@ -331,7 +338,7 @@ export class AccountTransactionTableComponent { } let setReceive = false; - if (this.modeQuery !== TabsAccount.ExecutedTxs && this.currentType !== AccountTxType.Sent) { + if (this.modeQuery !== TabsAccountLink.ExecutedTxs && this.currentType !== AccountTxType.Sent) { setReceive = true; } diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html index 9f75a8c14..2e5321a81 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html @@ -10,7 +10,12 @@

Transactions

[class.mobile-tab]="breakpoint.value.matches">
  • - {{ tab.label }} diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts index 2de07108a..9fe2e0f48 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts @@ -1,9 +1,10 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { TABS_TITLE_ACCOUNT } from 'src/app/core/constants/account.constant'; -import { TabsAccount } from 'src/app/core/constants/account.enum'; +import { TabsAccount, TabsAccountLink } from 'src/app/core/constants/account.enum'; @Component({ selector: 'app-account-transaction', @@ -11,18 +12,25 @@ import { TabsAccount } from 'src/app/core/constants/account.enum'; styleUrls: ['./account-transaction.component.scss'], }) export class AccountTransactionComponent implements OnInit { - isNoData = false; + @Input() address: string; + isNoData = false; destroyed$ = new Subject(); breakpoint$ = this.layout.observe([Breakpoints.Small, Breakpoints.XSmall]).pipe(takeUntil(this.destroyed$)); TABS = TABS_TITLE_ACCOUNT; - tabsData = TabsAccount; - currentTab = TabsAccount.ExecutedTxs; + tabsData = TabsAccountLink; + currentTab = TabsAccountLink.ExecutedTxs; - constructor(private layout: BreakpointObserver) {} + constructor(private layout: BreakpointObserver, private route: ActivatedRoute) {} - ngOnInit(): void {} + ngOnInit(): void { + this.route.queryParams.subscribe((params) => { + if (params?.tab) { + this.currentTab = params.tab; + } + }); + } reloadData() { location.reload(); From 5de90e7c918b7604a7049b19bc70b97ee4197a50 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 24 Aug 2023 15:17:58 +0700 Subject: [PATCH 016/142] update chart dashboard --- src/app/core/constants/common.constant.ts | 2 +- src/app/core/helpers/export.ts | 6 +- .../dashboard/dashboard-chart-options.ts | 56 +++++++++++++++---- .../pages/dashboard/dashboard.component.html | 12 ++-- .../pages/dashboard/dashboard.component.ts | 3 +- .../chart-detail/chart-detail.component.ts | 4 +- 6 files changed, 57 insertions(+), 26 deletions(-) diff --git a/src/app/core/constants/common.constant.ts b/src/app/core/constants/common.constant.ts index ed17f7606..2050ec229 100644 --- a/src/app/core/constants/common.constant.ts +++ b/src/app/core/constants/common.constant.ts @@ -49,8 +49,8 @@ export const TIME_OUT_CALL_API = 5000; export const NUM_BLOCK = 10000; export const CHART_RANGE = { - M_60: '60m', H_24: '24h', + D_7: '7d', D_30: '30d', MONTH_12: '12M', }; diff --git a/src/app/core/helpers/export.ts b/src/app/core/helpers/export.ts index c53ad95a4..ca095e246 100644 --- a/src/app/core/helpers/export.ts +++ b/src/app/core/helpers/export.ts @@ -3,12 +3,12 @@ import ExcelExport from 'export-xlsx'; export function exportChart(data: any, range: string, isPrice: boolean, currDate: string) { let type = ''; switch (range) { - case '60m': - type = 'in 60 minutes'; - break; case '24h': type = 'in about 24 hours'; break; + case '7d': + type = 'in 7 days'; + break; case '30d': type = 'in 30 days'; break; diff --git a/src/app/pages/dashboard/dashboard-chart-options.ts b/src/app/pages/dashboard/dashboard-chart-options.ts index a4f5ee4c1..a21fd984e 100644 --- a/src/app/pages/dashboard/dashboard-chart-options.ts +++ b/src/app/pages/dashboard/dashboard-chart-options.ts @@ -29,7 +29,7 @@ export const DASHBOARD_CHART_OPTIONS: DeepPartial = { timeScale: { timeVisible: true, secondsVisible: true, - minBarSpacing: 5, + minBarSpacing: 0, }, handleScale: { mouseWheel: false, @@ -47,6 +47,38 @@ export const DASHBOARD_AREA_SERIES_CHART_OPTIONS: SeriesPartialOptionsMap['Area' }, }; +export const STATISTIC_CHART_OPTIONS: DeepPartial = { + height: 300, + crosshair: { + horzLine: { + visible: false, + }, + }, + layout: { + backgroundColor: '#24262e', + textColor: '#868a97', + }, + grid: { + vertLines: { + color: '#363843', + }, + horzLines: { + color: '#363843', + }, + }, + leftPriceScale: { + visible: true, + }, + rightPriceScale: { + visible: false, + }, + timeScale: { + timeVisible: true, + secondsVisible: true, + minBarSpacing: 0, + }, +}; + export const STATISTIC_AREA_SERIES_CHART_OPTIONS: SeriesPartialOptionsMap['Area'] = { lineColor: '#2CB1F5', topColor: 'rgba(44, 177, 245, 0.2)', @@ -65,28 +97,28 @@ export const CHART_CONFIG: { unit: string; }; } = { - ['60m']: { - initRange: 20, + ['24h']: { + initRange: 480, type: RangeType.minute, value: 1440, unit: 'm', }, - ['24h']: { - initRange: 24, + ['7d']: { + initRange: 168, type: RangeType.hour, - value: 360, - unit: 'h', + value: 365, + unit: 'd', }, ['30d']: { - initRange: 30, - type: RangeType.day, + initRange: 720, + type: RangeType.hour, value: 365, unit: 'd', }, ['12M']: { - initRange: 12, - type: RangeType.month, + initRange: 365, + type: RangeType.day, value: 60, - unit: 'M', + unit: 'd', }, }; diff --git a/src/app/pages/dashboard/dashboard.component.html b/src/app/pages/dashboard/dashboard.component.html index 508a65a56..b8a1383b6 100644 --- a/src/app/pages/dashboard/dashboard.component.html +++ b/src/app/pages/dashboard/dashboard.component.html @@ -102,18 +102,18 @@
    - +
    -
    -
    {{ data[template.matColumnDef] || '-' | stringEllipsis : 16 }}
    - +
    + +
    +
    +
    {{ item.tokenId || '-' | stringEllipsis : 16 }}
    + +
    +
    +
    {{ data[template.matColumnDef] }}
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index e11af608d..5bcd68e4f 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -208,6 +208,7 @@ } .item-show { height: 30px; + min-width: 180px; display: flex; align-items: center; margin-bottom: var(--spacer-4); @@ -250,7 +251,7 @@ } } -.btn-select-type{ +.btn-select-type { background-color: unset; color: white; } From 899133eaaab83eb67ce38698b0fbdc67bae3edd1 Mon Sep 17 00:00:00 2001 From: mtam Date: Fri, 25 Aug 2023 09:47:49 +0700 Subject: [PATCH 020/142] [TamTM6] update tab nft transfer --- src/app/core/services/user.service.ts | 7 +++- src/app/global/global.ts | 42 ++++++++----------- .../account-transaction-table.component.scss | 6 +-- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/app/core/services/user.service.ts b/src/app/core/services/user.service.ts index 976dd9449..a0a5cc5bb 100644 --- a/src/app/core/services/user.service.ts +++ b/src/app/core/services/user.service.ts @@ -227,9 +227,14 @@ export class UserService extends CommonService { from to sender - cw721_token{ + cw721_token { token_id } + cw721_contract { + smart_contract { + address + } + } } } } diff --git a/src/app/global/global.ts b/src/app/global/global.ts index 5214bfdc1..cbe54edf3 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -390,17 +390,23 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece case TabsAccountLink.AuraTxs: arrEvent = _.get(element, 'transaction_messages')?.map((item, index) => { let type = getTypeTx(element, index); - let fromAddress = currentAddress; - let toAddress = currentAddress; - let dataTemp; - if (setReceive) { - dataTemp = element?.data?.tx_response?.logs[index]?.events?.find((k) => k.type === 'coin_spent'); - fromAddress = dataTemp?.attributes[0]?.value; - } else { - dataTemp = element?.data?.tx_response?.logs[index]?.events?.find((k) => k.type === 'coin_received'); - toAddress = dataTemp?.attributes[0]?.value; + console.log(element); + let fromAddress; + let toAddress; + let amountTemp; + const coinSpentData = element?.data?.tx_response?.logs[index]?.events?.find( + (k) => k.type === 'coin_spent', + )?.attributes; + const coinReceiveData = element?.data?.tx_response?.logs[index]?.events?.find( + (k) => k.type === 'coin_received', + )?.attributes; + + if (coinSpentData && coinReceiveData) { + let indexDefault = 2; + fromAddress = coinSpentData[coinSpentData?.length - indexDefault]?.value; + toAddress = coinReceiveData[coinReceiveData?.length - indexDefault]?.value; + amountTemp = coinSpentData[coinSpentData?.length - indexDefault - 1]?.value?.match(/\d+/g)[0]; } - let amountTemp = _.get(dataTemp, 'attributes[1].value')?.match(/\d+/g)[0]; let denom = coinInfo.coinDenom; let amount = balanceOf(Number(amountTemp) || 0, coinInfo.coinDecimals); return { type, fromAddress, toAddress, amount, denom }; @@ -427,20 +433,8 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece } let fromAddress = _.get(item, 'smart_contract_events[0].cw721_activity.from') || NULL_ADDRESS; let toAddress = _.get(item, 'smart_contract_events[0].cw721_activity.to') || NULL_ADDRESS; - let contractAddress = _.get(element, 'transaction_messages[0].content.contract'); - let dataTemp = _.get(element, 'transaction_messages[0].content.msg'); - let tokenId; - - try { - if (typeof dataTemp === 'string') { - try { - dataTemp = JSON.parse(dataTemp); - } catch (e) {} - } - let objData = dataTemp[Object.keys(dataTemp)[0]]; - tokenId = _.get(item, 'smart_contract_events[0].cw721_activity.cw721_token.token_id'); - contractAddress = objData[Object.keys(objData)[0]]?.contract_address || contractAddress; - } catch {} + let contractAddress = _.get(item, 'smart_contract_events[0].cw721_activity.cw721_contract.smart_contract.address'); + let tokenId = _.get(item, 'smart_contract_events[0].cw721_activity.cw721_token.token_id'); return { type, fromAddress, toAddress, tokenId, contractAddress }; }); diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index 5bcd68e4f..7909861f0 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -207,7 +207,7 @@ align-items: center; } .item-show { - height: 30px; + height: 34px; min-width: 180px; display: flex; align-items: center; @@ -216,12 +216,10 @@ tr td { vertical-align: top; padding-top: var(--spacer-4); + &:nth-child(2), &:nth-child(5), &:nth-child(6), &:nth-child(7) { - padding-top: var(--spacer-3); - } - &:nth-child(2) { padding-top: var(--spacer-2); } } From ca1fffaef22e480f2881de17e3e9478921fb29d3 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Fri, 25 Aug 2023 11:28:36 +0700 Subject: [PATCH 021/142] fix scroll chart --- .../dashboard/dashboard-chart-options.ts | 6 +- .../pages/dashboard/dashboard.component.ts | 85 ++++++++++++------- .../my-grantees/my-grantees.component.ts | 11 +-- 3 files changed, 59 insertions(+), 43 deletions(-) diff --git a/src/app/pages/dashboard/dashboard-chart-options.ts b/src/app/pages/dashboard/dashboard-chart-options.ts index b37985267..705672358 100644 --- a/src/app/pages/dashboard/dashboard-chart-options.ts +++ b/src/app/pages/dashboard/dashboard-chart-options.ts @@ -98,10 +98,10 @@ export const CHART_CONFIG: { }; } = { ['24h']: { - initRange: 480, + initRange: 960, type: RangeType.minute, - value: 1440, - unit: 'm', + value: 2, + unit: 'd', }, ['7d']: { initRange: 168, diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index e0b0a1507..5deba5120 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -23,6 +23,7 @@ import { CHART_RANGE, PAGE_EVENT, TOKEN_ID_GET_PRICE } from '../../core/constant import { Globals, convertDataBlock, convertDataTransaction } from '../../global/global'; import { CHART_CONFIG, DASHBOARD_AREA_SERIES_CHART_OPTIONS, DASHBOARD_CHART_OPTIONS } from './dashboard-chart-options'; import { Router } from '@angular/router'; +import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; @Component({ selector: 'app-dashboard', @@ -91,6 +92,10 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { logicalRangeChange$ = new Subject<{ from: number; to: number }>(); endData = false; destroy$ = new Subject(); + isMobileMatched = false; + breakpoint$ = this.breakpointObserver + .observe([Breakpoints.Small, Breakpoints.XSmall]) + .pipe(takeUntil(this.destroy$)); constructor( public commonService: CommonService, @@ -106,9 +111,24 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { private walletService: WalletService, private validatorService: ValidatorService, private router: Router, - ) {} + private breakpointObserver: BreakpointObserver, + ) { + this.breakpoint$.subscribe((state) => { + if (state) { + this.isMobileMatched = state.matches; + } + }); + } ngOnInit(): void { + this.walletService.wallet$.subscribe((wallet) => { + if (wallet && this.isMobileMatched) { + const currentRoute = this.router.url; + this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => { + this.router.navigate([currentRoute]); // navigate to same route + }); + } + }); this.getInfoData(); const period = 60000; this.timerUnSub = timer(period, period) @@ -116,7 +136,6 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { .subscribe(() => this.getInfoData()); this.initChart(); - this.getCoinInfo(this.chartRange); this.currDate = moment(new Date()).format('DDMMYYYY_HHMMSS'); this.getVotingPeriod(); @@ -252,7 +271,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { getListBlock(): void { const payload = { limit: this.PAGE_SIZE, - } + }; this.blockService.getDataBlock(payload).subscribe((res) => { if (res?.block?.length > 0) { const blocks = convertDataBlock(res); @@ -322,26 +341,26 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { }); } - exportChart() { - const exportData = this.originalData.map((item) => { - const dateF = this.datepipe.transform(new Date(item.timestamp), 'dd-MM-yyyy:HH-mm-ss'); - return { - date: dateF, - value: this.isPrice ? item.current_price : item.total_volume, - }; - }); - - exportChart( - [ - { - table1: exportData, - }, - ], - this.chartRange, - this.isPrice, - this.currDate, - ); - } + // exportChart() { + // const exportData = this.originalData.map((item) => { + // const dateF = this.datepipe.transform(new Date(item.timestamp), 'dd-MM-yyyy:HH-mm-ss'); + // return { + // date: dateF, + // value: this.isPrice ? item.current_price : item.total_volume, + // }; + // }); + + // exportChart( + // [ + // { + // table1: exportData, + // }, + // ], + // this.chartRange, + // this.isPrice, + // this.currDate, + // ); + // } initTooltip() { const container = document.getElementById('chart'); @@ -431,15 +450,17 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { }); // re-draw chart when connect coin98 app in mobile - this.walletService.wallet$.subscribe((wallet) => { - if (this.originalData.length === 0) { - this.originalData = this.cacheData; - this.chart.remove(); - this.chart = createChart(document.getElementById('chart'), DASHBOARD_CHART_OPTIONS); - this.areaSeries = this.chart.addAreaSeries(DASHBOARD_AREA_SERIES_CHART_OPTIONS); - this.subscribeVisibleLogicalRangeChange(); - } - }); + // this.walletService.wallet$.subscribe((wallet) => { + // if (wallet) { + // if (this.originalData.length === 0) { + // this.originalData = this.cacheData; + // this.chart.remove(); + // this.chart = createChart(document.getElementById('chart'), DASHBOARD_CHART_OPTIONS); + // this.areaSeries = this.chart.addAreaSeries(DASHBOARD_AREA_SERIES_CHART_OPTIONS); + // this.subscribeVisibleLogicalRangeChange(); + // } + // } + // }); } navigateToCommunityPool(): void { diff --git a/src/app/pages/fee-grant/my-grantees/my-grantees.component.ts b/src/app/pages/fee-grant/my-grantees/my-grantees.component.ts index 2b17a4840..af0c3ea9b 100644 --- a/src/app/pages/fee-grant/my-grantees/my-grantees.component.ts +++ b/src/app/pages/fee-grant/my-grantees/my-grantees.component.ts @@ -90,6 +90,9 @@ export class MyGranteesComponent implements OnInit { this.currentAddress = wallet.bech32Address; this.isNoData = false; this.getGranteesData(); + this.timerGetFeeGrant = setInterval(() => { + this.getListGrant(); + }, 30000); } else { this.loading = false; this.currentAddress = null; @@ -97,14 +100,6 @@ export class MyGranteesComponent implements OnInit { this.dataSource.data = []; } }); - - this.walletService.wallet$.subscribe((wallet) => { - if (wallet.bech32Address) { - this.timerGetFeeGrant = setInterval(() => { - this.getListGrant(); - }, 30000); - } - }); } /** From ad80769d5ea067878a6e03649160839d021095b5 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Fri, 25 Aug 2023 11:48:11 +0700 Subject: [PATCH 022/142] fix scroll chart --- .../pages/dashboard/dashboard.component.ts | 100 +++++++++--------- 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index 5deba5120..5faf2e278 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -4,8 +4,8 @@ import { MatTableDataSource } from '@angular/material/table'; import { IChartApi, ISeriesApi, createChart } from 'lightweight-charts'; import * as moment from 'moment'; import { MaskPipe } from 'ngx-mask'; -import { Subject, Subscription, timer } from 'rxjs'; -import { debounceTime, takeUntil } from 'rxjs/operators'; +import { Subject, Subscription, of, timer } from 'rxjs'; +import { debounceTime, switchMap, takeUntil } from 'rxjs/operators'; import { VOTING_STATUS } from 'src/app/core/constants/proposal.constant'; import { EnvironmentService } from 'src/app/core/data-services/environment.service'; import { timeToUnix } from 'src/app/core/helpers/date'; @@ -93,9 +93,8 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { endData = false; destroy$ = new Subject(); isMobileMatched = false; - breakpoint$ = this.breakpointObserver - .observe([Breakpoints.Small, Breakpoints.XSmall]) - .pipe(takeUntil(this.destroy$)); + breakpoint$ = this.breakpointObserver.observe([Breakpoints.Small, Breakpoints.XSmall]).pipe(takeUntil(this.destroy$)); + currentAddress = null; constructor( public commonService: CommonService, @@ -121,14 +120,6 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { } ngOnInit(): void { - this.walletService.wallet$.subscribe((wallet) => { - if (wallet && this.isMobileMatched) { - const currentRoute = this.router.url; - this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => { - this.router.navigate([currentRoute]); // navigate to same route - }); - } - }); this.getInfoData(); const period = 60000; this.timerUnSub = timer(period, period) @@ -150,27 +141,37 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { } subscribeVisibleLogicalRangeChange() { - this.logicalRangeChange$.pipe(debounceTime(500), takeUntil(this.destroy$)).subscribe(({ from, to }) => { - if (from <= 0 && !this.endData) { - const { value, unit } = CHART_CONFIG[this.chartRange]; - - const max = moment(this.originalData[0].timestamp) - .subtract(1, unit as any) - .valueOf(); - - const min = moment(this.originalData[0].timestamp) - .subtract(1, unit as any) - .subtract(value, unit as any) - .valueOf(); - - const payload = { - coinId: this.tokenIdGetPrice.AURA, - rangeType: CHART_CONFIG[this.chartRange].type, - min, - max, - }; - - this.token.getTokenMetrics(payload).subscribe((res) => { + this.logicalRangeChange$ + .pipe( + debounceTime(200), + switchMap(({ from, to }) => { + if (from <= 0 && !this.endData) { + const { value, unit } = CHART_CONFIG[this.chartRange]; + + const max = moment(this.originalData[0].timestamp) + .subtract(1, unit as any) + .valueOf(); + + const min = moment(this.originalData[0].timestamp) + .subtract(1, unit as any) + .subtract(value, unit as any) + .valueOf(); + + const payload = { + coinId: this.tokenIdGetPrice.AURA, + rangeType: CHART_CONFIG[this.chartRange].type, + min, + max, + }; + + return this.token.getTokenMetrics(payload); + } + return of(null); + }), + takeUntil(this.destroy$), + ) + .subscribe((res) => { + if (res) { //update data common if (res?.data?.length > 0) { const { dataX, dataY } = this.parseDataFromApi(res.data); @@ -185,9 +186,8 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { } else { this.endData = true; } - }); - } - }); + } + }); } chartEvent() { @@ -217,11 +217,8 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { drawChartFirstTime(data, dateTime) { this.chartDataExp = []; let arr = []; // drawing chart array - arr = this.makeChartData(data, dateTime); - this.originalDataArr = arr; - this.areaSeries.applyOptions({ priceFormat: { type: this.isPrice ? 'price' : 'volume', @@ -229,7 +226,6 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { }); this.areaSeries.setData(arr); - const chartLength = arr.length - 1; if (chartLength <= CHART_CONFIG[this.chartRange].initRange) { @@ -450,17 +446,17 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { }); // re-draw chart when connect coin98 app in mobile - // this.walletService.wallet$.subscribe((wallet) => { - // if (wallet) { - // if (this.originalData.length === 0) { - // this.originalData = this.cacheData; - // this.chart.remove(); - // this.chart = createChart(document.getElementById('chart'), DASHBOARD_CHART_OPTIONS); - // this.areaSeries = this.chart.addAreaSeries(DASHBOARD_AREA_SERIES_CHART_OPTIONS); - // this.subscribeVisibleLogicalRangeChange(); - // } - // } - // }); + this.walletService.wallet$.subscribe((wallet) => { + if (wallet && this.isMobileMatched) { + if (this.originalData.length === 0) { + this.originalData = this.cacheData; + this.chart.remove(); + this.chart = createChart(document.getElementById('chart'), DASHBOARD_CHART_OPTIONS); + this.areaSeries = this.chart.addAreaSeries(DASHBOARD_AREA_SERIES_CHART_OPTIONS); + this.areaSeries.setData(this.originalDataArr); + } + } + }); } navigateToCommunityPool(): void { From 1974f2c20ed59f7ccb331997a7c6bdf1ae72231d Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Fri, 25 Aug 2023 13:05:52 +0700 Subject: [PATCH 023/142] fix scroll chart --- src/app/pages/dashboard/dashboard.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index 5faf2e278..34bf39d10 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -143,7 +143,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { subscribeVisibleLogicalRangeChange() { this.logicalRangeChange$ .pipe( - debounceTime(200), + debounceTime(500), switchMap(({ from, to }) => { if (from <= 0 && !this.endData) { const { value, unit } = CHART_CONFIG[this.chartRange]; From 2e54f0fee00cbf5af8eaab748745f0d8f83efe3a Mon Sep 17 00:00:00 2001 From: mtam Date: Fri, 25 Aug 2023 13:21:58 +0700 Subject: [PATCH 024/142] [TamTM6] update tab nft transfer, nft mat selece --- .../account-transaction-table.component.scss | 102 +----------------- .../nft-list/nft-list.component.html | 7 +- .../nft-list/nft-list.component.scss | 98 ++++++++++++++++- .../token-table/token-table.component.scss | 8 +- .../card-mob-account.component.ts | 4 +- 5 files changed, 112 insertions(+), 107 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index 7909861f0..2220e75a7 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -48,105 +48,6 @@ .button-filter { padding: 8px; } - ::ng-deep { - .mat-form-field[tokenFilter] { - background-color: var(--aura-gray-10); - border-radius: 8px; - display: flex; - align-items: center; - width: 150px; - height: 40px; - // border: 1px solid transparent; - - @media (min-width: 991.98px) { - width: 100%; - } - - &.mat-focused { - border-color: var(--aura-white); - } - - .mat-form-field-wrapper { - width: 100%; - padding-bottom: 0; - } - - .mat-form-field-flex { - padding: 0 16px; - background: transparent; - height: 40px; - } - - .mat-form-field-infix { - padding: 4px 0 0.75em 0; - } - - .mat-select-placeholder, - mat-select-trigger { - position: relative; - color: var(--aura-gray-5); - font-size: 1.4rem; - line-height: 1.6rem; - } - - .mat-select-value { - color: var(--aura-gray-1); - } - - .mat-form-field-underline { - display: none; - } - - .mat-select-arrow-wrapper { - transform: translateY(-26%); - - .mat-select-arrow { - border: solid var(--aura-white); - border-width: 0 1px 1px 0; - display: inline-block; - padding: 4px; - transform: rotate(45deg); - -webkit-transform: rotate(45deg); - } - } - } - - mat-select.token-filter[aria-expanded='true'] { - .mat-select-arrow { - border-width: 1px 0 0 1px !important; - } - .mat-select-arrow-wrapper { - transform: translateY(2%); - } - } - - .token-filter-none::after, - .token-filter-none::before { - display: none; - } - - .filter-dropdown { - right: unset !important; - transform: translateX(-50%) !important; - width: 200px; - } - - .tokenFilterPanel { - border: 1px solid var(--aura-gray-8); - background: #25252c; - width: 214px !important; - min-width: 214px !important; - transform: translate3D(1px, 29px, 0) !important; - padding: var(--spacer-2) !important; - border-radius: 8px; - } - - .mat-option { - border-radius: 4px; - color: var(--aura-white) !important; - padding: 0 8px !important; - } - } } ::ng-deep { @@ -196,7 +97,7 @@ } } -.account-transaction-table { +.account-transaction-table { .aura-status .status { background-color: unset; padding: 0; @@ -253,3 +154,4 @@ background-color: unset; color: white; } + diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.html b/src/app/pages/account/account-detail/nft-list/nft-list.component.html index f54b88f99..add338a25 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.html +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.html @@ -18,7 +18,12 @@

    NFTs ({{ listCollection[0].qua
    - {{ item.label + ' (' + item.quantity + ')' }} + {{ + (item.label | cutStringPipe : 16) + ' (' + item.quantity + ')' + }} + {{ + (item.label | cutStringPipe : 35) + ' (' + item.quantity + ')' + }}
    diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.scss b/src/app/pages/account/account-detail/nft-list/nft-list.component.scss index d10d904d4..02fe75f52 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.scss +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.scss @@ -21,7 +21,6 @@ align-items: center; width: 150px; height: 40px; - // border: 1px solid transparent; @media (min-width: 991.98px) { width: 100%; } @@ -102,3 +101,100 @@ height: 40px; } } + +::ng-deep { + .mat-form-field[tokenFilter] { + background-color: var(--aura-gray-10); + border-radius: 8px; + display: flex; + align-items: center; + width: 150px; + height: 40px; + + @media (min-width: 991.98px) { + width: 100%; + } + + &.mat-focused { + border-color: var(--aura-white); + } + + .mat-form-field-wrapper { + width: 100%; + padding-bottom: 0; + } + + .mat-form-field-flex { + padding: 0 16px; + background: transparent; + height: 40px; + } + + .mat-form-field-infix { + padding: 4px 0 0.75em 0; + } + + .mat-select-placeholder, + mat-select-trigger { + position: relative; + color: var(--aura-gray-5); + font-size: 1.4rem; + line-height: 1.6rem; + } + + .mat-select-value { + color: var(--aura-gray-1); + } + + .mat-form-field-underline { + display: none; + } + + .mat-select-arrow-wrapper { + transform: translateY(-26%); + + .mat-select-arrow { + border: solid var(--aura-white); + border-width: 0 1px 1px 0; + display: inline-block; + padding: 4px; + transform: rotate(45deg); + -webkit-transform: rotate(45deg); + } + } + } + + mat-select.token-filter[aria-expanded='true'] { + .mat-select-arrow { + border-width: 1px 0 0 1px !important; + } + .mat-select-arrow-wrapper { + transform: translateY(2%); + } + } + + .token-filter-none::after, + .token-filter-none::before { + display: none; + } + + .filter-dropdown { + right: unset !important; + transform: translateX(-50%) !important; + width: 200px; + } + + .mat-option { + border-radius: 4px; + color: var(--aura-white) !important; + padding: 0 8px !important; + } +} + +@media (max-width: 414px) { + ::ng-deep { + .mat-select-panel { + max-width: 100vw !important; + } + } +} diff --git a/src/app/pages/account/account-detail/token-table/token-table.component.scss b/src/app/pages/account/account-detail/token-table/token-table.component.scss index f24435ba6..e683f0d90 100644 --- a/src/app/pages/account/account-detail/token-table/token-table.component.scss +++ b/src/app/pages/account/account-detail/token-table/token-table.component.scss @@ -65,7 +65,6 @@ align-items: center; width: 150px; height: 40px; - // border: 1px solid transparent; @media (min-width: 991.98px) { width: 100%; @@ -143,11 +142,14 @@ .tokenFilterPanel { border: 1px solid var(--aura-gray-8); background: #25252c; - width: 214px !important; + width: calc(100vw - 66px) !important; min-width: 214px !important; transform: translate3D(1px, 29px, 0) !important; padding: var(--spacer-2) !important; border-radius: 8px; + @media (min-width: 991.98px) { + width: 214px !important; + } } .mat-option { @@ -155,4 +157,4 @@ color: var(--aura-white) !important; padding: 0 8px !important; } -} \ No newline at end of file +} diff --git a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.ts b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.ts index 9786bb478..fa2ead150 100644 --- a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.ts +++ b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit, SimpleChanges } from '@angular/core'; import { CodeTransaction } from '../../../../core/constants/transaction.enum'; import { CommonService } from 'src/app/core/services/common.service'; -import { AccountTxType, TabsAccount } from 'src/app/core/constants/account.enum'; +import { AccountTxType, TabsAccount, TabsAccountLink } from 'src/app/core/constants/account.enum'; import { EnvironmentService } from 'src/app/core/data-services/environment.service'; export interface CardMobSimpleValidatorAddress { @@ -59,7 +59,7 @@ export class CardMobAccountComponent implements OnInit { @Input() currentType: string; @Input() expand: boolean = false; - tabsData = TabsAccount; + tabsData = TabsAccountLink; statusTransaction = CodeTransaction; address = 'toAddress'; From 583246aa954b10c0afd5115265eec09345238276 Mon Sep 17 00:00:00 2001 From: mtam Date: Fri, 25 Aug 2023 13:23:20 +0700 Subject: [PATCH 025/142] [TamTM6] empty state --- src/app/pages/fee-grant/fee-grant.component.html | 5 ++++- .../soulbound-contract-list.component.html | 2 ++ .../components/table-no-data/table-no-data.component.html | 2 +- .../components/table-no-data/table-no-data.component.ts | 6 +++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/pages/fee-grant/fee-grant.component.html b/src/app/pages/fee-grant/fee-grant.component.html index 0a79e2b78..7d339722a 100644 --- a/src/app/pages/fee-grant/fee-grant.component.html +++ b/src/app/pages/fee-grant/fee-grant.component.html @@ -25,7 +25,10 @@

    Fee Grant

    - +
    diff --git a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html index d04665faa..b6d17b273 100644 --- a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html @@ -123,6 +123,8 @@

    ABT Creator

    diff --git a/src/app/shared/components/table-no-data/table-no-data.component.html b/src/app/shared/components/table-no-data/table-no-data.component.html index f0409e122..598752469 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.html +++ b/src/app/shared/components/table-no-data/table-no-data.component.html @@ -1,4 +1,4 @@
    - + {{ textNull }}
    diff --git a/src/app/shared/components/table-no-data/table-no-data.component.ts b/src/app/shared/components/table-no-data/table-no-data.component.ts index bd036ec66..8a9ad94c2 100644 --- a/src/app/shared/components/table-no-data/table-no-data.component.ts +++ b/src/app/shared/components/table-no-data/table-no-data.component.ts @@ -3,13 +3,13 @@ import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'app-table-no-data', templateUrl: './table-no-data.component.html', - styleUrls: ['./table-no-data.component.scss'] + styleUrls: ['./table-no-data.component.scss'], }) - export class TableNoDataComponent implements OnInit { @Input() textNull: string = 'NO DATA'; @Input() img: string = 'assets/images/icons/noValues.svg'; - constructor() { } + @Input() class: string; + constructor() {} ngOnInit(): void {} } From 8340daf84192e6d80c79e36f8c520b2affd953a9 Mon Sep 17 00:00:00 2001 From: mtam Date: Fri, 25 Aug 2023 13:45:44 +0700 Subject: [PATCH 026/142] [TamTM6] pre define --- src/app/global/global.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/global/global.ts b/src/app/global/global.ts index cbe54edf3..ea3020863 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -275,6 +275,9 @@ export function convertDataTransaction(data, coinInfo) { const typeOrigin = _type; let amount = _.isNumber(_amount) && _amount > 0 ? _amount.toFixed(coinInfo.coinDecimals) : _amount; let type = _.find(TYPE_TRANSACTION, { label: _type })?.value || _type.split('.').pop(); + if (type.startsWith('Msg')) { + type = type?.replace('Msg', ''); + } try { if (lstType[0]['@type'].indexOf('ibc') == -1) { @@ -433,7 +436,10 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece } let fromAddress = _.get(item, 'smart_contract_events[0].cw721_activity.from') || NULL_ADDRESS; let toAddress = _.get(item, 'smart_contract_events[0].cw721_activity.to') || NULL_ADDRESS; - let contractAddress = _.get(item, 'smart_contract_events[0].cw721_activity.cw721_contract.smart_contract.address'); + let contractAddress = _.get( + item, + 'smart_contract_events[0].cw721_activity.cw721_contract.smart_contract.address', + ); let tokenId = _.get(item, 'smart_contract_events[0].cw721_activity.cw721_token.token_id'); return { type, fromAddress, toAddress, tokenId, contractAddress }; @@ -447,6 +453,9 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece denom = arrEvent[0]?.denom; amount = arrEvent[0]?.amount; type = arrEvent[0]?.type || lstTypeTemp[0]?.type?.split('.').pop(); + if (type.startsWith('Msg')) { + type = type?.replace('Msg', ''); + } tokenId = arrEvent[0]?.tokenId; contractAddress = arrEvent[0]?.contractAddress; } @@ -491,6 +500,9 @@ export function getTypeTx(element, index = 0) { } catch (e) {} } else { type = _.find(TYPE_TRANSACTION, { label: type })?.value || type.split('.').pop(); + if (type.startsWith('Msg')) { + type = type?.replace('Msg', ''); + } } return type; } From bf8a065c7fed0b7a73c7bccbc3dd869bff63d177 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Fri, 25 Aug 2023 14:11:24 +0700 Subject: [PATCH 027/142] fix scroll chart --- src/app/core/services/token.service.ts | 46 +++++++++++-------- .../dashboard/dashboard-chart-options.ts | 5 ++ .../pages/dashboard/dashboard.component.ts | 2 + 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/app/core/services/token.service.ts b/src/app/core/services/token.service.ts index e3477c43d..31b5da0ad 100644 --- a/src/app/core/services/token.service.ts +++ b/src/app/core/services/token.service.ts @@ -52,7 +52,7 @@ export class TokenService extends CommonService { address: payload?.keyword ? payload?.keyword : null, limit: payload?.limit, offset: payload?.offset, - date: payload?.date + date: payload?.date, }, operationName: 'queryCW20ListToken', }) @@ -140,7 +140,7 @@ export class TokenService extends CommonService { query: operationsDoc, variables: { address: address, - date: date + date: date, }, operationName: 'queryCW20Detail', }) @@ -235,11 +235,7 @@ export class TokenService extends CommonService { .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); } - getListTokenHolder( - limit: string | number, - offset: string | number, - contractAddress: string, - ): Observable { + getListTokenHolder(limit: string | number, offset: string | number, contractAddress: string): Observable { const operationsDoc = `query queryCW20ListHolder($address: String, $limit: Int, $offset: Int) { ${this.envDB} { cw20_holder(where: {cw20_contract: {smart_contract: {address: {_eq: $address}}}, amount: {_gt: "0"}}, limit: $limit, offset: $offset, order_by: {amount: desc}) { @@ -260,16 +256,16 @@ export class TokenService extends CommonService { `; return this.http - .post(this.graphUrl, { - query: operationsDoc, - variables: { - limit: limit, - offset: offset, - address: contractAddress, - }, - operationName: 'queryCW20ListHolder', - }) - .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); + .post(this.graphUrl, { + query: operationsDoc, + variables: { + limit: limit, + offset: offset, + address: contractAddress, + }, + operationName: 'queryCW20ListHolder', + }) + .pipe(map((res) => (res?.data ? res?.data[this.envDB] : null))); } getListTokenHolderNFT(payload) { @@ -308,9 +304,21 @@ export class TokenService extends CommonService { return this.http.get(`${this.apiUrl}/metrics/token-market?coinId=${coinId}`); } - getTokenMetrics({ rangeType, coinId, min, max }: { rangeType: RangeType; coinId: string; min: number; max: number }) { + getTokenMetrics({ + rangeType, + coinId, + min, + max, + step, + }: { + rangeType: RangeType; + coinId: string; + min: number; + max: number; + step: number; + }) { return this.http.get(`${this.apiUrl}/metrics/token`, { - params: { rangeType, coinId, min, max }, + params: { rangeType, coinId, min, max, step }, }); } diff --git a/src/app/pages/dashboard/dashboard-chart-options.ts b/src/app/pages/dashboard/dashboard-chart-options.ts index 705672358..409908e7e 100644 --- a/src/app/pages/dashboard/dashboard-chart-options.ts +++ b/src/app/pages/dashboard/dashboard-chart-options.ts @@ -95,6 +95,7 @@ export const CHART_CONFIG: { type: RangeType; value: number; unit: string; + step: number; }; } = { ['24h']: { @@ -102,23 +103,27 @@ export const CHART_CONFIG: { type: RangeType.minute, value: 2, unit: 'd', + step: 3, }, ['7d']: { initRange: 168, type: RangeType.hour, value: 365, unit: 'd', + step: 1, }, ['30d']: { initRange: 720, type: RangeType.hour, value: 365, unit: 'd', + step: 4, }, ['12M']: { initRange: 365, type: RangeType.day, value: 60, unit: 'd', + step: 1, }, }; diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index 34bf39d10..557f12db8 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -162,6 +162,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { rangeType: CHART_CONFIG[this.chartRange].type, min, max, + step: CHART_CONFIG[this.chartRange].step, }; return this.token.getTokenMetrics(payload); @@ -313,6 +314,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { rangeType: CHART_CONFIG[this.chartRange].type, min, max, + step: CHART_CONFIG[this.chartRange].step, }; this.token.getTokenMetrics(payload).subscribe((res) => { From d9a6deaca885824075b50fd46412cb8b430be26a Mon Sep 17 00:00:00 2001 From: mtam Date: Fri, 25 Aug 2023 14:41:46 +0700 Subject: [PATCH 028/142] [TamTM6] update display msg execute --- src/app/global/global.ts | 6 +++--- .../account-transaction-table.component.html | 10 +++++++--- .../account-transaction-table.component.scss | 19 +++++++++++++------ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/app/global/global.ts b/src/app/global/global.ts index ea3020863..381d601c2 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -298,7 +298,7 @@ export function convertDataTransaction(data, coinInfo) { try { let dataTemp = JSON.parse(messages[0]?.msg); let action = Object.keys(dataTemp)[0]; - type = 'Execute_' + action[0]?.toUpperCase() + action.substr(1)?.toLowerCase(); + type = 'Contract: ' + action; } catch {} } @@ -432,7 +432,7 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece const typeOrigin = _.get(element, 'transaction_messages[0].content["@type"]'); let type = item?.smart_contract_events[0] ? item?.smart_contract_events[0]?.cw721_activity?.action : null; if (typeOrigin === TRANSACTION_TYPE_ENUM.ExecuteContract) { - type = 'Execute_' + type[0]?.toUpperCase() + type?.substr(1)?.toLowerCase(); + type = 'Contract: ' + type; } let fromAddress = _.get(item, 'smart_contract_events[0].cw721_activity.from') || NULL_ADDRESS; let toAddress = _.get(item, 'smart_contract_events[0].cw721_activity.to') || NULL_ADDRESS; @@ -496,7 +496,7 @@ export function getTypeTx(element, index = 0) { } catch (e) {} } let action = Object.keys(dataTemp)[0]; - type = 'Execute_' + action[0]?.toUpperCase() + action?.substr(1)?.toLowerCase(); + type = 'Contract: ' + action; } catch (e) {} } else { type = _.find(TYPE_TRANSACTION, { label: type })?.value || type.split('.').pop(); diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 7cd37c824..8c4c70837 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -187,7 +187,11 @@

    Filter

    - + + + + + + +
    +
    + +
    + + +
    + + + +
    diff --git a/src/app/pages/validators/popup-delegate/popup-delegate.module.ts b/src/app/pages/validators/popup-delegate/popup-delegate.module.ts index 2e6f0047e..6b6322d84 100644 --- a/src/app/pages/validators/popup-delegate/popup-delegate.module.ts +++ b/src/app/pages/validators/popup-delegate/popup-delegate.module.ts @@ -9,7 +9,6 @@ import { MatTableModule } from '@angular/material/table'; import { RouterModule } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { NgxMaskModule } from 'ngx-mask'; -import { SimplebarAngularModule } from 'simplebar-angular'; import { CommonPipeModule } from '../../../core/pipes/common-pipe.module'; import { TableNoDataModule } from '../../../shared/components/table-no-data/table-no-data.module'; import { PopupDelegateComponent } from './popup-delegate.component'; @@ -25,7 +24,6 @@ import { PopupDelegateComponent } from './popup-delegate.component'; MatPaginatorModule, TranslateModule, CommonPipeModule, - SimplebarAngularModule, RouterModule, TableNoDataModule, FormsModule, diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.html b/src/app/pages/validators/validators-detail/validators-detail.component.html index 249eb0f10..72ba74847 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.html +++ b/src/app/pages/validators/validators-detail/validators-detail.component.html @@ -189,89 +189,87 @@

    Proposed Blocks

    - - -
    - - - - - - - - + +
    +
    -
    -
    -
    - -
    - {{ commonService.getDateValue(data[template.matColumnDef])[0] }} -
    - - {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} - - - {{ data[template.matColumnDef] }} - -
    {{ data[template.matColumnDef] }}
    -
    -
    -
    + + + - - - - - -
    +
    +
    - + +
    + +
    + {{ commonService.getDateValue(data[template.matColumnDef])[0] }} +
    + + {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} + + + {{ data[template.matColumnDef] }} + +
    {{ data[template.matColumnDef] }}
    +
    +
    - -
    - -
    +
    - - -
    -
    - - - - -
    + + + + + + + + + + +
    + +
    +
    + + +
    + + + + +
  • diff --git a/src/app/pages/validators/validators.module.ts b/src/app/pages/validators/validators.module.ts index afcde5ee6..80c74ac4d 100644 --- a/src/app/pages/validators/validators.module.ts +++ b/src/app/pages/validators/validators.module.ts @@ -5,7 +5,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { NgxMaskModule } from 'ngx-mask'; -import { SimplebarAngularModule } from 'simplebar-angular'; import { CommonDirectiveModule } from 'src/app/core/directives/common-directive.module'; import { ProposalService } from 'src/app/core/services/proposal.service'; import { LoadingImageModule } from 'src/app/shared/components/loading-image/loading-image.module'; @@ -41,7 +40,6 @@ import { ValidatorsComponent } from './validators.component'; ReactiveFormsModule, TranslateModule, SharedModule, - SimplebarAngularModule, TableNoDataModule, PopupDelegateModule, PaginatorModule, From ffe4a17085fffb9cb23a856b9f7cc304a6f3024a Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Mon, 28 Aug 2023 14:56:49 +0700 Subject: [PATCH 031/142] update scale chart --- src/app/pages/dashboard/dashboard.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index 557f12db8..90addea3c 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -238,8 +238,11 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy { }); } - this.chart.priceScale().applyOptions({ - autoScale: true, + this.chart.priceScale('left').applyOptions({ + scaleMargins: { + top: 0.3, + bottom: 0.4, + } }); } From d129d3441fb4604f6adf2a94c5ec786353a1bbad Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 29 Aug 2023 09:13:13 +0700 Subject: [PATCH 032/142] [TamTM6] update UI transaction --- src/app/core/services/user.service.ts | 14 +- src/app/global/global.ts | 46 ++++--- .../account-transaction-table.component.html | 124 +++++++++++++----- .../account-transaction-table.component.scss | 28 ++-- .../account-transaction-table.component.ts | 54 +++++--- .../account-transaction.component.html | 6 +- 6 files changed, 180 insertions(+), 92 deletions(-) diff --git a/src/app/core/services/user.service.ts b/src/app/core/services/user.service.ts index a0a5cc5bb..18ac6033f 100644 --- a/src/app/core/services/user.service.ts +++ b/src/app/core/services/user.service.ts @@ -122,9 +122,9 @@ export class UserService extends CommonService { getListTxAuraByAddress(payload) { const operationsDoc = ` - query QueryTxMsgOfAccount($compositeKey: String = null, $address: String = null, $startTime: timestamptz = null, $endTime: timestamptz = null, $limit: Int = null, $listTxMsgType: [String!] = null, $heightGT: Int = null, $heightLT: Int = null, $orderHeight: order_by = desc) { + query QueryTxMsgOfAccount($compositeKeyIn: [String!] = null, $address: String = null, $startTime: timestamptz = null, $endTime: timestamptz = null, $limit: Int = null, $listTxMsgType: [String!] = null, $heightGT: Int = null, $heightLT: Int = null, $orderHeight: order_by = desc) { ${this.envDB} { - transaction(where: {event_attribute_index: {composite_key: {_eq: $compositeKey}, value: {_eq: $address}}, timestamp: {_lte: $endTime, _gte: $startTime}, transaction_messages: {type: {_in: $listTxMsgType}}, _and: [{height: {_gt: $heightGT, _lt: $heightLT}}]}, limit: $limit, order_by: {height: $orderHeight}) { + transaction(where: {event_attribute_index: {composite_key: {_in: $compositeKeyIn}, value: {_eq: $address}}, timestamp: {_lte: $endTime, _gte: $startTime}, transaction_messages: {type: {_in: $listTxMsgType}}, _and: [{height: {_gt: $heightGT, _lt: $heightLT}}]}, limit: $limit, order_by: {height: $orderHeight}) { hash height fee @@ -144,7 +144,7 @@ export class UserService extends CommonService { query: operationsDoc, variables: { limit: payload.limit || 100, - compositeKey: payload.compositeKey, + compositeKeyIn: payload.compositeKey, address: payload.address, heightLT: payload.heightLT, listTxMsgType: payload.listTxMsgType, @@ -160,7 +160,7 @@ export class UserService extends CommonService { const operationsDoc = ` query Cw20TXOfAccount($receiver: String = null, $sender: String = null, $startTime: timestamptz = null, $endTime: timestamptz = null, $listTxMsgType: [String!] = null, $heightGT: Int = null, $heightLT: Int = null, $limit: Int = null) { ${this.envDB} { - transaction(where: {events: {smart_contract_events: {cw20_activities: {to: {_eq: $receiver}, from: {_eq: $sender}}}}, timestamp: {_gte: $startTime, _lte: $endTime}, _and: {height: {_gt: $heightGT, _lt: $heightLT}}, transaction_messages: {type: {_in: $listTxMsgType}}}, order_by: {height: desc}, limit: $limit) { + transaction(where: {events: {smart_contract_events: {cw20_activities: {_or: [{to: {_eq: $receiver}}, {from: {_eq: $sender}}]}}}, timestamp: {_gte: $startTime, _lte: $endTime}, _and: {height: {_gt: $heightGT, _lt: $heightLT}}, transaction_messages: {type: {_in: $listTxMsgType}}}, order_by: {height: desc}, limit: $limit) { gas_used hash height @@ -170,7 +170,7 @@ export class UserService extends CommonService { content type } - events(where: {smart_contract_events: {cw20_activities: {from: {_eq: $sender}, to: {_eq: $receiver}, id: {_is_null: false}}}}) { + events(where: {smart_contract_events: {cw20_activities: {_or: [{to: {_eq: $receiver}}, {from: {_eq: $sender}}], id: {_is_null: false}}}}) { smart_contract_events { cw20_activities { amount @@ -210,7 +210,7 @@ export class UserService extends CommonService { const operationsDoc = ` query Cw721TXOfAccount($receiver: String = null, $sender: String = null, $startTime: timestamptz = null, $endTime: timestamptz = null, $listTxMsgType: [String!] = null, $heightGT: Int = null, $heightLT: Int = null, $limit: Int = null) { ${this.envDB} { - transaction(where: {events: {smart_contract_events: {cw721_activity: {to: {_eq: $receiver}, from: {_eq: $sender}}}}, timestamp: {_gte: $startTime, _lte: $endTime}, _and: {height: {_gt: $heightGT, _lt: $heightLT}}, transaction_messages: {type: {_in: $listTxMsgType}}}, order_by: {height: desc}, limit: $limit) { + transaction(where: {events: {smart_contract_events: {cw721_activity: {_or: [{to: {_eq: $receiver}}, {from: {_eq: $sender}}]}, smart_contract: {name: {_neq: "crates.io:cw4973"}}}}, timestamp: {_gte: $startTime, _lte: $endTime}, _and: {height: {_gt: $heightGT, _lt: $heightLT}}, transaction_messages: {type: {_in: $listTxMsgType}}}, order_by: {height: desc}, limit: $limit) { gas_used hash height @@ -220,7 +220,7 @@ export class UserService extends CommonService { content type } - events(where: {smart_contract_events: {cw721_activity: {id: {_is_null: false}, from: {_eq: $sender}, to: {_eq: $receiver}}}}) { + events(where: {smart_contract_events: {cw721_activity: {id: {_is_null: false}, _or: [{to: {_eq: $receiver}}, {from: {_eq: $sender}}]}}}) { smart_contract_events { cw721_activity { action diff --git a/src/app/global/global.ts b/src/app/global/global.ts index 381d601c2..b254a16db 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -354,7 +354,6 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece const txs = _.get(data, 'transaction').map((element) => { const code = _.get(element, 'code'); const tx_hash = _.get(element, 'hash'); - const lstTypeTemp = _.get(element, 'transaction_messages'); let type; if (lstTypeTemp) { @@ -391,29 +390,29 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece type = getTypeTx(element); break; case TabsAccountLink.AuraTxs: - arrEvent = _.get(element, 'transaction_messages')?.map((item, index) => { - let type = getTypeTx(element, index); - console.log(element); - let fromAddress; - let toAddress; - let amountTemp; - const coinSpentData = element?.data?.tx_response?.logs[index]?.events?.find( - (k) => k.type === 'coin_spent', - )?.attributes; - const coinReceiveData = element?.data?.tx_response?.logs[index]?.events?.find( - (k) => k.type === 'coin_received', - )?.attributes; - - if (coinSpentData && coinReceiveData) { - let indexDefault = 2; - fromAddress = coinSpentData[coinSpentData?.length - indexDefault]?.value; - toAddress = coinReceiveData[coinReceiveData?.length - indexDefault]?.value; - amountTemp = coinSpentData[coinSpentData?.length - indexDefault - 1]?.value?.match(/\d+/g)[0]; + const coinArrReceiver = _.get(element, 'data.tx_response.logs[0].events')?.find( + (k) => k.type === 'coin_received', + )?.attributes; + const coinArrSpent = _.get(element, 'data.tx_response.logs[0].events')?.find( + (k) => k.type === 'coin_spent', + )?.attributes; + let arrTemp = []; + for (let i = 0; i < coinArrReceiver?.length; i++) { + if ( + (coinArrReceiver[i]?.key === 'receiver' && coinArrReceiver[i]?.value === currentAddress) || + (coinArrSpent[i]?.key === 'spender' && coinArrSpent[i]?.value === currentAddress) + ) { + let type = getTypeTx(element, i); + toAddress = coinArrReceiver[i]?.value; + fromAddress = coinArrSpent[i]?.value; + let amountTemp = coinArrReceiver[i + 1]?.value?.match(/\d+/g)[0]; + let amount = balanceOf(Number(amountTemp) || 0, coinInfo.coinDecimals); + let denom = coinInfo.coinDenom; + const result = { type, toAddress, fromAddress, amount, denom }; + arrTemp.push(result); } - let denom = coinInfo.coinDenom; - let amount = balanceOf(Number(amountTemp) || 0, coinInfo.coinDecimals); - return { type, fromAddress, toAddress, amount, denom }; - }); + } + arrEvent = arrTemp; break; case TabsAccountLink.FtsTxs: arrEvent = _.get(element, 'events')?.map((item, index) => { @@ -441,7 +440,6 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece 'smart_contract_events[0].cw721_activity.cw721_contract.smart_contract.address', ); let tokenId = _.get(item, 'smart_contract_events[0].cw721_activity.cw721_token.token_id'); - return { type, fromAddress, toAddress, tokenId, contractAddress }; }); break; diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 8c4c70837..be037238a 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -1,23 +1,5 @@
    -
    - - -
    +
    -
    +
    From - To -
    +
    @@ -70,11 +79,11 @@

    Filter

    -
    - Tnx Type +
    + Message Type @@ -265,17 +279,27 @@

    Filter

    -
    +
    - - {{ item.denom || denom }} +
    + {{ item['toAddress'] === currentAddress ? '↑' : '↓' }} + + +
    + {{ item.denom || denom }}
    -
    +
    Filter
    -
    +
    Filter
    +
    + +
    +
    + +
    +
    +
    +
    -
    -
    {{ item.tokenId || '-' | stringEllipsis : 16 }}
    +
    + {{ item.tokenId || '-' | stringEllipsis : 10 }} +
    +
    + +
    +
    + +
    +
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index a390e861a..153df9d6e 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -50,6 +50,12 @@ } } +.button-filter { + &[aria-expanded='true'] { + border: 2px solid var(--aura-white); + } +} + ::ng-deep { @media (max-width: 414px) { .nav-item { @@ -99,31 +105,38 @@ ::ng-deep .account-transaction-table.table-transfer tbody tr td { &:nth-child(5), &:nth-child(6), - &:nth-child(7) { - padding-top: var(--spacer-2) !important; + &:nth-child(7), + &:nth-child(8), + &:nth-child(9) { + padding-top: var(--spacer-0) !important; } } -.account-transaction-table { +.account-transaction-table { .aura-status .status { background-color: unset; padding: 0; } app-name-tag { - min-height: 30px; display: flex; align-items: center; } .item-show { - height: 34px; + height: 56px; min-width: 180px; display: flex; align-items: center; - margin-bottom: var(--spacer-4); + &.tokenId { + min-width: 75px; + } + &.action { + min-width: 40px; + } } tr td { vertical-align: top; padding-top: var(--spacer-4); + height: 56px; &:nth-child(4), &:nth-child(5), &:nth-child(6) { @@ -138,7 +151,7 @@ transition: max-height 0.35s ease-in-out; max-height: 0; overflow: hidden; - &.show { + &.show-detail { max-height: 99999px; } } @@ -161,4 +174,3 @@ background-color: unset; color: white; } - diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index ee6ea3c63..beb8f9a4b 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -46,11 +46,11 @@ export class AccountTransactionTableComponent { templatesToken: Array = [ { matColumnDef: 'tx_hash', headerCellDef: 'Tx Hash', headerWidth: 14 }, - { matColumnDef: 'type', headerCellDef: 'Message', headerWidth: 14 }, + { matColumnDef: 'type', headerCellDef: 'Message', headerWidth: 16 }, { matColumnDef: 'status', headerCellDef: 'Result', headerWidth: 7 }, - { matColumnDef: 'timestamp', headerCellDef: 'Time', headerWidth: 14 }, - { matColumnDef: 'fromAddress', headerCellDef: 'From', headerWidth: 20 }, - { matColumnDef: 'toAddress', headerCellDef: 'To', headerWidth: 19 }, + { matColumnDef: 'timestamp', headerCellDef: 'Time', headerWidth: 15 }, + { matColumnDef: 'fromAddress', headerCellDef: 'From', headerWidth: 17 }, + { matColumnDef: 'toAddress', headerCellDef: 'To', headerWidth: 16 }, ]; displayedColumns: string[]; @@ -130,6 +130,7 @@ export class AccountTransactionTableComponent { startDate: null, endDate: null, type: [], + typeTransfer: null, }; } @@ -167,6 +168,15 @@ export class AccountTransactionTableComponent { ); } + changeTypeFilter(type) { + this.transactionFilter.typeTransfer = type; + document.getElementById('typeAction')!.classList.remove('show'); + } + + addShow() { + document.querySelectorAll('ul#typeAction')[0]!.classList.add('show'); + } + clearFilterSearch() { this.tnxType = this.tnxTypeOrigin; this.transactionTypeKeyWord = ''; @@ -223,9 +233,13 @@ export class AccountTransactionTableComponent { this.getListTxByAddress(payload); break; case TabsAccountLink.AuraTxs: - payload.compositeKey = 'coin_spent.spender'; - if (this.currentType !== AccountTxType.Sent) { - payload.compositeKey = 'coin_received.receiver'; + payload.compositeKey = ['coin_spent.spender', 'coin_received.receiver']; + if (this.transactionFilter.typeTransfer) { + if (this.transactionFilter.typeTransfer === AccountTxType.Sent) { + payload.compositeKey = ['coin_spent.spender']; + } else if (this.transactionFilter.typeTransfer === AccountTxType.Received) { + payload.compositeKey = ['coin_received.receiver']; + } } this.templates = [...this.templatesToken]; this.templates.push({ matColumnDef: 'amount', headerCellDef: 'Amount', headerWidth: 17 }); @@ -233,10 +247,13 @@ export class AccountTransactionTableComponent { this.getListTxAuraByAddress(payload); break; case TabsAccountLink.FtsTxs: - if (this.currentType === AccountTxType.Sent) { - payload['sender'] = address; - } else { - payload['receiver'] = address; + payload['sender'] = payload['receiver'] = address; + if (this.transactionFilter.typeTransfer) { + if (this.transactionFilter.typeTransfer === AccountTxType.Sent) { + payload['receiver'] = ''; + } else if (this.transactionFilter.typeTransfer === AccountTxType.Received) { + payload['sender'] = ''; + } } this.templates = [...this.templatesToken]; this.templates.push({ matColumnDef: 'amount', headerCellDef: 'Amount', headerWidth: 17 }); @@ -244,13 +261,18 @@ export class AccountTransactionTableComponent { this.getListFTByAddress(payload); break; case TabsAccountLink.NftTxs: - if (this.currentType === AccountTxType.Sent) { - payload['sender'] = address; - } else { - payload['receiver'] = address; + payload['sender'] = payload['receiver'] = address; + if (this.transactionFilter.typeTransfer) { + if (this.transactionFilter.typeTransfer === AccountTxType.Sent) { + payload['receiver'] = ''; + } else if (this.transactionFilter.typeTransfer === AccountTxType.Received) { + payload['sender'] = ''; + } } this.templates = [...this.templatesToken]; - this.templates.push({ matColumnDef: 'tokenId', headerCellDef: 'Token ID', headerWidth: 21 }); + this.templates.push({ matColumnDef: 'contractAddress', headerCellDef: 'Contract', headerWidth: 11 }); + this.templates.push({ matColumnDef: 'tokenId', headerCellDef: 'Token ID', headerWidth: 10 }); + this.templates.push({ matColumnDef: 'action', headerCellDef: '', headerWidth: 15 }); this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); this.getListNFTByAddress(payload); break; diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html index 2e5321a81..79278a4d7 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html @@ -33,18 +33,18 @@

    Transactions

    - + - + - +
    From a4bda191dfcedbded78637267aed9a15d3675d20 Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 29 Aug 2023 09:18:35 +0700 Subject: [PATCH 033/142] Merge branch 'feature/update-account-detail_backup' of github.com:aura-nw/aurascan into feature/update-account-detail_backup # Conflicts: # src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html --- .../account-transaction-table.component.html | 501 +++++++++--------- 1 file changed, 249 insertions(+), 252 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index be037238a..c144518a9 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -198,277 +198,274 @@

    Filter

    found
    - - -
    - - - - + +
    +
    + + + - - + + + +
    {{ data[template.matColumnDef] }}
    + + + + - - - - - - -
    -
    - -
    - - -
    - - - - -
    + + + + + + + + +
    +
    + +
    + + +
    + + + +
    From 57ff102fa79f8539b90f03d8f2715d0fb1b2e1eb Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 29 Aug 2023 10:06:51 +0700 Subject: [PATCH 034/142] fix duplicate record list 721 --- src/app/core/services/token.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/core/services/token.service.ts b/src/app/core/services/token.service.ts index 31b5da0ad..dd4fa8057 100644 --- a/src/app/core/services/token.service.ts +++ b/src/app/core/services/token.service.ts @@ -71,7 +71,7 @@ export class TokenService extends CommonService { if (textSearch?.length > 0) { textSearch = '%' + textSearch + '%'; } - let querySort = `, order_by: {${payload.sort_column}: ${payload.sort_order}}`; + let querySort = `, order_by: [{${payload.sort_column}: ${payload.sort_order}}, {id: desc}]`; const operationsDoc = ` query queryListCW721($limit: Int = 10, $offset: Int = 0, $contract_address: String = null, $name: String = null) { ${this.envDB} { From 022feef989330c3aa3554cac088648d94edff6fd Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Tue, 29 Aug 2023 15:10:44 +0700 Subject: [PATCH 035/142] update width voting power --- src/app/pages/validators/validators.component.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/pages/validators/validators.component.html b/src/app/pages/validators/validators.component.html index 7fbd39b6a..7ca1da863 100644 --- a/src/app/pages/validators/validators.component.html +++ b/src/app/pages/validators/validators.component.html @@ -186,8 +186,7 @@

    Validators

    [votingPower]="true" [appBigNumber]="data[template.matColumnDef]" [decimal]="0"> - +
    Validators [style.width]=" data.percent_power === maxPercentPower && typeValidator === statusValidator.Active ? '167px' + : data.percent_power < 0.01 + ? 1 + 'px' + : data.percent_power < 0.1 + ? 3 + 'px' + : data.percent_power < 1 + ? 7 + 'px' : (((data.percent_power * 100) / maxPercentPower) * 167) / 100 + 'px' ">
    {{ From 0e3c9e50805302571af39cf89861312a4b0e1225 Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 29 Aug 2023 15:34:04 +0700 Subject: [PATCH 036/142] [TamTM6] update UI transaction --- src/app/core/services/user.service.ts | 1 + src/app/global/global.ts | 3 +- .../account-transaction-table.component.html | 33 +++++++++++++------ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/app/core/services/user.service.ts b/src/app/core/services/user.service.ts index 18ac6033f..0304517b0 100644 --- a/src/app/core/services/user.service.ts +++ b/src/app/core/services/user.service.ts @@ -180,6 +180,7 @@ export class UserService extends CommonService { sender } smart_contract { + address cw20_contract { symbol decimal diff --git a/src/app/global/global.ts b/src/app/global/global.ts index b254a16db..485f9ab1a 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -423,7 +423,8 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece let amountTemp = _.get(item, 'smart_contract_events[0].cw20_activities[0].amount'); let decimal = _.get(item, 'smart_contract_events[0].smart_contract.cw20_contract.decimal'); let amount = balanceOf(amountTemp || 0, +decimal); - return { type, fromAddress, toAddress, amount, denom }; + let contractAddress = _.get(item, 'smart_contract_events[0].smart_contract.address'); + return { type, fromAddress, toAddress, amount, denom, contractAddress }; }); break; case TabsAccountLink.NftTxs: diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index c144518a9..f9915a65c 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -19,7 +19,7 @@
    -
    +
    {{ nextKey ? 'More than' : 'A total of' }} {{ pageData?.length }} transaction{{ pageData?.length > 1 ? 's' : '' }} found
    @@ -40,7 +40,7 @@ (keydown)="$event.stopPropagation()">

    Filter

    -
    +
    Asset Transfer Type @@ -302,7 +312,8 @@

    Filter

    Filter
    @@ -368,9 +380,10 @@

    Filter

    *ngIf="index < data.limit">
    + [isLink]="!item.contractAddress?.startsWith('0000')">
    @@ -382,7 +395,7 @@

    Filter

    [class.show-detail]="data.expand || index === 0" *ngIf="index < data.limit">
    {{ item.tokenId || '-' | stringEllipsis : 10 }} @@ -447,7 +460,7 @@

    Filter

    info: '
    ' + data.height + '' }, { - label: 'Amount', + label: 'Fee', class: 'text--gray-1 body-02-mob', info: (data.fee | mask : 'separator.6') + ' ' + denom + '' } From 85aaedf7bcc7b80b6141876bdeccd00a67dc69e0 Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 30 Aug 2023 08:37:24 +0700 Subject: [PATCH 037/142] [TamTM6] update select nft list --- .../account-detail/nft-list/nft-list.component.html | 8 +------- .../account/account-detail/nft-list/nft-list.component.ts | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.html b/src/app/pages/account/account-detail/nft-list/nft-list.component.html index add338a25..2d1dfaac9 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.html +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.html @@ -11,19 +11,13 @@

    NFTs ({{ listCollection[0].qua class="nft-filter" panelClass="tokenFilterPanel" [disableOptionCentering]="true" - placeholder="Select collection" [(value)]="nftFilter" (selectionChange)="getNftData()">
    - {{ - (item.label | cutStringPipe : 16) + ' (' + item.quantity + ')' - }} - {{ - (item.label | cutStringPipe : 35) + ' (' + item.quantity + ')' - }} + {{ (item.label | cutStringPipe : 16) + ' (' + item.quantity + ')' }}
    diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.ts b/src/app/pages/account/account-detail/nft-list/nft-list.component.ts index 0d2676d98..00c9c525f 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.ts +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.ts @@ -24,7 +24,7 @@ export class NftListComponent implements OnChanges { pageSize: 10, pageIndex: 1, }; - nftFilter = null; + nftFilter = ''; nftList = []; maxLengthSearch = MAX_LENGTH_SEARCH_TOKEN; totalValue = 0; @@ -33,7 +33,7 @@ export class NftListComponent implements OnChanges { { label: 'All', quantity: 0, - address: null, + address: '', }, ]; @@ -55,7 +55,7 @@ export class NftListComponent implements OnChanges { limit: this.pageData.pageSize, keyword: this.textSearch, offset: (this.pageData.pageIndex - 1) * this.pageData.pageSize, - address: this.nftFilter, + address: this.nftFilter || null, }; this.accountService.getAssetCW721ByOwner(payload).subscribe( From 0b0b56d555cea2d26317f6fa57d3f3eef3b41a46 Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 30 Aug 2023 15:43:00 +0700 Subject: [PATCH 038/142] [TamTM6] update ui mobile transaction --- .../account-detail.component.html | 3 +- .../account-detail.component.ts | 17 ++- .../account-transaction-table.component.html | 19 +-- .../account-transaction-table.component.scss | 22 ++- .../account-transaction-table.component.ts | 5 +- .../account-transaction.component.ts | 2 +- .../nft-list/nft-list.component.html | 3 +- .../nft-list/nft-list.component.ts | 25 ++-- .../card-mob-account.component.html | 131 ++++++++++++------ .../card-mob-account.component.scss | 24 +--- .../card-mob-account.component.ts | 13 +- .../soulbound-feature-tokens.component.html | 28 ++-- .../soulbound-feature-tokens.component.ts | 30 ++-- 13 files changed, 186 insertions(+), 136 deletions(-) diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index cabf7f601..1736971b7 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -120,7 +120,8 @@

    Total Value

    [extend]="true" (totalPick)="totalSBT = $event" [displayManage]="true" - [accountAddress]="currentAddress"> + [accountAddress]="currentAddress" + [isAccountDetail]="true">

    diff --git a/src/app/pages/account/account-detail/account-detail.component.ts b/src/app/pages/account/account-detail/account-detail.component.ts index f1296e535..1b1a401d5 100644 --- a/src/app/pages/account/account-detail/account-detail.component.ts +++ b/src/app/pages/account/account-detail/account-detail.component.ts @@ -217,16 +217,19 @@ export class AccountDetailComponent implements OnInit { getSBTPick() { const payload = { + limit: 100, + offset: 0, receiverAddress: this.currentAddress, - limit: LIMIT_NUM_SBT, + isEquipToken: true, }; - this.soulboundService.getSBTPick(payload).subscribe((res) => { - if (this.userAddress && this.currentAddress !== this.userAddress) { - res.data = res.data.filter((k) => k.picked); - } - this.totalSBT = res.data.length; - }); + this.soulboundService.getListSoulboundByAddress(payload).subscribe( + (res) => { + this.totalSBT = res.data.length; + }, + () => {}, + () => {}, + ); } extendLink(url) { diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index f9915a65c..c7e553b44 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -49,9 +49,10 @@

    Filter

    data-bs-toggle="dropdown" (click)="addShow()" aria-expanded="false"> - {{ - transactionFilter.typeTransfer?.length > 0 ? transactionFilter.typeTransfer : 'Select Action' + {{ + transactionFilter.typeTransfer?.length > 0 ? transactionFilter.typeTransfer : 'Select a type' }} + @@ -163,7 +164,7 @@

    Coins & Tokens ({{ pageData?. - +
    Price @@ -173,7 +174,7 @@

    Coins & Tokens ({{ pageData?.
    - {{ element.isValueUp ? '↑' : '↓' }}{{ element.change | number : global.formatNumber2Decimal }}%
    @@ -184,7 +185,7 @@

    Coins & Tokens ({{ pageData?. - + Amount diff --git a/src/app/pages/blocks/block-detail/block-detail.component.html b/src/app/pages/blocks/block-detail/block-detail.component.html index 6f4d07562..c5d416a4a 100644 --- a/src/app/pages/blocks/block-detail/block-detail.component.html +++ b/src/app/pages/blocks/block-detail/block-detail.component.html @@ -181,12 +181,12 @@

    Transactions

    {{ +data[template.matColumnDef] | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    - {{ data?.denom | convertLogAmount : true }} + {{ data?.denom | convertLogAmount : true }} - @@ -228,7 +228,7 @@

    Transactions

    [content]="[ { label: 'Fee', - info: (+data.fee | mask : 'separator.6') + ' ' + denom + '' + info: (+data.fee | mask : 'separator.6') + ' ' + denom + '' }, { label: 'Time', info: commonService.getDateValue(data.timestamp, false)[1] } ]"> diff --git a/src/app/pages/community-pool/proposal-list/community-pool-proposal.component.html b/src/app/pages/community-pool/proposal-list/community-pool-proposal.component.html index 822ad7f0a..570609fb5 100644 --- a/src/app/pages/community-pool/proposal-list/community-pool-proposal.component.html +++ b/src/app/pages/community-pool/proposal-list/community-pool-proposal.component.html @@ -60,7 +60,7 @@

    Community Pool Spent Proposals

    class="mb-0 text--gray-1 fw-normal" [appBigNumber]="element?.content.amount[0].amount" [decimal]="6"> - {{ denom }} + {{ denom }} diff --git a/src/app/pages/contracts/contracts-detail/contracts-contents/contract/read-contract/read-contract.component.html b/src/app/pages/contracts/contracts-detail/contracts-contents/contract/read-contract/read-contract.component.html index f1fb34832..62b0f322e 100644 --- a/src/app/pages/contracts/contracts-detail/contracts-contents/contract/read-contract/read-contract.component.html +++ b/src/app/pages/contracts/contracts-detail/contracts-contents/contract/read-contract/read-contract.component.html @@ -97,7 +97,7 @@
    -
    Response:
    +
    Response:
    
                     
    diff --git a/src/app/pages/contracts/contracts-register/contracts-register.component.html b/src/app/pages/contracts/contracts-register/contracts-register.component.html index 64a009bae..a1a16d09e 100644 --- a/src/app/pages/contracts/contracts-register/contracts-register.component.html +++ b/src/app/pages/contracts/contracts-register/contracts-register.component.html @@ -161,11 +161,10 @@

    Register Code ID Type

    -
    - You have not yet registered type for any Code ID + You have not yet registered type for any Code ID
    diff --git a/src/app/pages/login/login.component.html b/src/app/pages/login/login.component.html index 9ed7761d9..994338a76 100644 --- a/src/app/pages/login/login.component.html +++ b/src/app/pages/login/login.component.html @@ -52,7 +52,7 @@ autocomplete="off">
    - +
    Kindly enter the email linked to your account, we'll send you a link to reset password
    @@ -265,7 +265,7 @@ verify@aura.network
    - Have not received any email? + Have not received any email? Resend
    {{ errorMessage[errorMessage?.length - 1] }}
    diff --git a/src/app/pages/proposal/proposal-detail/summary-info/current-status/current-status.component.html b/src/app/pages/proposal/proposal-detail/summary-info/current-status/current-status.component.html index de2cd6563..1258f0111 100644 --- a/src/app/pages/proposal/proposal-detail/summary-info/current-status/current-status.component.html +++ b/src/app/pages/proposal/proposal-detail/summary-info/current-status/current-status.component.html @@ -1,5 +1,5 @@
    -
    +

    Current Status

    diff --git a/src/app/pages/proposal/proposal-detail/summary-info/current-turnout/current-turnout.component.html b/src/app/pages/proposal/proposal-detail/summary-info/current-turnout/current-turnout.component.html index eff41e5af..62c2608ba 100644 --- a/src/app/pages/proposal/proposal-detail/summary-info/current-turnout/current-turnout.component.html +++ b/src/app/pages/proposal/proposal-detail/summary-info/current-turnout/current-turnout.component.html @@ -1,5 +1,5 @@
    -
    +
    Current Turnout
    diff --git a/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.html b/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.html index 4c9c57b0c..eeadd89b1 100644 --- a/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.html +++ b/src/app/pages/proposal/proposal-detail/summary-info/summary-info.component.html @@ -72,14 +72,14 @@

    Initial Deposit
    {{ proposalDetail.initial_deposit | mask : 'separator.6' }} - {{ denom }} + {{ denom }}

    Total Deposit
    {{ proposalDetail.pro_total_deposits | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    @@ -205,7 +205,7 @@

    Request Amount
    {{ proposalDetail.request_amount | mask : 'separator.6' }} - {{ denom }} +wtext--white"

    @@ -234,7 +234,7 @@

    Total:
    {{ proposalDetail.pro_total_vote | mask : 'separator.6' }} - {{ denom }} + {{ denom }}

    @@ -336,7 +336,7 @@

    {{ this.proposalDetail.pro_votes_yes || 0 | mask : 'separator.6' }} - {{ denom }} + {{ denom }}

  • @@ -348,7 +348,7 @@

  • {{ this.proposalDetail.pro_votes_no || 0 | mask : 'separator.6' }} - {{ denom }} + {{ denom }}

  • @@ -360,7 +360,7 @@

  • {{ this.proposalDetail.pro_votes_no_with_veto || 0 | mask : 'separator.6' }} - {{ denom }} + {{ denom }}

  • @@ -372,7 +372,7 @@

  • {{ this.proposalDetail.pro_votes_abstain || 0 | mask : 'separator.6' }} - {{ denom }} + {{ denom }}

    @@ -414,7 +414,7 @@

    -
    +
    diff --git a/src/app/pages/proposal/proposal-table/proposal-table.component.html b/src/app/pages/proposal/proposal-table/proposal-table.component.html index bc3343a15..80ffb8a85 100644 --- a/src/app/pages/proposal/proposal-table/proposal-table.component.html +++ b/src/app/pages/proposal/proposal-table/proposal-table.component.html @@ -54,7 +54,7 @@ (template.isShort ? shortenAddress(data[template.matColumnDef]) : data[template.matColumnDef]) | mask : 'separator.6' || '-' }} - {{ denom }} + {{ denom }} {{ getVoteValue(data[template.matColumnDef]) }} @@ -235,7 +235,7 @@ info: data.amount ? '' + (data.amount | mask : 'separator.6') + - '' + + '' + denom + '' : '-' diff --git a/src/app/pages/proposal/proposal.component.html b/src/app/pages/proposal/proposal.component.html index ec8a6fbc7..5b73313eb 100644 --- a/src/app/pages/proposal/proposal.component.html +++ b/src/app/pages/proposal/proposal.component.html @@ -422,7 +422,7 @@

    Proposals

    Total Deposit {{ element.total_deposit[0].amount | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    diff --git a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html index fb3966f64..d4038c1c1 100644 --- a/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-account-token-list/soulbound-account-token-list.component.html @@ -11,7 +11,7 @@
    -
    +
    Address
    diff --git a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html index b6d17b273..ecba7918d 100644 --- a/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html +++ b/src/app/pages/soulbound-token/soulbound-contract-list/soulbound-contract-list.component.html @@ -65,19 +65,19 @@

    ABT Creator

    - CREATED DATA + CREATED DATA {{ element.total }} - CLAIMED QTY + CLAIMED QTY {{ element.claimed_qty }} - UNCLAIMED QTY + UNCLAIMED QTY {{ element.unclaimed_qty }} diff --git a/src/app/pages/soulbound-token/soulbound-token-contract/soulbound-token-contract.component.html b/src/app/pages/soulbound-token/soulbound-token-contract/soulbound-token-contract.component.html index 13b87b4c4..7ece4107d 100644 --- a/src/app/pages/soulbound-token/soulbound-token-contract/soulbound-token-contract.component.html +++ b/src/app/pages/soulbound-token/soulbound-token-contract/soulbound-token-contract.component.html @@ -104,7 +104,7 @@

    ABT Creator

    - RECEIVER + RECEIVER @@ -112,13 +112,13 @@

    ABT Creator

    - TOKEN ID + TOKEN ID {{ element.token_id }} - STATUS + STATUS
    diff --git a/src/app/pages/token/nft-detail/nft-detail.component.html b/src/app/pages/token/nft-detail/nft-detail.component.html index 3de6150a3..e6bf24c6a 100644 --- a/src/app/pages/token/nft-detail/nft-detail.component.html +++ b/src/app/pages/token/nft-detail/nft-detail.component.html @@ -102,7 +102,7 @@

    Min. Price
    - - {{ denom }} + - {{ denom }} (-)
    @@ -112,7 +112,7 @@

    Last Sale (Item)
    - N/A + N/A
    @@ -122,7 +122,7 @@

    Last Sale (Contract)
    - - {{ denom }} + - {{ denom }} (-)
    @@ -134,21 +134,21 @@

    Min. Price
    - - {{ denom }} + - {{ denom }} (-)
    Last Sale (Item)
    - N/A + N/A
    Last Sale (Contract)
    - - {{ denom }} + - {{ denom }} (-)
    @@ -329,7 +329,7 @@

    Item Activity

    class="aura-table nft-detail-table"> - +
    diff --git a/src/app/pages/token/nft-detail/popup-share/popup-share.component.html b/src/app/pages/token/nft-detail/popup-share/popup-share.component.html index e491f9b13..d544c5df9 100644 --- a/src/app/pages/token/nft-detail/popup-share/popup-share.component.html +++ b/src/app/pages/token/nft-detail/popup-share/popup-share.component.html @@ -9,7 +9,7 @@ (click)="closeDialog()" />
    -
    +
    diff --git a/src/app/pages/transaction/transaction-detail/transaction-messages/transaction-messages.component.html b/src/app/pages/transaction/transaction-detail/transaction-messages/transaction-messages.component.html index e2010c779..88dc0c2cf 100644 --- a/src/app/pages/transaction/transaction-detail/transaction-messages/transaction-messages.component.html +++ b/src/app/pages/transaction/transaction-detail/transaction-messages/transaction-messages.component.html @@ -1,4 +1,4 @@ -
    +
    {{ checkTypeMessage() }} @@ -160,7 +160,7 @@
    Amount
    {{ transactionDetail?.tx?.tx?.body?.messages[0]?.token?.amount | balanceOf | mask : 'separator.6' }} - {{ + {{ transactionDetail?.tx?.tx?.body?.messages[0]?.token?.denom | convertLogAmount : true }}
    @@ -218,7 +218,7 @@
    Amount
    {{ ibcData?.acknowledgement?.amount | balanceOf | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    {{ +data[template.matColumnDef] | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    {{ data[template.matColumnDef] }}
    @@ -86,7 +86,7 @@ { label: 'Fee', class: 'body-01-mob text--gray-1', - info: (+data.fee | mask: 'separator.6') + ' ' + denom + '' + info: (+data.fee | mask: 'separator.6') + ' ' + denom + '' }, { label: 'Time', diff --git a/src/app/pages/validators/popup-delegate/popup-delegate.component.html b/src/app/pages/validators/popup-delegate/popup-delegate.component.html index d4907e044..504d1f12b 100644 --- a/src/app/pages/validators/popup-delegate/popup-delegate.component.html +++ b/src/app/pages/validators/popup-delegate/popup-delegate.component.html @@ -18,14 +18,14 @@ ? '0' : (+data.validatorDetail?.amount_staked | mask : 'separator.6') }} - {{ denom }} + {{ denom }}
    Delegable Balance
    {{ !availableToken || +availableToken < 0.000001 ? '0' : (+availableToken | mask : 'separator.6') }} - {{ denom }} + {{ denom }}
    Amount to Delegate
    @@ -59,7 +59,7 @@ ? '0' : (+data.validatorDetail?.amount_staked | mask : 'separator.6') }} - {{ denom }} + {{ denom }}
    @@ -70,14 +70,14 @@ ? '0' : (+data.validatorDetail?.pending_reward | mask : 'separator.6') }} - {{ denom }} + {{ denom }}
    Delegable Balance
    {{ !availableToken || +availableToken < 0.000001 ? '0' : (+availableToken | mask : 'separator.6') }} - {{ denom }} + {{ denom }}
    diff --git a/src/app/pages/validators/user-wallet-info/user-wallet-info.component.html b/src/app/pages/validators/user-wallet-info/user-wallet-info.component.html index 3cfb5968b..b1ebfc8bf 100644 --- a/src/app/pages/validators/user-wallet-info/user-wallet-info.component.html +++ b/src/app/pages/validators/user-wallet-info/user-wallet-info.component.html @@ -8,14 +8,14 @@ Available Balance:
    - {{ denom }} + {{ denom }}
    Total Staked:
    - {{ denom }} + {{ denom }}
    @@ -76,11 +76,11 @@
    - {{ denom }} + {{ denom }}
    - {{ denom }} + {{ denom }}
    -
    {{ denom }}
    +
    {{ denom }}
    Insufficient available balance for transaction fee diff --git a/src/app/pages/validators/validators-detail/validators-detail.component.html b/src/app/pages/validators/validators-detail/validators-detail.component.html index 72ba74847..2ba24da07 100644 --- a/src/app/pages/validators/validators-detail/validators-detail.component.html +++ b/src/app/pages/validators/validators-detail/validators-detail.component.html @@ -143,7 +143,7 @@
    Address
    {{ +currentValidatorDetail?.power | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    ({{ currentValidatorDetail?.percent_power }}%)
    @@ -161,7 +161,7 @@
    Address
    {{ +currentValidatorDetail?.self_bonded | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    ({{ currentValidatorDetail?.percent_self_bonded }})
    @@ -327,10 +327,6 @@

    Uptime

    Delegators

    -
    @@ -351,7 +347,7 @@

    Delegators

    [tooltipPosition]="'tooltip--right'">
    {{ data[template.matColumnDef] | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    {{ data[template.matColumnDef] }}
    @@ -385,7 +381,7 @@

    Delegators

    { label: 'Amount', class: 'body-01 text--gray-1', - info: (data.amount | mask : 'separator.6') + ' ' + denom + '' + info: (data.amount | mask : 'separator.6') + ' ' + denom + '' } ]">
    diff --git a/src/app/pages/validators/validators.component.html b/src/app/pages/validators/validators.component.html index 7ca1da863..1529258c3 100644 --- a/src/app/pages/validators/validators.component.html +++ b/src/app/pages/validators/validators.component.html @@ -109,7 +109,7 @@

    Validators

    -
    +
    @@ -156,7 +156,7 @@

    Validators

    - +
    Validators

    - +
    @@ -176,7 +176,7 @@

    Validators

    {{ data[template.matColumnDef] }}
    -
    +
    {{ data[template.matColumnDef] | percent : globals.formatNumber2Decimal }}
    @@ -423,10 +423,9 @@
    Voting power - {{ validatorDetail?.percent_power }}%  ({{ validatorDetail?.power | mask : 'separator.6' }} - {{ denom }}{{ denom }})
    -
    @@ -437,7 +436,7 @@
    {{ dataDelegate?.validatorDetail?.amount_staked | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    MAX
    -
    {{ denom }}
    +
    {{ denom }}
    @@ -468,7 +467,7 @@
    MAX
    -
    {{ denom }}
    +
    {{ denom }}
    Insufficient available balance for transaction fee @@ -514,11 +513,11 @@
    - Available for redelegation + Available for redelegation {{ dataDelegate?.validatorDetail?.amount_staked | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    MAX
    -
    {{ denom }}
    +
    {{ denom }}
    diff --git a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html index b5ceb0c19..f13930ca4 100644 --- a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html +++ b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html @@ -27,8 +27,7 @@
    +{{ dataCard.arrEvent?.length - 1 }}
    - -
    +
    -
    + -
    +
    - {{ denom }} + {{ denom }}
    diff --git a/src/app/shared/components/contract-table/contract-table.component.html b/src/app/shared/components/contract-table/contract-table.component.html index 2d4941472..03e4b35f8 100644 --- a/src/app/shared/components/contract-table/contract-table.component.html +++ b/src/app/shared/components/contract-table/contract-table.component.html @@ -69,7 +69,7 @@ >{{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} -
    -
    +
    -
    ABTs ({{ totalABT || 0 }})
    - +
    From 702b5f1084726a6fafd79c00ea719b38e9389d41 Mon Sep 17 00:00:00 2001 From: mtam Date: Thu, 7 Sep 2023 14:39:26 +0700 Subject: [PATCH 061/142] [TamTM6] fix layout tx account --- src/app/core/constants/account.enum.ts | 4 +- src/app/core/services/soulbound.service.ts | 4 + .../account-detail.component.html | 2 +- .../account-detail.component.ts | 12 +++ .../account-stake.component.html | 4 +- .../account-transaction-table.component.html | 91 ++++++++----------- .../account-transaction-table.component.scss | 36 ++++++-- .../account-transaction-table.component.ts | 27 +++--- .../account-transaction.component.html | 4 +- .../account-transaction.component.scss | 13 +++ .../card-mob-account.component.html | 8 +- .../card-mob-account.component.scss | 10 ++ 12 files changed, 133 insertions(+), 82 deletions(-) diff --git a/src/app/core/constants/account.enum.ts b/src/app/core/constants/account.enum.ts index a42fd3e36..c21382400 100644 --- a/src/app/core/constants/account.enum.ts +++ b/src/app/core/constants/account.enum.ts @@ -48,8 +48,8 @@ export enum WalletAcount { export enum TabsAccount { ExecutedTxs = 'EXECUTED', AuraTxs = 'AURA TRANSFER', - FtsTxs = 'TOKENs TRANSFER', - NftTxs = 'NFTs TRANSFER', + FtsTxs = 'TOKEN TRANSFER', + NftTxs = 'NFT TRANSFER', } export enum TabsAccountLink { diff --git a/src/app/core/services/soulbound.service.ts b/src/app/core/services/soulbound.service.ts index 4b1f7841b..1fc0a8995 100644 --- a/src/app/core/services/soulbound.service.ts +++ b/src/app/core/services/soulbound.service.ts @@ -136,4 +136,8 @@ export class SoulboundService extends CommonService { getNotify(receiveAddress): Observable { return this.http.get(`${this.apiUrl}/soulbound-token/notify/${receiveAddress}`); } + + countTotalABT(receiveAddress): Observable { + return this.http.get(`${this.apiUrl}/soulbound-token/count/${receiveAddress}`); + } } diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 24794cb16..9979a6799 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -120,7 +120,7 @@

    Account Info

    @@ -23,7 +25,9 @@
    - {{ title.subLabelContent | stringEllipsis : 30 }} + {{ + title.subLabelContent | stringEllipsis : 30 + }}
    +{{ dataCard.arrEvent?.length - 1 }}
    diff --git a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss index a1231494a..291e05489 100644 --- a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss +++ b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss @@ -47,3 +47,13 @@ } } } + +.ellipsis-text { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100px; + @media (min-width: 376px) { + max-width: 140px; + } +} \ No newline at end of file From 10bd5eb9119cd0ab44ad1c6fb3adff782b6e156a Mon Sep 17 00:00:00 2001 From: mtam Date: Thu, 7 Sep 2023 14:58:29 +0700 Subject: [PATCH 062/142] [TamTM6] fix layout tx account --- .../account-transaction-table.component.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index c22c119a1..cf3434e7a 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -103,6 +103,7 @@ .tab-nft .item-show { height: 64px; } + tr td { vertical-align: top; padding-top: var(--spacer-4); @@ -111,6 +112,16 @@ } } + tr:has(.tab-nft) td { + &:nth-child(1), + &:nth-child(3) { + padding-top: var(--spacer-5) !important; + } + &:nth-child(2) { + padding-top: var(--spacer-3) !important; + } + } + .explain-data { transition: max-height 0.35s ease-in-out; max-height: 0; From 8fcd7d07f1b8adc0b65c6c6e609891941dbabcaa Mon Sep 17 00:00:00 2001 From: mtam Date: Thu, 7 Sep 2023 16:16:25 +0700 Subject: [PATCH 063/142] [TamTM6] fix layout tx account --- .../account-transaction-table.component.html | 15 +++++++-------- .../account-transaction-table.component.ts | 2 +- .../card-mob-account.component.scss | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index d846f6fd6..14cc1e3f5 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -19,9 +19,11 @@
    -
    - {{ nextKey ? 'More than' : 'A total of' }} {{ pageData?.length }} transaction{{ pageData?.length > 1 ? 's' : '' }} - found +
    + + {{ nextKey ? 'More than' : 'A total of' }} {{ pageData?.length }} transaction{{ pageData?.length > 1 ? 's' : '' }} + found +
    {{ +data[template.matColumnDef] | mask : 'separator.6' }} - {{ denom }} + {{ denom }}
    @@ -456,7 +455,7 @@

    Filter

    { label: 'Fee', class: 'text--gray-1 body-02-mob', - info: (data.fee | mask : 'separator.6') + ' ' + denom + '' + info: (data.fee | mask : 'separator.6') + ' ' + denom + '' } ]">
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 4f8da52a8..ee4f9c64f 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -273,7 +273,7 @@ export class AccountTransactionTableComponent { } } this.templates = [...this.templatesToken]; - this.templates.push({ matColumnDef: 'nft', headerCellDef: 'NFT', headerWidth: 15 }); + this.templates.push({ matColumnDef: 'nft', headerCellDef: 'Token ID', headerWidth: 15 }); this.displayedColumns = this.templates.map((dta) => dta.matColumnDef); this.getListNFTByAddress(payload); break; diff --git a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss index 291e05489..94539308c 100644 --- a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss +++ b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss @@ -54,6 +54,6 @@ text-overflow: ellipsis; max-width: 100px; @media (min-width: 376px) { - max-width: 140px; + max-width: 110px; } } \ No newline at end of file From a86b50a140eaa8837ab575fa66bddc7d9ab98c02 Mon Sep 17 00:00:00 2001 From: nhphuc2411 Date: Thu, 7 Sep 2023 16:58:44 +0700 Subject: [PATCH 064/142] keep filter and result --- .../account-transaction-table.component.ts | 31 +++++++++++----- .../account-transaction.component.html | 36 ++++++++++++++----- .../account-transaction.component.ts | 2 ++ 3 files changed, 52 insertions(+), 17 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 4f8da52a8..71e382f75 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -1,6 +1,6 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { DatePipe } from '@angular/common'; -import { Component, Input, ViewChild } from '@angular/core'; +import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute } from '@angular/router'; @@ -26,6 +26,10 @@ export class AccountTransactionTableComponent { @Input() address: string; @Input() modeQuery: string; @Input() displayType: boolean = false; + @Input() savedFilter: any = null; + @Input() savedTab: any; + @Output() filterCondition = new EventEmitter(); + @Output() tabName = new EventEmitter(); transactionLoading = false; currentAddress: string; @@ -118,14 +122,19 @@ export class AccountTransactionTableComponent { } initTnxFilter() { - this.transactionTypeKeyWord = ''; - this.listTypeSelected = ''; - this.transactionFilter = { - startDate: null, - endDate: null, - type: [], - typeTransfer: null, - }; + if (this.savedFilter !== null && this.savedTab === this.modeQuery) { + this.transactionFilter = this.savedFilter; + this.listTypeSelected = this.transactionFilter.type; + } else { + this.transactionTypeKeyWord = ''; + this.listTypeSelected = ''; + this.transactionFilter = { + startDate: null, + endDate: null, + type: [], + typeTransfer: null, + }; + } } onChangeTnxFilterType(event, type: any) { @@ -192,6 +201,10 @@ export class AccountTransactionTableComponent { this.nextKey = null; this.currentKey = null; this.isSearch = isSearch; + this.filterCondition.emit(this.transactionFilter); + console.log(this.modeQuery); + + this.tabName.emit(this.modeQuery); this.getTxsAddress(); } diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html index 4b9942752..e252f242b 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.html @@ -15,33 +15,53 @@

    Transactions

    (click)="changeTab(tab.value)" [class.active]="currentTab === tab.value" class="button button-tab-menu body fw-semibold cursor-pointer"> - {{ - tab.label - }} + {{ tab.label }} - - + - + - + - +
    diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts index 8402b4e5e..b88a83373 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.ts @@ -21,6 +21,8 @@ export class AccountTransactionComponent implements OnInit { TABS = TABS_TITLE_ACCOUNT; tabsData = TabsAccountLink; currentTab = TabsAccountLink.ExecutedTxs; + savedFilter = null; + savedTab = null; constructor(private layout: BreakpointObserver, private route: ActivatedRoute, private location: Location) {} From 176c3946856f42f4ae9b39d5451d45f4d025ec97 Mon Sep 17 00:00:00 2001 From: mtam Date: Fri, 8 Sep 2023 11:36:10 +0700 Subject: [PATCH 065/142] [TamTM6] fix layout tx account --- .../account-transaction-table.component.html | 66 +++++++++++++++---- .../account-transaction-table.component.scss | 4 +- .../account-transaction-table.component.ts | 3 +- 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 14cc1e3f5..78dfbde8f 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -73,8 +73,8 @@

    Filter

    -
    - From - To +
    + + + + +
    + +
    + +
    + + +
    +
    +
    +
    -
    +
    + +
    + +
    + + +
    +
    +
    -
    +
    Message Type
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index 069514a32..7e18f6789 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -17,7 +17,13 @@ } } } - +.box-filter { + .filter-time { + .input-group { + height: 40px; + } + } +} .tnx-filter-item { height: 44px; } diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 0a90e7780..ca92fd6ce 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -79,7 +79,6 @@ export class AccountTransactionTableComponent { maxDate; linkToken = 'token-nft'; typeTx = [AccountTxType.Sent, AccountTxType.Received]; - currDate; breakpoint$ = this.layout.observe([Breakpoints.Small, Breakpoints.XSmall]); denom = this.environmentService.configValue.chain_info.currencies[0].coinDenom; @@ -122,10 +121,17 @@ export class AccountTransactionTableComponent { }); } - initTnxFilter() { - if (this.savedFilter !== null && this.savedTab === this.modeQuery) { + initTnxFilter(isReset = false) { + if (this.savedFilter !== null && this.savedTab === this.modeQuery && !isReset) { this.transactionFilter = this.savedFilter; - this.listTypeSelected = this.transactionFilter.type; + this.transactionFilter.type.forEach((element, index) => { + let type = _.find(TYPE_TRANSACTION, { label: element })?.value; + if (!this.listTypeSelected) { + this.listTypeSelected = type; + } else { + this.listTypeSelected += ', ' + type; + } + }); } else { this.transactionTypeKeyWord = ''; this.listTypeSelected = ''; @@ -187,6 +193,7 @@ export class AccountTransactionTableComponent { clearFilterSearch(isResetFilter = true) { this.tnxType = this.tnxTypeOrigin; + this.savedFilter = null; this.getListTypeFilter(); this.transactionTypeKeyWord = ''; if (isResetFilter) { @@ -203,8 +210,6 @@ export class AccountTransactionTableComponent { this.currentKey = null; this.isSearch = isSearch; this.filterCondition.emit(this.transactionFilter); - console.log(this.modeQuery); - this.tabName.emit(this.modeQuery); this.getTxsAddress(); } @@ -431,4 +436,9 @@ export class AccountTransactionTableComponent { this.currentKey = this.nextKey; } } + + setDateRange() { + this.maxDate = this.datePipe.transform(this.transactionFilter?.endDate, DATEFORMAT.DATE_ONLY) || this.maxDate; + this.minDate = this.datePipe.transform(this.transactionFilter?.startDate, DATEFORMAT.DATE_ONLY) || this.minDate; + } } diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss index ff3217f40..2c2ac970d 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss @@ -34,6 +34,7 @@ @media (min-width: 991.98px) { .aura-form { width: 388px; + min-height: 295px; } } } From 2ab7e02328c1750decaabe5db5e493283064bca4 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Fri, 8 Sep 2023 15:37:11 +0700 Subject: [PATCH 068/142] fix bug UI (filter pannel) --- .../account-transaction-table.component.html | 2 +- .../account-transaction-table.component.scss | 3 +++ .../account-transaction/account-transaction.component.scss | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index a6a66270c..c941dc8a9 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -35,7 +35,7 @@ Filter - +
    Date: Fri, 8 Sep 2023 16:19:40 +0700 Subject: [PATCH 069/142] [TamTM6] fix padding filter --- .../account-transaction/account-transaction.component.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss index 8145c1834..cc8a2f317 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss @@ -36,6 +36,7 @@ .aura-form { width: 388px; min-height: 295px; + padding: 16px; } } } From e74dd2bfcdf76266be7b3c52e6d42bd5463bef9e Mon Sep 17 00:00:00 2001 From: mtam Date: Fri, 8 Sep 2023 16:44:19 +0700 Subject: [PATCH 070/142] [TamTM6] revert tooltip --- .../account-transaction-table.component.ts | 8 ++++---- src/assets/scss/aura-theme/tooltip.scss | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index ca92fd6ce..689e55c9e 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -93,10 +93,7 @@ export class AccountTransactionTableComponent { private userService: UserService, private route: ActivatedRoute, private datePipe: DatePipe, - ) { - this.minDate = new Date(2023, 2, 20); - this.maxDate = new Date().toISOString().slice(0, 10); - } + ) {} ngOnInit(): void { this.initTnxFilter(); @@ -132,6 +129,7 @@ export class AccountTransactionTableComponent { this.listTypeSelected += ', ' + type; } }); + this.setDateRange(); } else { this.transactionTypeKeyWord = ''; this.listTypeSelected = ''; @@ -141,6 +139,8 @@ export class AccountTransactionTableComponent { type: [], typeTransfer: null, }; + this.minDate = new Date(2023, 2, 20); + this.maxDate = new Date().toISOString().slice(0, 10); } } diff --git a/src/assets/scss/aura-theme/tooltip.scss b/src/assets/scss/aura-theme/tooltip.scss index ef8608f73..d53bea3c7 100644 --- a/src/assets/scss/aura-theme/tooltip.scss +++ b/src/assets/scss/aura-theme/tooltip.scss @@ -3,8 +3,7 @@ app-tooltip-customize { width: max-content; position: absolute; left: 50%; - bottom: 100% !important; - top: unset !important; + bottom: 100%; transform: translate(-50%, -16px); max-width: 0; max-height: 0; @@ -12,8 +11,8 @@ app-tooltip-customize { transition: opacity .35s ease-in-out; &.tooltip--below { - bottom: 0 !important; - top: 100% !important; + bottom: 0; + top: 100%; transform: translate(-50%, 16px); } } @@ -53,14 +52,14 @@ app-tooltip-customize { } app-tooltip-customize.tooltip--left { - left: unset !important; + left: unset; right: 0; - transform: translate(0, -32px) !important; + transform: translate(0, -32px); } app-tooltip-customize.tooltip--right { - right: unset !important; + right: unset; left: 0; - transform: translate(0, -16px) !important; + transform: translate(0, -16px); } From 7f01df23076b3c52c4c9509bf913e974cdc9ab86 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Fri, 8 Sep 2023 17:08:49 +0700 Subject: [PATCH 071/142] fix bug UI (filter pannel) --- .../account-transaction/account-transaction.component.scss | 2 +- .../account-detail/token-table/token-table.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss index cc8a2f317..736a4a765 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss @@ -9,7 +9,6 @@ } } ::ng-deep .mat-menu-panel.tsx-filter-panel { - padding: 0; max-width: unset; border-radius: var(--spacer-2); .mat-menu-content { @@ -33,6 +32,7 @@ } } @media (min-width: 991.98px) { + padding: 0; .aura-form { width: 388px; min-height: 295px; diff --git a/src/app/pages/account/account-detail/token-table/token-table.component.html b/src/app/pages/account/account-detail/token-table/token-table.component.html index e0d87f793..16cf5267e 100644 --- a/src/app/pages/account/account-detail/token-table/token-table.component.html +++ b/src/app/pages/account/account-detail/token-table/token-table.component.html @@ -3,7 +3,7 @@
    -

    Coins & Tokens ({{ pageData?.length || 0 }})

    +

    Coins & Tokens ({{ pageData?.length || 0 }})

    Date: Fri, 8 Sep 2023 17:13:57 +0700 Subject: [PATCH 072/142] fix bug UI (tool tip position) --- .../soulbound-feature-tokens.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html index e7b2f7a94..7b4172e80 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html @@ -14,7 +14,7 @@

    ABTs ({{ totalABT || 0 }})

    {{ soulboundUnclaimedNum > 99 ? '99+' : soulboundUnclaimedNum }} From 0aeacb031b515acf78b1ceb6ba9ae726106f113d Mon Sep 17 00:00:00 2001 From: mtam Date: Mon, 11 Sep 2023 11:27:41 +0700 Subject: [PATCH 073/142] [TamTM6] update layout filter box --- src/app/global/global.ts | 33 ++++++++++--------- .../account-transaction-table.component.html | 26 ++++++++------- .../account-transaction-table.component.scss | 6 ++++ .../account-transaction-table.component.ts | 7 ++-- .../account-transaction.component.scss | 15 +++++---- .../token-transfers-tab.component.ts | 4 +-- 6 files changed, 54 insertions(+), 37 deletions(-) diff --git a/src/app/global/global.ts b/src/app/global/global.ts index 95acba205..7c1656b70 100644 --- a/src/app/global/global.ts +++ b/src/app/global/global.ts @@ -394,25 +394,26 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece case TabsAccountLink.AuraTxs: let arrTemp = []; element?.data?.tx_response?.logs?.forEach((data) => { - const coinArrReceiver = _.get(data, 'events')?.find( - (k) => k.type === 'coin_received', - )?.attributes; - const coinArrSpent = _.get(data, 'events')?.find( - (k) => k.type === 'coin_spent', - )?.attributes; + const coinArrReceiver = _.get(data, 'events')?.find((k) => k.type === 'coin_received')?.attributes; + const coinArrSpent = _.get(data, 'events')?.find((k) => k.type === 'coin_spent')?.attributes; for (let i = 0; i < coinArrReceiver?.length; i++) { if ( (coinArrReceiver[i]?.key === 'receiver' && coinArrReceiver[i]?.value === currentAddress) || (coinArrSpent[i]?.key === 'spender' && coinArrSpent[i]?.value === currentAddress) ) { - let { type, action } = getTypeTx(element, i); - toAddress = coinArrReceiver[i]?.value; - fromAddress = coinArrSpent[i]?.value; - let amountTemp = coinArrReceiver[i + 1]?.value?.match(/\d+/g)[0]; - let amount = balanceOf(Number(amountTemp) || 0, coinInfo.coinDecimals); - let denom = coinInfo.coinDenom; - const result = { type, toAddress, fromAddress, amount, denom, action }; - arrTemp.push(result); + if ( + coinArrReceiver[i + 1]?.value?.indexOf(coinInfo.coinMinimalDenom) > -1 || + coinArrReceiver[i - 1]?.value?.indexOf(coinInfo.coinMinimalDenom) > -1 + ) { + let { type, action } = getTypeTx(element, i); + toAddress = coinArrReceiver[i]?.value; + fromAddress = coinArrSpent[i]?.value; + let amountTemp = (coinArrReceiver[i + 1] || coinArrReceiver[i - 1])?.value?.match(/\d+/g)[0]; + let amount = balanceOf(Number(amountTemp) || 0, coinInfo.coinDecimals); + let denom = coinInfo.coinDenom; + const result = { type, toAddress, fromAddress, amount, denom, action }; + arrTemp.push(result); + } } } }); @@ -495,14 +496,14 @@ export function convertDataAccountTransaction(data, coinInfo, modeQuery, setRece arrEvent, limit, action, - eventAttr + eventAttr, }; }); return txs; } export function getTypeTx(element, index = 0) { - let type = element?.transaction_messages[element?.transaction_messages?.length - 1]?.content["@type"]; + let type = element?.transaction_messages[element?.transaction_messages?.length - 1]?.content['@type']; let action; if (type === TRANSACTION_TYPE_ENUM.ExecuteContract) { try { diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index c941dc8a9..1b05fb30f 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -60,13 +60,13 @@

    Filter

    @@ -84,11 +84,11 @@

    Filter

    [max]="maxDate" [style]="'max-width: 70%'" [(ngModel)]="transactionFilter.startDate" - (ngModelChange)="setDateRange()" + (ngModelChange)="setDateRange(true)" class="cursor-pointer" placeholder="Select" /> -
    - +
    +
    @@ -108,8 +108,8 @@

    Filter

    (ngModelChange)="setDateRange()" class="cursor-pointer" placeholder="Select" /> -
    - +
    +
    @@ -204,7 +204,9 @@

    Filter

    -
    @@ -349,8 +351,10 @@

    Filter

    @@ -396,7 +400,7 @@

    Filter

    [url]="(item.toAddress || currentAddress)?.length > lengthAddress ? 'contracts' : 'account'" [iconContract]="(item.toAddress || currentAddress)?.length > lengthAddress" [isLink]=" - !(data.toAddress?.startsWith('0000') || currentAddress?.startsWith('0000')) && + !(item.toAddress?.startsWith('0000') || currentAddress?.startsWith('0000')) && item.toAddress !== currentAddress ">
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index 4b132a6d1..b8086ee12 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -23,6 +23,9 @@ height: 40px; } } + @media (max-width: 376px) { + width: calc(100vw - 68px); + } } .tnx-filter-item { height: 44px; @@ -34,6 +37,9 @@ @media (max-width: 1366px) { max-height: 280px; } + @media (max-width: 414px) { + max-height: 180px; + } ::ng-deep { .form-group label { line-height: 18px !important; diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 689e55c9e..9823da531 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -197,6 +197,7 @@ export class AccountTransactionTableComponent { this.getListTypeFilter(); this.transactionTypeKeyWord = ''; if (isResetFilter) { + this.transactionFilter.type = []; this.listTypeSelected = ''; } } @@ -437,8 +438,10 @@ export class AccountTransactionTableComponent { } } - setDateRange() { - this.maxDate = this.datePipe.transform(this.transactionFilter?.endDate, DATEFORMAT.DATE_ONLY) || this.maxDate; + setDateRange(isStartDate = false) { + if (isStartDate) { + this.maxDate = this.datePipe.transform(this.transactionFilter?.endDate, DATEFORMAT.DATE_ONLY) || this.maxDate; + } this.minDate = this.datePipe.transform(this.transactionFilter?.startDate, DATEFORMAT.DATE_ONLY) || this.minDate; } } diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss index cc8a2f317..bb6eda62d 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss @@ -2,10 +2,13 @@ width: 420px; } ::ng-deep .mat-menu-panel.tnx-type-panel { - width: 388px; + width: 355px; max-width: unset; @media (max-width: 414px) { - transform: translateX(16px); + width: 310px; + } + @media (max-width: 376px) { + width: 275px; } } ::ng-deep .mat-menu-panel.tsx-filter-panel { @@ -32,11 +35,11 @@ text-overflow: unset; } } - @media (min-width: 991.98px) { - .aura-form { + .aura-form { + padding: 16px; + @media (min-width: 991.98px) { width: 388px; - min-height: 295px; - padding: 16px; + min-height: 300px; } } } diff --git a/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts b/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts index 5adf639b5..56858d83f 100644 --- a/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts +++ b/src/app/pages/token/token-detail/token-content/token-content-tab/token-transfers-tab/token-transfers-tab.component.ts @@ -152,7 +152,7 @@ export class TokenTransfersTabComponent implements OnInit, AfterViewInit { if (res) { this.nextKey = null; if (res.transaction.length >= 100) { - this.nextKey = res?.transaction[res.transaction.length - 1].height; + this.nextKey = res?.transaction[res.transaction.length - 1]?.height; this.hasMore.emit(true); } else { this.hasMore.emit(false); @@ -163,7 +163,7 @@ export class TokenTransfersTabComponent implements OnInit, AfterViewInit { txs.forEach((element, index) => { element['from_address'] = element.fromAddress; element['to_address'] = element.toAddress; - element['token_id'] = element.tokenId; + element['token_id'] = element.arrEvent?.length > 1 ? 'More' : element.tokenId; element['type'] = res.transaction[index]?.events[0]?.smart_contract_events[0]?.cw721_activity?.action; if (this.typeContract === this.contractType.CW4973) { if (element['type'] === 'mint') { From d3e2fbd5b9146184eea3f8a3144800b2b502f153 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Mon, 11 Sep 2023 11:47:52 +0700 Subject: [PATCH 074/142] fix bug UI (account-transaction / filter panel) --- .../account-transaction-table.component.html | 1 + .../account-transaction-table.component.ts | 11 ++++++++++- .../token-table/token-table.component.html | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 1b05fb30f..6bd32e268 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -176,6 +176,7 @@

    Filter

    type="checkbox" id="all" (change)="onChangeTnxFilterType($event, 'all')" + [checked]="listTypeSelected.length > 0" class="check-box check-box--dark" />
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 9823da531..323fac026 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -1,6 +1,6 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { DatePipe } from '@angular/common'; -import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; +import {Component, EventEmitter, HostListener, Input, Output, ViewChild} from '@angular/core'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute } from '@angular/router'; @@ -15,6 +15,8 @@ import { CommonService } from 'src/app/core/services/common.service'; import { UserService } from 'src/app/core/services/user.service'; import { Globals, convertDataAccountTransaction } from 'src/app/global/global'; import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; +import {MatSelect} from "@angular/material/select"; +import {MatMenu, MatMenuTrigger} from "@angular/material/menu"; @Component({ selector: 'app-account-transaction-table', @@ -31,6 +33,13 @@ export class AccountTransactionTableComponent { @Output() filterCondition = new EventEmitter(); @Output() tabName = new EventEmitter(); + @ViewChild(MatMenuTrigger) trigger: MatMenuTrigger; + + @HostListener('window:scroll', ['$event']) + closeFilterPanelSection(_) { + this.trigger.closeMenu(); + } + transactionLoading = false; currentAddress: string; templates: Array; diff --git a/src/app/pages/account/account-detail/token-table/token-table.component.html b/src/app/pages/account/account-detail/token-table/token-table.component.html index e0d87f793..16cf5267e 100644 --- a/src/app/pages/account/account-detail/token-table/token-table.component.html +++ b/src/app/pages/account/account-detail/token-table/token-table.component.html @@ -3,7 +3,7 @@
    -

    Coins & Tokens ({{ pageData?.length || 0 }})

    +

    Coins & Tokens ({{ pageData?.length || 0 }})

    Date: Mon, 11 Sep 2023 11:48:55 +0700 Subject: [PATCH 075/142] Merge branch 'develop' into feature/update-account-detail_backup # Conflicts: # src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss --- .../account-transaction-table.component.scss | 3 ++- .../account-transaction/account-transaction.component.scss | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index b8086ee12..f4401b170 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -23,6 +23,7 @@ height: 40px; } } + padding: 16px; @media (max-width: 376px) { width: calc(100vw - 68px); } @@ -38,7 +39,7 @@ max-height: 280px; } @media (max-width: 414px) { - max-height: 180px; + max-height: 210px; } ::ng-deep { .form-group label { diff --git a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss index aeb66b276..196629326 100644 --- a/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss +++ b/src/app/pages/account/account-detail/account-transaction/account-transaction.component.scss @@ -2,7 +2,7 @@ width: 420px; } ::ng-deep .mat-menu-panel.tnx-type-panel { - width: 385px; + width: 355px; max-width: unset; @media (max-width: 414px) { width: 310px; @@ -12,6 +12,7 @@ } } ::ng-deep .mat-menu-panel.tsx-filter-panel { + padding: 0; max-width: unset; border-radius: var(--spacer-2); .mat-menu-content { @@ -35,7 +36,6 @@ } } @media (min-width: 991.98px) { - padding: 16px; .aura-form { width: 388px; min-height: 300px; From db727de95b4273543d2870bb2a90633263aa67c6 Mon Sep 17 00:00:00 2001 From: mtam Date: Mon, 11 Sep 2023 11:52:52 +0700 Subject: [PATCH 076/142] [TamTM6] fix check all --- .../account-transaction-table.component.html | 2 +- .../account-transaction-table.component.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 6bd32e268..e917ad89f 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -176,7 +176,7 @@

    Filter

    type="checkbox" id="all" (change)="onChangeTnxFilterType($event, 'all')" - [checked]="listTypeSelected.length > 0" + [checked]="checkAll" class="check-box check-box--dark" />
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 323fac026..5200e6172 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -72,6 +72,7 @@ export class AccountTransactionTableComponent { }; nextKey = null; currentKey = null; + checkAll = false; dataSource: MatTableDataSource = new MatTableDataSource([]); dataSourceMobile: any[]; @@ -142,6 +143,7 @@ export class AccountTransactionTableComponent { } else { this.transactionTypeKeyWord = ''; this.listTypeSelected = ''; + this.checkAll = false; this.transactionFilter = { startDate: null, endDate: null, @@ -156,6 +158,7 @@ export class AccountTransactionTableComponent { onChangeTnxFilterType(event, type: any) { if (event.target.checked) { if (type === 'all') { + this.checkAll = true; this.transactionFilter.type = null; this.listTypeSelected = 'All'; } else { @@ -174,6 +177,7 @@ export class AccountTransactionTableComponent { if (type === 'all') { this.transactionFilter.type = []; this.listTypeSelected = ''; + this.checkAll = false; } else { this.transactionFilter.type.forEach((element, index) => { if (element === type.label) { From 73fda2582209c68c02a2c843bbaf13e83433c0de Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Mon, 11 Sep 2023 14:19:40 +0700 Subject: [PATCH 077/142] fix bug UI: - tooltip position - account detail (close nft list dropdown panel when window scroll ) --- .../account-detail/nft-list/nft-list.component.html | 1 + .../account-detail/nft-list/nft-list.component.ts | 11 ++++++++++- .../components/name-tag/name-tag.component.html | 6 +++--- .../shared/components/name-tag/name-tag.component.ts | 7 +++++-- .../tooltip-customize.component.html | 2 +- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/app/pages/account/account-detail/nft-list/nft-list.component.html b/src/app/pages/account/account-detail/nft-list/nft-list.component.html index 052832d88..58d9838ce 100644 --- a/src/app/pages/account/account-detail/nft-list/nft-list.component.html +++ b/src/app/pages/account/account-detail/nft-list/nft-list.component.html @@ -8,6 +8,7 @@

    NFTs ({{ listCollection[
    Collections
    @@ -31,7 +31,7 @@
    @@ -72,7 +72,7 @@ diff --git a/src/app/shared/components/name-tag/name-tag.component.ts b/src/app/shared/components/name-tag/name-tag.component.ts index bac362ac5..bd7932d19 100644 --- a/src/app/shared/components/name-tag/name-tag.component.ts +++ b/src/app/shared/components/name-tag/name-tag.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import {ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'; import { Router } from '@angular/router'; import { LENGTH_CHARACTER } from 'src/app/core/constants/common.constant'; import { CommonService } from 'src/app/core/services/common.service'; @@ -10,7 +10,7 @@ import { Globals } from 'src/app/global/global'; styleUrls: ['./name-tag.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class NameTagComponent implements OnInit { +export class NameTagComponent implements OnInit, OnChanges { @Input() value = ''; @Input() url = 'account'; @Input() fullText = false; @@ -50,4 +50,7 @@ export class NameTagComponent implements OnInit { url = url.match(/^https?:/) ? url : '//' + url; return url; } + + ngOnChanges(changes: SimpleChanges): void { + } } diff --git a/src/app/shared/components/tooltip-customize/tooltip-customize.component.html b/src/app/shared/components/tooltip-customize/tooltip-customize.component.html index 19a2963eb..196740506 100644 --- a/src/app/shared/components/tooltip-customize/tooltip-customize.component.html +++ b/src/app/shared/components/tooltip-customize/tooltip-customize.component.html @@ -1 +1 @@ -
    +
    From 507e98399768176754d2a985972fe9a5d07b72bb Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 12 Sep 2023 08:41:50 +0700 Subject: [PATCH 078/142] [TamTM6] fix date filter, change name tab coin transfer --- src/app/core/constants/account.enum.ts | 4 ++-- src/app/core/pipes/common.pipe.ts | 2 +- .../account-transaction-table.component.html | 7 ++++--- .../account-transaction-table.component.ts | 16 +++++++++------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/app/core/constants/account.enum.ts b/src/app/core/constants/account.enum.ts index c21382400..4dbae5c69 100644 --- a/src/app/core/constants/account.enum.ts +++ b/src/app/core/constants/account.enum.ts @@ -47,14 +47,14 @@ export enum WalletAcount { export enum TabsAccount { ExecutedTxs = 'EXECUTED', - AuraTxs = 'AURA TRANSFER', + AuraTxs = 'COIN TRANSFER', FtsTxs = 'TOKEN TRANSFER', NftTxs = 'NFT TRANSFER', } export enum TabsAccountLink { ExecutedTxs = 'execute', - AuraTxs = 'aura-transfer', + AuraTxs = 'coin-transfer', FtsTxs = 'token-transfer', NftTxs = 'nft-transfer', } diff --git a/src/app/core/pipes/common.pipe.ts b/src/app/core/pipes/common.pipe.ts index 2378a461a..dc1d92a27 100644 --- a/src/app/core/pipes/common.pipe.ts +++ b/src/app/core/pipes/common.pipe.ts @@ -135,7 +135,7 @@ export class displayTypeToolTip implements PipeTransform { } } }); - if (value?.length > 4) { + if (value?.length > 5) { result += ', ...'; } return result; diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index e917ad89f..1f9e78e6b 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -81,10 +81,11 @@

    Filter

    readOnly #start_date [matDatepicker]="pickerStart" + [min]="minDate" [max]="maxDate" [style]="'max-width: 70%'" [(ngModel)]="transactionFilter.startDate" - (ngModelChange)="setDateRange(true)" + (ngModelChange)="setDateRange()" class="cursor-pointer" placeholder="Select" />
    @@ -101,8 +102,8 @@

    Filter

    readOnly #end_date [matDatepicker]="pickerEnd" - [min]="minDate" - [max]="maxDate" + [min]="minDateEnd" + [max]="maxDateEnd" [style]="'max-width: 70%'" [(ngModel)]="transactionFilter.endDate" (ngModelChange)="setDateRange()" diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 5200e6172..b3e2b3f7c 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -87,6 +87,8 @@ export class AccountTransactionTableComponent { isSearch = false; minDate; maxDate; + minDateEnd; + maxDateEnd; linkToken = 'token-nft'; typeTx = [AccountTxType.Sent, AccountTxType.Received]; @@ -150,8 +152,8 @@ export class AccountTransactionTableComponent { type: [], typeTransfer: null, }; - this.minDate = new Date(2023, 2, 20); - this.maxDate = new Date().toISOString().slice(0, 10); + this.minDate = this.minDateEnd = new Date(2023, 2, 20); + this.maxDateEnd = this.maxDate = new Date().toISOString().slice(0, 10); } } @@ -451,10 +453,10 @@ export class AccountTransactionTableComponent { } } - setDateRange(isStartDate = false) { - if (isStartDate) { - this.maxDate = this.datePipe.transform(this.transactionFilter?.endDate, DATEFORMAT.DATE_ONLY) || this.maxDate; - } - this.minDate = this.datePipe.transform(this.transactionFilter?.startDate, DATEFORMAT.DATE_ONLY) || this.minDate; + setDateRange() { + this.maxDateEnd = new Date().toISOString().slice(0, 10); + this.minDate = new Date(2023, 2, 20); + this.maxDate = this.datePipe.transform(this.transactionFilter?.endDate, DATEFORMAT.DATE_ONLY) || this.maxDate; + this.minDateEnd = this.datePipe.transform(this.transactionFilter?.startDate, DATEFORMAT.DATE_ONLY) || this.minDate; } } From fc1f320d634863acdbcdb7f1a450833a3126dcd0 Mon Sep 17 00:00:00 2001 From: mtam Date: Tue, 12 Sep 2023 09:04:30 +0700 Subject: [PATCH 079/142] [TamTM6] fix tooltip --- .../account-transaction-table.component.ts | 5 ++--- .../soulbound-feature-tokens.component.html | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index b3e2b3f7c..07431ee29 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -1,6 +1,7 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { DatePipe } from '@angular/common'; -import {Component, EventEmitter, HostListener, Input, Output, ViewChild} from '@angular/core'; +import { Component, EventEmitter, HostListener, Input, Output, ViewChild } from '@angular/core'; +import { MatMenuTrigger } from "@angular/material/menu"; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute } from '@angular/router'; @@ -15,8 +16,6 @@ import { CommonService } from 'src/app/core/services/common.service'; import { UserService } from 'src/app/core/services/user.service'; import { Globals, convertDataAccountTransaction } from 'src/app/global/global'; import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; -import {MatSelect} from "@angular/material/select"; -import {MatMenu, MatMenuTrigger} from "@angular/material/menu"; @Component({ selector: 'app-account-transaction-table', diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html index 7b4172e80..8cbe2a4d9 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html @@ -14,7 +14,7 @@

    ABTs ({{ totalABT || 0 }})

    {{ soulboundUnclaimedNum > 99 ? '99+' : soulboundUnclaimedNum }} From f73478e82720f4a3d6c82154278c20126832d5cf Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Tue, 12 Sep 2023 09:16:57 +0700 Subject: [PATCH 080/142] fix bug UI: - tooltip position --- src/app/shared/components/name-tag/name-tag.component.html | 6 +++--- .../soulbound-feature-tokens.component.html | 3 ++- .../tooltip-customize/tooltip-customize.component.ts | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/shared/components/name-tag/name-tag.component.html b/src/app/shared/components/name-tag/name-tag.component.html index 20882e76e..64f70f78c 100644 --- a/src/app/shared/components/name-tag/name-tag.component.html +++ b/src/app/shared/components/name-tag/name-tag.component.html @@ -12,7 +12,7 @@ @@ -31,7 +31,7 @@ @@ -72,7 +72,7 @@ diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html index 7b4172e80..7f7572f23 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html @@ -14,7 +14,8 @@

    ABTs ({{ totalABT || 0 }})

    {{ soulboundUnclaimedNum > 99 ? '99+' : soulboundUnclaimedNum }} diff --git a/src/app/shared/components/tooltip-customize/tooltip-customize.component.ts b/src/app/shared/components/tooltip-customize/tooltip-customize.component.ts index 2148f7110..f4451be61 100644 --- a/src/app/shared/components/tooltip-customize/tooltip-customize.component.ts +++ b/src/app/shared/components/tooltip-customize/tooltip-customize.component.ts @@ -8,12 +8,14 @@ import {AfterViewInit, Component, ElementRef, Input, OnInit, Renderer2} from '@a export class TooltipCustomizeComponent implements OnInit, AfterViewInit { @Input() content: string; @Input() class: string; + @Input() requestGetPosition: boolean = true; constructor(private renderer: Renderer2, private el: ElementRef) { } ngOnInit(): void {} ngAfterViewInit(): void { + if(!this.requestGetPosition) return; let parent = this.renderer.parentNode(this.el.nativeElement); if(!parent) return; let sibling = parent.querySelector('.aura-tooltip-object:not(.disabled-hover)'); From f2ff2fb98a616d43d9980816c8072e4c9e81af71 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Tue, 12 Sep 2023 09:29:30 +0700 Subject: [PATCH 081/142] fix bug UI: - tooltip position --- .../pages/account/account-detail/account-detail.component.html | 3 +++ .../soulbound-account-token-list.component.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 9979a6799..b07a6938f 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -55,6 +55,9 @@

    Account Info

    class="ph-arrow-square-out-fill body-01 h4-mob ml-1 cursor-pointer">
    + +

    diff --git a/src/app/pages/token/nft-detail/nft-detail.component.html b/src/app/pages/token/nft-detail/nft-detail.component.html index e6bf24c6a..b942ad904 100644 --- a/src/app/pages/token/nft-detail/nft-detail.component.html +++ b/src/app/pages/token/nft-detail/nft-detail.component.html @@ -379,11 +379,11 @@

    Item Activity

    {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} - + Item Activity {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} - + {{ data[template.matColumnDef] | cutStringPipe : 8 : 8 }} + *ngIf="data[template.matColumnDef]?.startsWith('Null')"> -
    @@ -171,7 +171,7 @@ data['status'] === 'Fail' || data['token_id'] === 'More' || data.modeExecute === modeExecuteTransaction.UnEquip || - data['to_address']?.startsWith('0000') + data['to_address']?.startsWith('Null') " [routerLink]="['/tokens/' + linkToken, contractAddress, data.token_id]"> View NFT diff --git a/src/app/pages/transaction/transaction.component.html b/src/app/pages/transaction/transaction.component.html index ddce7115d..ced817485 100644 --- a/src/app/pages/transaction/transaction.component.html +++ b/src/app/pages/transaction/transaction.component.html @@ -33,8 +33,18 @@ {{ data[template.matColumnDef] }}
    -
    - {{ data[template.matColumnDef] | cutStringPipe : 25 }} +
    +
    + {{ data[template.matColumnDef] | stringEllipsis : 25 }} +
    + +{{ data.lstType?.length - 1 }} +
    +
    + + +
    diff --git a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html index 08f06114d..9a5966501 100644 --- a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html +++ b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.html @@ -67,23 +67,23 @@
    - + {{ item['address'] === item['toAddress'] ? 'To:' : 'From:' }} {{ item['address'] | cutStringPipe : 6 : 6 }} - + {{ (item['address'] | cutStringPipe : 6 : 6) || '-' }} @@ -112,7 +112,9 @@
    - {{ item.denom || denom }} + {{ + item.denom || denom | stringEllipsis : 19 + }} {{ item.denom | stringEllipsis : 19 }} diff --git a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss index 94539308c..53dadd1f1 100644 --- a/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss +++ b/src/app/shared/components/cards/card-mob-account/card-mob-account.component.scss @@ -40,11 +40,15 @@ margin-bottom: var(--spacer-4); } } - .txt-top-expand{ + .txt-top-expand { height: 26px; display: flex; align-items: center; } + .txt-from-to { + width: 40px; + margin-top: 1px; + } } } @@ -56,4 +60,4 @@ @media (min-width: 376px) { max-width: 110px; } -} \ No newline at end of file +} diff --git a/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.html b/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.html index 4660d4276..1de0327ce 100644 --- a/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.html +++ b/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.html @@ -13,6 +13,9 @@
    {{ title.subLabelContent }} +
    + +{{ dataCard?.lstType?.length - 1 }} +
    diff --git a/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.ts b/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.ts index 5ded10fa6..5ee3e6f28 100644 --- a/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.ts +++ b/src/app/shared/components/cards/card-mob-simple/card-mob-simple.component.ts @@ -50,6 +50,7 @@ export class CardMobSimpleComponent implements OnInit { @Input() content: CardMobSimpleContent[]; @Input() tokenData: CardMobSimpleToken; @Input() tokenAmount: CardMobSimpleAmount; + @Input() dataCard: any; statusTransaction = CodeTransaction; From 6f9fdf60dc085d57be8d01f21bf923742338d7e6 Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 13 Sep 2023 10:08:53 +0700 Subject: [PATCH 085/142] [TamTM6] set display tooltip --- src/app/core/pipes/common.pipe.ts | 18 +++++++++++++++++- .../account-transaction-table.component.html | 6 +++--- .../contract-info-card.component.html | 4 +--- .../name-tag/name-tag.component.html | 6 ++---- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/app/core/pipes/common.pipe.ts b/src/app/core/pipes/common.pipe.ts index 48de711d6..da3d1bbc9 100644 --- a/src/app/core/pipes/common.pipe.ts +++ b/src/app/core/pipes/common.pipe.ts @@ -7,6 +7,7 @@ import { balanceOf } from '../utils/common/parsing'; import { MaskPipe } from 'ngx-mask'; import * as _ from 'lodash'; import { TYPE_TRANSACTION } from '../constants/transaction.constant'; +import { TRANSACTION_TYPE_ENUM } from '../constants/transaction.enum'; @Pipe({ name: 'calDate' }) export class pipeCalDate implements PipeTransform { @@ -130,7 +131,22 @@ export class displayTypeToolTip implements PipeTransform { let result = ''; value.forEach((element, index) => { const typeMsg = element.type || element['@type']; - let type = _.find(TYPE_TRANSACTION, { label: typeMsg })?.value || typeMsg.split('.').pop(); + let type; + if (typeMsg === TRANSACTION_TYPE_ENUM.ExecuteContract) { + try { + let dataTemp = _.get(element, 'content.msg') || _.get(element, 'msg'); + if (typeof dataTemp === 'string') { + try { + dataTemp = JSON.parse(dataTemp); + } catch (e) {} + } + let action = Object.keys(dataTemp)[0]; + type = 'Contract: ' + action; + } catch (e) {} + } else { + type = _.find(TYPE_TRANSACTION, { label: typeMsg })?.value || typeMsg.split('.').pop(); + } + if (index <= 4) { if (result?.length > 0) { result += ', ' + type; diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 0af4365f2..ff11cf271 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -60,13 +60,13 @@

    Filter

    diff --git a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html index dd8e29c02..9a3e2c4db 100644 --- a/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html +++ b/src/app/pages/contracts/contracts-detail/contract-info-card/contract-info-card.component.html @@ -25,9 +25,7 @@ target="_blank" [href]="extendLink(commonService.findUrlNameTag(contractDetail?.address))" *ngIf="commonService.findUrlNameTag(contractDetail?.address)"> - +
    diff --git a/src/app/shared/components/name-tag/name-tag.component.html b/src/app/shared/components/name-tag/name-tag.component.html index 64f70f78c..ec799b3c8 100644 --- a/src/app/shared/components/name-tag/name-tag.component.html +++ b/src/app/shared/components/name-tag/name-tag.component.html @@ -65,9 +65,7 @@ - + @@ -117,7 +115,7 @@ - + From c0320473bd895359a418e21be511a9b2f7970722 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Wed, 13 Sep 2023 10:55:36 +0700 Subject: [PATCH 086/142] fix bug UI: - ABTs card -> fix size - Coins & Tokens table -> fix contract name column size --- .../token-table/token-table.component.scss | 6 ++--- .../soulbound-feature-tokens.component.html | 24 ++++++++++--------- .../soulbound-feature-tokens.component.scss | 6 ++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/app/pages/account/account-detail/token-table/token-table.component.scss b/src/app/pages/account/account-detail/token-table/token-table.component.scss index 2163e2545..d21d44067 100644 --- a/src/app/pages/account/account-detail/token-table/token-table.component.scss +++ b/src/app/pages/account/account-detail/token-table/token-table.component.scss @@ -44,11 +44,9 @@ } @media (max-width: 991.99px) { - .aura-table.coin-table td.mat-cell:nth-child(1){ - min-width: 200px; - } + .aura-table.coin-table td.mat-cell:nth-child(1), .aura-table.coin-table td.mat-cell:nth-child(2) { - min-width: 180px; + min-width: 200px; } .aura-table.coin-table td.mat-cell:nth-child(3), .aura-table.coin-table td.mat-cell:nth-child(4), diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html index 7f7572f23..2eb539053 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html @@ -24,21 +24,23 @@

    ABTs ({{ totalABT || 0 }})

    - -
    -
    -
    - -
    - CW-4973 +
    +
    +
    +
    +
    + +
    + CW-4973 +
    - +
    diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss index b924f2aa8..f0b58ebc6 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss @@ -8,8 +8,8 @@ } .soulbound-list { width: 100%; - display: flex; - align-items: center; + //display: flex; + //align-items: center; // gap: 20px; flex-grow: 1; overflow-x: scroll; @@ -99,4 +99,4 @@ min-height: auto; padding: 0; align-items: flex-start; -} \ No newline at end of file +} From fe21a7ffaedff41f9856b4e487405297b1d3e45b Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 13 Sep 2023 13:57:10 +0700 Subject: [PATCH 087/142] [TamTM6] css abt --- .../soulbound-feature-tokens.component.html | 10 +++++----- .../soulbound-feature-tokens.component.scss | 10 +--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html index 2eb539053..26f6c197d 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.html @@ -22,17 +22,17 @@

    ABTs ({{ totalABT || 0 }})

    -
    +
    -
    +
    + [nftLink]="'/tokens/token-nft/' + token.contract_address + '/' + encodeData(token.token_id)" + [nftItem]="token" + [nftType]="getTypeFile(token)">
    CW-4973
    diff --git a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss index f0b58ebc6..e430f0146 100644 --- a/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss +++ b/src/app/shared/components/soulbound-feature-tokens/soulbound-feature-tokens.component.scss @@ -8,9 +8,6 @@ } .soulbound-list { width: 100%; - //display: flex; - //align-items: center; - // gap: 20px; flex-grow: 1; overflow-x: scroll; &::-webkit-scrollbar { @@ -18,13 +15,11 @@ } .soulbound__item { flex-basis: 50%; - min-width: 180px; box-sizing: border-box; .nft-card { min-height: 120px; max-width: 90px; } - // padding: var(--spacer-2); @media (min-width: 413.98px) { .nft-card { max-width: 100px; @@ -33,16 +28,13 @@ @media (min-width: 912px) { flex-wrap: wrap; flex-basis: 20%; - // padding: var(--spacer-2) var(--spacer-3); + min-width: 180px; } &:not(:last-child) { margin-right: var(--spacer-2); @media (min-width: 912px) { margin-right: var(--spacer-6); } - // @media (min-width: 1600px) { - // margin-right: var(--spacer-2); - // } } &:hover { background: rgba(54, 56, 67, 0.5); From 9abb7848b1c58b57372c50cb236a6bb67722deae Mon Sep 17 00:00:00 2001 From: mtam Date: Wed, 13 Sep 2023 14:24:59 +0700 Subject: [PATCH 088/142] [TamTM6] css tooltip, name tag --- src/app/core/utils/common/validation.ts | 8 ++++---- .../account/account-detail/account-detail.component.html | 2 +- .../account/account-detail/account-detail.component.scss | 7 +++++++ .../tooltip-customize/tooltip-customize.component.html | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/app/core/utils/common/validation.ts b/src/app/core/utils/common/validation.ts index b989b0c52..d4ddb23c5 100644 --- a/src/app/core/utils/common/validation.ts +++ b/src/app/core/utils/common/validation.ts @@ -1,12 +1,12 @@ +import { LENGTH_CHARACTER } from "../../constants/common.constant"; + const REGEX = { CONTRACT_ADDRESS: /aura([\w\d]+)/, }; export function isContract(adr: string): boolean { - if (adr) { - const regex = new RegExp(REGEX.CONTRACT_ADDRESS); - - return regex.test(adr); + if (adr?.startsWith('aura') && adr?.length === LENGTH_CHARACTER.CONTRACT) { + return true; } return false; } diff --git a/src/app/pages/account/account-detail/account-detail.component.html b/src/app/pages/account/account-detail/account-detail.component.html index 3743f84f8..718391474 100644 --- a/src/app/pages/account/account-detail/account-detail.component.html +++ b/src/app/pages/account/account-detail/account-detail.component.html @@ -30,7 +30,7 @@
    -
    diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss index 27e2f5b56..d25b9df2c 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.scss @@ -23,10 +23,28 @@ height: 40px; } } + .input-group { + background-color: transparent; + border: 1px solid var(--aura-gray-8) !important; + padding: 8px 16px; + border-radius: 8px; + } padding: 16px; @media (max-width: 376px) { width: calc(100vw - 68px); } + .filter-result { + padding: var(--spacer-2) var(--spacer-4); + color: var(--aura-blue-3link); + border: 1px solid var(--aura-blue-4); + background: #222f3d; + border-radius: 8px; + display: flex; + align-items: center; + } + .mat-date-range-input { + width: 80%; + } } .tnx-filter-item { height: 44px; @@ -203,3 +221,11 @@ background-color: var(--aura-gray-9); margin: 0 -4px -12px -4px; } + +::ng-deep { + .mat-datepicker-content .mat-calendar { + background: #24262e; + border: 1px solid #717582; + border-radius: 8px; + } +} diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts index 41e12fff7..a420771df 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.ts @@ -1,7 +1,6 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { DatePipe } from '@angular/common'; -import { Component, EventEmitter, HostListener, Input, Output, ViewChild } from '@angular/core'; -import { MatMenuTrigger } from "@angular/material/menu"; +import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute } from '@angular/router'; @@ -16,7 +15,6 @@ import { CommonService } from 'src/app/core/services/common.service'; import { UserService } from 'src/app/core/services/user.service'; import { Globals, convertDataAccountTransaction } from 'src/app/global/global'; import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component'; -import {logs} from "@cosmjs/stargate"; @Component({ selector: 'app-account-transaction-table', @@ -38,6 +36,7 @@ export class AccountTransactionTableComponent { templates: Array; tabsData = TabsAccountLink; lengthAddress = LENGTH_CHARACTER.ADDRESS; + displayFilter = true; templatesExecute: Array = [ { matColumnDef: 'tx_hash', headerCellDef: 'Tx Hash', headerWidth: 18 }, @@ -74,9 +73,7 @@ export class AccountTransactionTableComponent { transactionTypeKeyWord = ''; tnxType = []; tnxTypeOrigin = []; - listTypeSelected = ''; listTypeSelectedTemp = []; - listTypeSelectedTnx = []; arrTypeFilter = []; currentType = AccountTxType.Sent; accountTxType = AccountTxType; @@ -87,6 +84,12 @@ export class AccountTransactionTableComponent { maxDateEnd; linkToken = 'token-nft'; typeTx = [AccountTxType.Sent, AccountTxType.Received]; + listTypeDefine = []; + modeFilter = { + date: 'date', + type: 'type', + msgType: 'msgType', + }; breakpoint$ = this.layout.observe([Breakpoints.Small, Breakpoints.XSmall]); denom = this.environmentService.configValue.chain_info.currencies[0].coinDenom; @@ -129,25 +132,17 @@ export class AccountTransactionTableComponent { initTnxFilter(isReset = false) { if (this.savedFilter !== null && this.savedTab === this.modeQuery && !isReset) { this.transactionFilter = this.savedFilter; - this.transactionFilter.type.forEach((element, index) => { + this.transactionFilter.type?.forEach((element, index) => { let type = _.find(TYPE_TRANSACTION, { label: element })?.value; - // if (!this.listTypeSelectedTemp) { - // this.listTypeSelectedTemp = type; - // } else { - // this.listTypeSelectedTemp += ', ' + type; - // } - // this.listTypeSelected = this.listTypeSelectedTemp; }); - this.setDateRange(); } else { this.transactionTypeKeyWord = ''; this.listTypeSelectedTemp = []; - this.listTypeSelected = ''; this.checkAll = false; this.transactionFilter = { startDate: null, endDate: null, - type: [], + type: null, typeTransfer: null, }; this.minDate = this.minDateEnd = new Date(2023, 2, 20); @@ -156,34 +151,32 @@ export class AccountTransactionTableComponent { } onChangeTnxFilterType(event, type: any) { - if(type === 'all') { - if(event.target.checked) { + if (type === 'all') { + if (event.target.checked) { this.checkAll = true; - this.transactionFilter.type = null; this.listTypeSelectedTemp = this.tnxType; } else { - this.transactionFilter.type = []; this.listTypeSelectedTemp = []; this.checkAll = false; } } else { - if(event.target.checked) { + this.checkAll = false; + if (event.target.checked) { this.arrTypeFilter.push(type.label); - this.transactionFilter.type.push(type.label); - this.listTypeSelectedTemp.push(type); + this.listTypeSelectedTemp?.push(type); } else { - this.listTypeSelectedTemp.forEach((element,index)=>{ - if(element.label === type.label) this.listTypeSelectedTemp.splice(index,1); + this.listTypeSelectedTemp?.forEach((element, index) => { + if (element.label === type.label) this.listTypeSelectedTemp?.splice(index, 1); }); } } } searchTransactionType() { - if(this.transactionTypeKeyWord.toLowerCase().length === 0 || this.transactionTypeKeyWord.toLowerCase() === '') { + if (this.transactionTypeKeyWord.toLowerCase().length === 0 || this.transactionTypeKeyWord.toLowerCase() === '') { this.clearFilterSearch(); } else { - this.tnxType = this.tnxType.filter( + this.tnxType = this.tnxType?.filter( (k) => k.value.toLowerCase().indexOf(this.transactionTypeKeyWord.toLowerCase().trim()) > -1, ); } @@ -197,6 +190,7 @@ export class AccountTransactionTableComponent { if (document.getElementById('typeActionBtn')?.classList.contains('show')) { document.getElementById('typeActionBtn')?.classList.remove('show'); } + this.searchType(); } clearFilterSearch(isResetFilter = true) { @@ -246,15 +240,11 @@ export class AccountTransactionTableComponent { address: address, heightLT: nextKey, compositeKey: null, - listTxMsgType: null, + listTxMsgType: this.transactionFilter.type || null, startTime: this.getConvertDate(this.transactionFilter.startDate) || null, endTime: this.getConvertDate(this.transactionFilter.endDate, true) || null, }; - if (this.transactionFilter?.type?.length > 0) { - payload.listTxMsgType = this.transactionFilter?.type; - } - switch (this.modeQuery) { case TabsAccountLink.ExecutedTxs: payload.compositeKey = 'message.sender'; @@ -322,6 +312,8 @@ export class AccountTransactionTableComponent { return obj; }); this.tnxType = this.tnxType?.filter((k) => k.value); + this.listTypeDefine = [...this.tnxType]; + // this.tnxType.push({ label: 'Others', value: 'Others' }); this.tnxTypeOrigin = [...this.tnxType]; }); } @@ -395,7 +387,14 @@ export class AccountTransactionTableComponent { } const coinConfig = this.environmentService.configValue.coins; - let txs = convertDataAccountTransaction(data, this.coinInfo, this.modeQuery, setReceive, this.currentAddress, coinConfig); + let txs = convertDataAccountTransaction( + data, + this.coinInfo, + this.modeQuery, + setReceive, + this.currentAddress, + coinConfig, + ); if (this.dataSource.data.length > 0) { this.dataSource.data = [...this.dataSource.data, ...txs]; } else { @@ -447,38 +446,18 @@ export class AccountTransactionTableComponent { } } - setDateRange() { - this.maxDateEnd = new Date().toISOString().slice(0, 10); - this.minDate = new Date(2023, 2, 20); - this.maxDate = this.datePipe.transform(this.transactionFilter?.endDate, DATEFORMAT.DATE_ONLY) || this.maxDate; - this.minDateEnd = this.datePipe.transform(this.transactionFilter?.startDate, DATEFORMAT.DATE_ONLY) || this.minDate; - } - executeFilterType() { - this.listTypeSelectedTnx = [...this.listTypeSelectedTemp]; - this.listTypeSelected = ''; - for(let i = 0; i<= this.listTypeSelectedTemp.length; i++) { - this.listTypeSelected += this.listTypeSelectedTemp[i].value + (i < this.listTypeSelectedTemp.length - 1 ? ', ' : ''); - } - } - checkedTnx(type: any){ - // console.log(type) - // console.log(this.listTypeSelectedTnx) - console.log(type.label); - let result = false; - if (this.listTypeSelectedTnx?.length > 0 && - this.listTypeSelectedTnx?.includes(type.label) || - this.transactionFilter.type === null ){ - result = true; + let lstTemp = []; + if (this.listTypeSelectedTemp?.length > 0) { + this.listTypeSelectedTemp?.forEach((element, index) => { + lstTemp.push(element.label); + }); } - return result; - - - // return this.listTypeSelectedTnx.includes(type); + this.transactionFilter.type = lstTemp || null; + this.searchType(); } clearFilterType() { - // this.listTypeSelected = ''; this.transactionFilter.type = null; this.tnxType = this.tnxTypeOrigin; this.savedFilter = null; @@ -489,10 +468,31 @@ export class AccountTransactionTableComponent { this.transactionFilter = { startDate: null, endDate: null, - type: this.listTypeSelected, + type: null, typeTransfer: null, }; - console.log(this.listTypeSelectedTnx) - // console.log(this.transactionFilter.type); + } + + checkedTnx(type: any) { + let result = false; + if (this.listTypeSelectedTemp?.length > 0 && this.listTypeSelectedTemp.find((k) => k.label === type.label)) { + result = true; + } + return result; + } + + clearFilter(mode = this.modeFilter.date) { + if (mode === this.modeFilter.type) { + this.transactionFilter.typeTransfer = null; + } else if (mode === this.modeFilter.msgType) { + this.transactionFilter.type = null; + this.listTypeSelectedTemp = []; + this.checkAll = false; + this.getListTypeFilter(); + } else { + this.transactionFilter.startDate = null; + this.transactionFilter.endDate = null; + } + this.searchType(); } } From 90dcb90aae6bbef6138cc57249f3a1609fba1e79 Mon Sep 17 00:00:00 2001 From: letrieuthien Date: Tue, 19 Sep 2023 12:31:09 +0700 Subject: [PATCH 100/142] update UI --- .../account-transaction-table.component.html | 57 +++++++++++-------- .../account-transaction-table.component.scss | 27 ++++++--- .../account-transaction-table.component.ts | 9 ++- src/assets/scss/aura-theme/calendar.scss | 56 ++++++++++++++++++ src/assets/scss/aura-theme/reboot.scss | 3 + src/styles.scss | 1 + 6 files changed, 120 insertions(+), 33 deletions(-) create mode 100644 src/assets/scss/aura-theme/calendar.scss diff --git a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html index 14ea970ae..fe8ef8ef7 100644 --- a/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html +++ b/src/app/pages/account/account-detail/account-transaction-table/account-transaction-table.component.html @@ -20,31 +20,37 @@
    -
    -
    -