Skip to content

Commit

Permalink
release v1.2.1 (#188)
Browse files Browse the repository at this point in the history
* fix transaction namespace tab (#183)

* Fix view asset crash (#185)

* fix block detail switch network (#184)

* Bump version

* fix transaction data table (#187)

---------

Co-authored-by: Kong Seh Len <[email protected]>
Co-authored-by: Kong <[email protected]>
  • Loading branch information
3 people authored Mar 23, 2023
1 parent 494da96 commit ee2c26c
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 62 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorer-vite",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"scripts": {
"dev": "vite ",
Expand Down
84 changes: 70 additions & 14 deletions src/modules/account/components/TransactionComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,85 +37,85 @@
<div v-else>
<MixedTxnDataTable
:accountAddress="accountAddress"
:transactions="transactions"
:transactions="mixedTransactions"
:pages="pages"
v-if="selectedTxnType == 'all'"
/>
<TransferTxnDataTable
:accountAddress="accountAddress"
:transactions="transactions"
:transactions="transferTransactions"
:pages="pages"
v-else-if="selectedTxnType === TransactionFilterType.TRANSFER"
/>
<AccountTxnDataTable
:transactions="transactions"
:transactions="accountTransactions"
:pages="pages"
v-else-if="selectedTxnType === TransactionFilterType.ACCOUNT"
/>
<AggregateTxnDataTable
:transactions="transactions"
:transactions="aggregateTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.AGGREGATE"
/>
<AliasTxnDataTable
:transactions="transactions"
:transactions="aliasTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.ALIAS"
/>
<AssetTxnDataTable
:transactions="transactions"
:transactions="assetTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.ASSET"
/>
<NamespaceTxnDataTable
:transactions="transactions"
:transactions="namespaceTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.NAMESPACE"
/>
<MetadataTxnDataTable
:transactions="transactions"
:transactions="metadataTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.METADATA"
/>
<ExchangeTxnDataTable
:transactions="transactions"
:transactions="exchangeTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.EXCHANGE"
/>
<LockTxnDataTable
:transactions="transactions"
:transactions="lockTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.LOCK"
/>
<LinkTxnDataTable
:transactions="transactions"
:transactions="linkTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.LINK"
/>
<RestrictionTxnDataTable
:transactions="transactions"
:transactions="restrictionTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.RESTRICTION"
/>
<SecretTxnDataTable
:accountAddress="accountAddress"
:transactions="transactions"
:transactions="secretTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.SECRET"
/>
<ChainTxnDataTable
:accountAddress="accountAddress"
:transactions="transactions"
:transactions="chainTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.CHAIN"
Expand Down Expand Up @@ -367,6 +367,20 @@ const changeSearchTxnType = () => {
};
const transactions = ref<any[]>([]);
const mixedTransactions = ref<any[]>([]);
const transferTransactions = ref<any[]>([]);
const accountTransactions = ref<any[]>([]);
const aggregateTransactions = ref<any[]>([]);
const aliasTransactions = ref<any[]>([]);
const assetTransactions = ref<any[]>([]);
const namespaceTransactions = ref<any[]>([]);
const metadataTransactions = ref<any[]>([]);
const exchangeTransactions = ref<any[]>([]);
const lockTransactions = ref<any[]>([]);
const linkTransactions = ref<any[]>([]);
const restrictionTransactions = ref<any[]>([]);
const secretTransactions = ref<any[]>([]);
const chainTransactions = ref<any[]>([]);
let transactionGroupType = Helper.getTransactionGroupType();
let blockDescOrderSortingField = Helper.createTransactionFieldOrder(
Helper.getTransactionSortField().BLOCK,
Expand Down Expand Up @@ -404,6 +418,48 @@ let loadAccountTransactions = async () => {
transactionSearchResult.transactions
);
transactions.value = formattedTxns;
if(selectedTxnType.value == 'all'){
mixedTransactions.value = formattedTxns;
}
if(selectedTxnType.value == TransactionFilterType.TRANSFER){
transferTransactions.value = formattedTxns;
}
if(selectedTxnType.value == TransactionFilterType.ACCOUNT){
accountTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.AGGREGATE){
aggregateTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.ALIAS){
aliasTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.ASSET){
assetTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.NAMESPACE){
namespaceTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.METADATA){
metadataTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.EXCHANGE){
exchangeTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.LOCK){
lockTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.LINK){
linkTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.RESTRICTION){
restrictionTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.SECRET){
secretTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.CHAIN){
chainTransactions.value = formattedTxns
}
totalPages.value = transactionSearchResult.pagination.totalPages;
} else {
transactions.value = [];
Expand Down
7 changes: 6 additions & 1 deletion src/modules/asset/views/ViewAsset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const networkName = computed(() => {
});
const loadAsset = async () => {
try{
if (!AppState.isReady && !networkName.value) {
setTimeout(loadAsset, 1000);
return;
Expand Down Expand Up @@ -250,12 +251,16 @@ const loadAsset = async () => {
isShowInvalid.value = true;
}
}
}
catch(e){
isShowInvalid.value = true;
console.log(e)
}
};
loadAsset();
emitter.on("CHANGE_NETWORK", (payload: boolean) => {
if (payload) {
assets.value = null;
isShowInvalid.value = false;
loadAsset();
}
Expand Down
87 changes: 71 additions & 16 deletions src/modules/transaction/views/ViewTransactionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,82 +35,82 @@
</div>
<div v-else>
<MixedTxnDataTable
:transactions="transactions"
:transactions="mixedTransactions"
:pages="pages"
v-if="selectedTxnType == 'all'"
/>
<TransferTxnDataTable
:transactions="transactions"
:transactions="transferTransactions"
:pages="pages"
v-else-if="selectedTxnType === TransactionFilterType.TRANSFER"
/>
<AccountTxnDataTable
:transactions="transactions"
:transactions="accountTransactions"
:pages="pages"
v-else-if="selectedTxnType === TransactionFilterType.ACCOUNT"
/>
<AggregateTxnDataTable
:transactions="transactions"
:transactions="aggregateTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.AGGREGATE"
/>
<AliasTxnDataTable
:transactions="transactions"
:transactions="aliasTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.ALIAS"
/>
<AssetTxnDataTable
:transactions="transactions"
:transactions="assetTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.ASSET"
/>
<NamespaceTxnDataTable
:transactions="transactions"
:transactions="namespaceTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.NAMESPACE"
/>
<MetadataTxnDataTable
:transactions="transactions"
:transactions="metadataTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.METADATA"
/>
<ExchangeTxnDataTable
:transactions="transactions"
:transactions="exchangeTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.EXCHANGE"
/>
<LockTxnDataTable
:transactions="transactions"
:transactions="lockTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.LOCK"
/>
<LinkTxnDataTable
:transactions="transactions"
:transactions="linkTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.LINK"
/>
<RestrictionTxnDataTable
:transactions="transactions"
:transactions="restrictionTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.RESTRICTION"
/>
<SecretTxnDataTable
:transactions="transactions"
:transactions="secretTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.SECRET"
/>
<ChainTxnDataTable
:transactions="transactions"
:transactions="chainTransactions"
:pages="pages"
:selectedGroupType="transactionGroupType.CONFIRMED"
v-else-if="selectedTxnType === TransactionFilterType.CHAIN"
Expand Down Expand Up @@ -281,6 +281,20 @@ const changeRows = () => {
loadRecentTransactions();
};
const transactions = ref<any[]>([]);
const mixedTransactions = ref<any[]>([]);
const transferTransactions = ref<any[]>([]);
const accountTransactions = ref<any[]>([]);
const aggregateTransactions = ref<any[]>([]);
const aliasTransactions = ref<any[]>([]);
const assetTransactions = ref<any[]>([]);
const namespaceTransactions = ref<any[]>([]);
const metadataTransactions = ref<any[]>([]);
const exchangeTransactions = ref<any[]>([]);
const lockTransactions = ref<any[]>([]);
const linkTransactions = ref<any[]>([]);
const restrictionTransactions = ref<any[]>([]);
const secretTransactions = ref<any[]>([]);
const chainTransactions = ref<any[]>([]);
const QueryParamsType = ref<number[] | undefined>(undefined);
let transactionGroupType = Helper.getTransactionGroupType();
let blockDescOrderSortingField = Helper.createTransactionFieldOrder(
Expand All @@ -303,8 +317,7 @@ let loadRecentTransactions = async () => {
txnQueryParams.pageNumber = currentPage.value;
if (
selectedTxnType.value == undefined ||
selectedTxnType.value == "all" ||
selectedTxnType.value == TransactionFilterType.ASSET
selectedTxnType.value == "all"
) {
txnQueryParams.embedded = false;
} else {
Expand All @@ -328,6 +341,48 @@ let loadRecentTransactions = async () => {
transactionSearchResult.transactions
);
transactions.value = formattedTxns;
if(selectedTxnType.value == 'all'){
mixedTransactions.value = formattedTxns;
}
if(selectedTxnType.value == TransactionFilterType.TRANSFER){
transferTransactions.value = formattedTxns;
}
if(selectedTxnType.value == TransactionFilterType.ACCOUNT){
accountTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.AGGREGATE){
aggregateTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.ALIAS){
aliasTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.ASSET){
assetTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.NAMESPACE){
namespaceTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.METADATA){
metadataTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.EXCHANGE){
exchangeTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.LOCK){
lockTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.LINK){
linkTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.RESTRICTION){
restrictionTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.SECRET){
secretTransactions.value = formattedTxns
}
if(selectedTxnType.value == TransactionFilterType.CHAIN){
chainTransactions.value = formattedTxns
}
totalPages.value = transactionSearchResult.pagination.totalPages;
} else {
transactions.value = [];
Expand Down
4 changes: 2 additions & 2 deletions src/util/blockUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface BlockObj {
}

export class BlockUtils {
static async getBlockByHeight(blockHeight: number): Promise<BlockObj> {
static async getBlockByHeight(blockHeight: number): Promise<BlockObj | false> {
if (!AppState.chainAPI) {
throw new Error("Service Unavailable");
}
Expand All @@ -33,7 +33,7 @@ export class BlockUtils {
};
return blockInfo;
} catch (error) {
throw error;
return false;
}
}

Expand Down
Loading

0 comments on commit ee2c26c

Please sign in to comment.