Skip to content

Commit

Permalink
fix: Remove human description from dashboard due to lack of space (#2547
Browse files Browse the repository at this point in the history
)
  • Loading branch information
usame-algan authored Sep 26, 2023
1 parent e13f87b commit 019ecae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 deletions.
6 changes: 2 additions & 4 deletions cypress/e2e/pages/dashboard.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ export function verifyTxQueueWidget() {
cy.contains(noTransactionStr).should('not.exist')

// Queued txns
cy.contains(
`a[href^="/transactions/tx?id=multisig_0x"]`,
'13' + 'Send' + '0.00002 GOR' + 'to' + 'gor:0xE297...9665' + '1/1',
).should('exist')
cy.contains(`a[href^="/transactions/tx?id=multisig_0x"]`, '13' + 'Send' + '-0.00002 GOR' + '1/1').should('exist')

cy.contains(`a[href="${constants.transactionQueueUrl}${encodeURIComponent(constants.TEST_SAFE)}"]`, viewAllStr)
})
}
Expand Down
18 changes: 4 additions & 14 deletions src/components/dashboard/PendingTxs/PendingTxListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import NextLink from 'next/link'
import { useRouter } from 'next/router'
import type { ReactElement } from 'react'
import { useMemo } from 'react'
import { TransactionInfoType } from '@safe-global/safe-gateway-typescript-sdk'
import ChevronRight from '@mui/icons-material/ChevronRight'
import type { TransactionSummary } from '@safe-global/safe-gateway-typescript-sdk'
import { Box, SvgIcon, Typography } from '@mui/material'
Expand All @@ -16,8 +15,6 @@ import useSafeInfo from '@/hooks/useSafeInfo'
import useWallet from '@/hooks/wallets/useWallet'
import SignTxButton from '@/components/transactions/SignTxButton'
import ExecuteTxButton from '@/components/transactions/ExecuteTxButton'
import useABTesting from '@/services/tracking/useAbTesting'
import { AbTest } from '@/services/tracking/abTesting'

type PendingTxType = {
transaction: TransactionSummary
Expand All @@ -28,7 +25,6 @@ const PendingTx = ({ transaction }: PendingTxType): ReactElement => {
const { id } = transaction
const { safe } = useSafeInfo()
const wallet = useWallet()
const shouldDisplayHumanDescription = useABTesting(AbTest.HUMAN_DESCRIPTION)
const canSign = wallet ? isSignableBy(transaction, wallet.address) : false
const canExecute = wallet ? isExecutable(transaction, wallet?.address, safe) : false

Expand All @@ -43,24 +39,18 @@ const PendingTx = ({ transaction }: PendingTxType): ReactElement => {
[router, id],
)

const displayInfo =
(!transaction.txInfo.richDecodedInfo && transaction.txInfo.type !== TransactionInfoType.TRANSFER) ||
!shouldDisplayHumanDescription

return (
<NextLink href={url} passHref>
<Box className={css.container}>
{isMultisigExecutionInfo(transaction.executionInfo) && transaction.executionInfo.nonce}

<Box flex={1}>
<TxType tx={transaction} />
<TxType tx={transaction} short={true} />
</Box>

{displayInfo && (
<Box flex={1} className={css.txInfo}>
<TxInfo info={transaction.txInfo} />
</Box>
)}
<Box flex={1} className={css.txInfo}>
<TxInfo info={transaction.txInfo} />
</Box>

{isMultisigExecutionInfo(transaction.executionInfo) ? (
<Box className={css.confirmationsCount}>
Expand Down
7 changes: 4 additions & 3 deletions src/components/transactions/TxType/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import { AbTest } from '@/services/tracking/abTesting'

type TxTypeProps = {
tx: TransactionSummary
short?: boolean
}

const TxType = ({ tx }: TxTypeProps) => {
const TxType = ({ tx, short = false }: TxTypeProps) => {
const type = useTransactionType(tx)
const shouldDisplayHumanDescription = useABTesting(AbTest.HUMAN_DESCRIPTION)

Expand All @@ -27,9 +28,9 @@ const TxType = ({ tx }: TxTypeProps) => {
height={16}
fallback="/images/transactions/custom.svg"
/>
{humanDescription && shouldDisplayHumanDescription ? (
{humanDescription && shouldDisplayHumanDescription && !short ? (
<HumanDescription fragments={humanDescription} />
) : tx.txInfo.type === TransactionInfoType.TRANSFER && shouldDisplayHumanDescription ? (
) : tx.txInfo.type === TransactionInfoType.TRANSFER && shouldDisplayHumanDescription && !short ? (
<TransferDescription isSendTx={tx.txInfo.direction === TransferDirection.OUTGOING} txInfo={tx.txInfo} />
) : (
type.text
Expand Down
3 changes: 1 addition & 2 deletions src/services/analytics/useGtm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ const useGtm = () => {
gtmSetSafeAddress(safeAddress)
}, [safeAddress])

// Track page views – anononimized by default.
// Sensitive info, like the safe address or tx id, is always in the query string, which we DO NOT track.
// Track page views – anonymized by default.
useEffect(() => {
// Don't track 404 because it's not a real page, it immediately does a client-side redirect
if (router.pathname === AppRoutes['404']) return
Expand Down

0 comments on commit 019ecae

Please sign in to comment.