Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SW-1265] Make transaction history the active tab on account details screen #2350

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/popup/components/AccountCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ import {
defineComponent,
PropType,
} from 'vue';
import { IAccount } from '@/types';
import { PROTOCOL_AETERNITY } from '@/constants';
import type { IAccount } from '../../types';
import { ROUTE_ACCOUNT_DETAILS } from '../router/routeNames';
import { useBalances } from '../../composables';
import { useBalances } from '@/composables';

import AccountInfo from './AccountInfo.vue';
import BalanceInfo from './BalanceInfo.vue';
Expand All @@ -60,7 +59,6 @@ export default defineComponent({
const numericBalance = computed<number>(() => balance.value.toNumber());

return {
ROUTE_ACCOUNT_DETAILS,
PROTOCOL_AETERNITY,
numericBalance,
};
Expand Down
2 changes: 0 additions & 2 deletions src/popup/components/AccountCardMultisig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { useStore } from 'vuex';
import type { IMultisigAccount } from '@/types';
import { PROTOCOL_AETERNITY } from '@/constants';
import { useMultisigAccounts } from '@/composables';
import { ROUTE_MULTISIG_DETAILS } from '@/popup/router/routeNames';
import { convertMultisigAccountToAccount } from '@/protocols/aeternity/helpers';

import AccountInfo from './AccountInfo.vue';
Expand Down Expand Up @@ -71,7 +70,6 @@ export default defineComponent({

return {
PROTOCOL_AETERNITY,
ROUTE_MULTISIG_DETAILS,
isPendingAccount,
convertMultisigAccountToAccount,
};
Expand Down
18 changes: 9 additions & 9 deletions src/popup/components/AccountDetailsNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
import { computed, defineComponent } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useConnection } from '@/composables';
import {
ROUTE_ACCOUNT_DETAILS,
ROUTE_ACCOUNT_DETAILS_NAMES,
ROUTE_ACCOUNT_DETAILS_NAMES_AUCTIONS,
ROUTE_ACCOUNT_DETAILS_NAMES_CLAIM,
ROUTE_ACCOUNT_DETAILS_TRANSACTIONS,
ROUTE_ACCOUNT_DETAILS_ASSETS,
ROUTE_MULTISIG_DETAILS,
ROUTE_MULTISIG_DETAILS_INFO,
ROUTE_MULTISIG_DETAILS_TRANSACTIONS,
ROUTE_MULTISIG_DETAILS_ASSETS,
} from '../router/routeNames';
import { useConnection } from '../../composables';

import BtnPill from './buttons/BtnPill.vue';
import Tab from './tabs/Tab.vue';
Expand Down Expand Up @@ -69,13 +69,13 @@ export default defineComponent({

const navigationConfigRegular: NavigationElement[] = [
{
text: t('modals.accountDetails.assets'),
text: t('modals.accountDetails.transactions'),
routeName: ROUTE_ACCOUNT_DETAILS,
exact: true,
},
{
text: t('modals.accountDetails.transactions'),
routeName: ROUTE_ACCOUNT_DETAILS_TRANSACTIONS,
text: t('modals.accountDetails.assets'),
routeName: ROUTE_ACCOUNT_DETAILS_ASSETS,
},
{
text: t('modals.accountDetails.names'),
Expand All @@ -100,13 +100,13 @@ export default defineComponent({

const navigationConfigMultisig: NavigationElement[] = [
{
text: t('modals.accountDetails.assets'),
text: t('modals.accountDetails.transactions'),
routeName: ROUTE_MULTISIG_DETAILS,
exact: true,
},
{
text: t('modals.accountDetails.transactions'),
routeName: ROUTE_MULTISIG_DETAILS_TRANSACTIONS,
text: t('modals.accountDetails.assets'),
routeName: ROUTE_MULTISIG_DETAILS_ASSETS,
},
{
text: t('modals.accountDetails.details'),
Expand Down
4 changes: 2 additions & 2 deletions src/popup/components/DashboardHeaderMultisig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { PROTOCOL_AETERNITY } from '@/constants';
import {
useCurrencies,
useMultisigAccounts,
} from '../../composables';
} from '@/composables';
import { ROUTE_MULTISIG_DETAILS } from '../router/routeNames';

import TotalWalletAmount from './TotalWalletAmount.vue';
Expand Down Expand Up @@ -84,11 +84,11 @@ export default defineComponent({
}

return {
ROUTE_MULTISIG_DETAILS,
multisigAccounts,
multisigAccountIdx,
multisigBalancesTotal,
addressList,
ROUTE_MULTISIG_DETAILS,
selectAccount,
};
},
Expand Down
4 changes: 2 additions & 2 deletions src/popup/router/routeNames.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const ROUTE_INDEX = 'index';
export const ROUTE_ACCOUNT = 'account';
export const ROUTE_ACCOUNT_DETAILS = 'account-details';
export const ROUTE_ACCOUNT_DETAILS_TRANSACTIONS = 'account-details-transactions';
export const ROUTE_ACCOUNT_DETAILS_ASSETS = 'account-details-assets';
pstachel marked this conversation as resolved.
Show resolved Hide resolved
export const ROUTE_ACCOUNT_DETAILS_NAMES = 'account-details-names';
export const ROUTE_ACCOUNT_DETAILS_NAMES_AUCTIONS = 'account-details-names-auctions';
export const ROUTE_ACCOUNT_DETAILS_NAMES_CLAIM = 'account-details-names-claim';
Expand All @@ -12,7 +12,7 @@ export const ROUTE_MULTISIG_TX_DETAILS = 'multisig-tx-details';
export const ROUTE_MULTISIG_DETAILS = 'multisig-account-details';
export const ROUTE_MULTISIG_DETAILS_INFO = 'multisig-account-details-info';
export const ROUTE_MULTISIG_DETAILS_PROPOSAL_DETAILS = 'account-details-multisig-proposal-details';
export const ROUTE_MULTISIG_DETAILS_TRANSACTIONS = 'multisig-account-details-transactions';
export const ROUTE_MULTISIG_DETAILS_ASSETS = 'multisig-account-details-assets';
export const ROUTE_TX_DETAILS = 'tx-details';
export const ROUTE_MORE = 'more';
export const ROUTE_NOTIFICATIONS = 'notifications';
Expand Down
38 changes: 19 additions & 19 deletions src/popup/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
ROUTE_INDEX,
ROUTE_ACCOUNT,
ROUTE_ACCOUNT_DETAILS,
ROUTE_ACCOUNT_DETAILS_ASSETS,
ROUTE_ACCOUNT_DETAILS_NAMES_AUCTIONS,
ROUTE_ACCOUNT_DETAILS_TRANSACTIONS,
ROUTE_NOTIFICATIONS,
ROUTE_COIN,
ROUTE_TOKEN,
Expand All @@ -20,7 +20,7 @@ import {
ROUTE_NETWORK_SETTINGS,
ROUTE_MULTISIG_ACCOUNT,
ROUTE_MULTISIG_DETAILS,
ROUTE_MULTISIG_DETAILS_TRANSACTIONS,
ROUTE_MULTISIG_DETAILS_ASSETS,
ROUTE_MULTISIG_TX_DETAILS,
ROUTE_TX_DETAILS,
ROUTE_MULTISIG_DETAILS_PROPOSAL_DETAILS,
Expand Down Expand Up @@ -123,8 +123,8 @@ export const routes: WalletAppRouteConfig[] = [
props: { viewComponentName: PROTOCOL_VIEW_ACCOUNT_DETAILS },
children: [
{
path: '',
name: ROUTE_ACCOUNT_DETAILS,
path: 'assets',
name: ROUTE_ACCOUNT_DETAILS_ASSETS,
component: AccountDetailsTokens,
meta: {
showFilterBar: true,
Expand All @@ -133,8 +133,8 @@ export const routes: WalletAppRouteConfig[] = [
},
},
{
path: 'transactions',
name: ROUTE_ACCOUNT_DETAILS_TRANSACTIONS,
path: '',
name: ROUTE_ACCOUNT_DETAILS,
component: ProtocolSpecificView,
props: { viewComponentName: PROTOCOL_VIEW_ACCOUNT_DETAILS_TRANSACTIONS },
meta: {
Expand Down Expand Up @@ -187,7 +187,7 @@ export const routes: WalletAppRouteConfig[] = [
meta: {
title: 'txDetails',
showHeaderNavigation: true,
backRoute: { name: ROUTE_ACCOUNT_DETAILS_TRANSACTIONS },
backRoute: { name: ROUTE_ACCOUNT_DETAILS },
},
},
{
Expand All @@ -207,8 +207,8 @@ export const routes: WalletAppRouteConfig[] = [
component: AccountDetailsMultisig,
children: [
{
path: '',
name: ROUTE_MULTISIG_DETAILS,
path: 'assets',
name: ROUTE_MULTISIG_DETAILS_ASSETS,
component: AccountDetailsMultisigTokens,
meta: {
showFilterBar: true,
Expand All @@ -217,8 +217,8 @@ export const routes: WalletAppRouteConfig[] = [
},
},
{
path: 'transactions',
name: ROUTE_MULTISIG_DETAILS_TRANSACTIONS,
path: '',
name: ROUTE_MULTISIG_DETAILS,
component: AccountDetailsMultisigTransactions,
meta: {
hideHeader: true,
Expand All @@ -244,7 +244,7 @@ export const routes: WalletAppRouteConfig[] = [
meta: {
title: 'txDetails',
showHeaderNavigation: true,
backRoute: { name: ROUTE_MULTISIG_DETAILS_TRANSACTIONS },
backRoute: { name: ROUTE_MULTISIG_DETAILS },
},
},
{
Expand All @@ -254,7 +254,7 @@ export const routes: WalletAppRouteConfig[] = [
props: true,
meta: {
title: 'multisigProposalDetails',
backRoute: { name: ROUTE_MULTISIG_DETAILS_TRANSACTIONS },
backRoute: { name: ROUTE_MULTISIG_DETAILS },
showHeaderNavigation: true,
},
},
Expand All @@ -269,7 +269,7 @@ export const routes: WalletAppRouteConfig[] = [
props: true,
meta: {
title: 'coinDetails',
backRoute: { name: ROUTE_MULTISIG_DETAILS },
backRoute: { name: ROUTE_MULTISIG_DETAILS_ASSETS },
showHeaderNavigation: true,
showFilterBar: true,
hideSearchBar: true,
Expand All @@ -283,7 +283,7 @@ export const routes: WalletAppRouteConfig[] = [
props: true,
meta: {
title: 'coinDetails',
backRoute: { name: ROUTE_MULTISIG_DETAILS },
backRoute: { name: ROUTE_MULTISIG_DETAILS_ASSETS },
showHeaderNavigation: true,
isMultisig: true,
},
Expand Down Expand Up @@ -620,7 +620,7 @@ export const routes: WalletAppRouteConfig[] = [
props: true,
meta: {
title: 'coinDetails',
backRoute: { name: ROUTE_ACCOUNT_DETAILS },
backRoute: { name: ROUTE_ACCOUNT_DETAILS_ASSETS },
showHeaderNavigation: true,
showFilterBar: true,
hideSearchBar: true,
Expand All @@ -633,7 +633,7 @@ export const routes: WalletAppRouteConfig[] = [
props: true,
meta: {
title: 'coinDetails',
backRoute: { name: ROUTE_ACCOUNT_DETAILS },
backRoute: { name: ROUTE_ACCOUNT_DETAILS_ASSETS },
showHeaderNavigation: true,
},
},
Expand All @@ -650,7 +650,7 @@ export const routes: WalletAppRouteConfig[] = [
props: true,
meta: {
title: 'tokenDetails',
backRoute: { name: ROUTE_ACCOUNT_DETAILS },
backRoute: { name: ROUTE_ACCOUNT_DETAILS_ASSETS },
showHeaderNavigation: true,
showFilterBar: true,
hideSearchBar: true,
Expand All @@ -663,7 +663,7 @@ export const routes: WalletAppRouteConfig[] = [
props: true,
meta: {
title: 'tokenDetails',
backRoute: { name: ROUTE_ACCOUNT_DETAILS },
backRoute: { name: ROUTE_ACCOUNT_DETAILS_ASSETS },
showHeaderNavigation: true,
},
},
Expand Down
7 changes: 3 additions & 4 deletions src/protocols/bitcoin/views/AccountDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { defineComponent } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { IonContent, IonPage } from '@ionic/vue';
import { PROTOCOL_VIEW_ACCOUNT_DETAILS } from '@/constants';
import { ROUTE_ACCOUNT_DETAILS_TRANSACTIONS } from '@/popup/router/routeNames';
import { ROUTE_ACCOUNT_DETAILS } from '@/popup/router/routeNames';
import AccountDetailsBase from '@/popup/components/AccountDetailsBase.vue';

export default defineComponent({
Expand All @@ -27,9 +27,8 @@ export default defineComponent({
const router = useRouter();

(() => {
// BTC have only one view (transaction list) in ACCOUNT DETAILS
if (route.name !== ROUTE_ACCOUNT_DETAILS_TRANSACTIONS) {
router.push({ name: ROUTE_ACCOUNT_DETAILS_TRANSACTIONS });
if (route.name !== ROUTE_ACCOUNT_DETAILS) {
router.push({ name: ROUTE_ACCOUNT_DETAILS });
}
})();
},
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/integration/other.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Tests cases not connected to specific page', () => {
{ path: '/notifications', redirect: false },
{ path: '/account-details/names', redirect: true },
{ path: '/more/about', redirect: true },
{ path: '/account-details/transactions', redirect: true },
{ path: '/account-details/', redirect: true },
].forEach(({ path, redirect }) => {
cy.login({}, path)
.visit('')
Expand Down
3 changes: 0 additions & 3 deletions tests/e2e/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import '../../../src/lib/initPolyfills';
import { v4 as uuid } from 'uuid';
import { ROUTE_ACCOUNT_DETAILS_TRANSACTIONS } from '../../../src/popup/router/routeNames';
import { STUB_CURRENCY, STUB_ACCOUNT } from '../../../src/constants/stubs';
import {
formatDate,
Expand Down Expand Up @@ -280,8 +279,6 @@ Cypress.Commands.add('addNetwork', (name, nodeUrl, middlewareUrl) => {

Cypress.Commands.add('openTransactions', () => {
cy.get('[data-cy=account-card-base]')
.click()
.get(`[data-cy=${ROUTE_ACCOUNT_DETAILS_TRANSACTIONS}]`)
.click()
.get('[data-cy=loader]')
.should('be.visible');
Expand Down