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

feat: Add Human readable descriptions #2371

Merged
merged 24 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b1472a9
Display human readable description if it exists
usame-algan Aug 8, 2023
15db3c5
Add some spacing
usame-algan Aug 10, 2023
9f0bcb6
Add readable description to nonce replace form, remove it in every ot…
usame-algan Aug 11, 2023
f231cd7
Show txDescription in notifications and notification center
usame-algan Aug 11, 2023
ec3cdcf
Merge remote-tracking branch 'origin/main' into human-readable-txs
usame-algan Aug 14, 2023
c7e2653
Update gateway-sdk package, rename to humanDescription
usame-algan Aug 14, 2023
e854d06
Merge remote-tracking branch 'origin/dev' into human-readable-txs
usame-algan Aug 16, 2023
89bdefc
Display human description in txSummary if possible, update nonce repl…
usame-algan Aug 17, 2023
1cea04a
fix: Adjust history column layout, display transfer descriptions in h…
usame-algan Aug 18, 2023
82b12bb
Revert env change, hide human description in queue
usame-algan Aug 25, 2023
9ececeb
Merge remote-tracking branch 'origin/dev' into human-readable-txs
usame-algan Aug 28, 2023
0154d0b
fix: Human-readable notifications
usame-algan Aug 28, 2023
31fc3fe
fix: Failing tests
usame-algan Aug 28, 2023
e761fd2
revert: Remove human descriptions from tx history
usame-algan Aug 28, 2023
12fa7ae
fix: Add human description fallbacks for notifications
usame-algan Aug 28, 2023
4accc6b
fix: Failing tests
usame-algan Aug 28, 2023
88c6a13
fix: fallback label when replacing nonce, move humanDescriptions outs…
usame-algan Aug 29, 2023
7749282
fix: Revert constants, add fallback for pending tx notifications
usame-algan Aug 29, 2023
286b398
fix: Add generic humanDescription fallback to notifications
usame-algan Aug 29, 2023
2c33674
fix: Remove custom fallbacks and use one fallback inside Notifications
usame-algan Aug 29, 2023
c748e45
revert: Changes to the tx history
usame-algan Aug 29, 2023
a7d513f
fix: Notification title fallback if human description is undefined
usame-algan Aug 30, 2023
3220be0
Merge remote-tracking branch 'origin/dev' into human-readable-txs
usame-algan Aug 30, 2023
83799b6
fix: Add bigger timeout to batch tx e2e test
usame-algan Aug 30, 2023
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
4 changes: 0 additions & 4 deletions .vscode/settings.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { type TransactionData } from '@safe-global/safe-gateway-typescript-sdk'

const ReadableDescription = ({ txData }: { txData?: TransactionData }) => {
// @ts-ignore TODO: Update gateway-sdk
if (!txData?.readableDescription) return null

// @ts-ignore TODO: Update gateway-sdk
return <div>{txData.readableDescription}</div>
}

export default ReadableDescription
2 changes: 2 additions & 0 deletions src/components/transactions/TxDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { DelegateCallWarning, UnsignedWarning } from '@/components/transactions/
import Multisend from '@/components/transactions/TxDetails/TxData/DecodedData/Multisend'
import useSafeInfo from '@/hooks/useSafeInfo'
import useIsPending from '@/hooks/useIsPending'
import ReadableDescription from '@/components/transactions/TxDetails/TxData/ReadableDescription'

export const NOT_AVAILABLE = 'n/a'

Expand Down Expand Up @@ -60,6 +61,7 @@ const TxDetailsBlock = ({ txSummary, txDetails }: TxDetailsProps): ReactElement

<div className={css.txData}>
<ErrorBoundary fallback={<div>Error parsing data</div>}>
<ReadableDescription txData={txDetails.txData} />
<TxData txDetails={txDetails} />
</ErrorBoundary>
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import chains from './chains'
export const IS_PRODUCTION = !!process.env.NEXT_PUBLIC_IS_PRODUCTION
export const IS_DEV = process.env.NODE_ENV === 'development'

export const GATEWAY_URL_PRODUCTION =
process.env.NEXT_PUBLIC_GATEWAY_URL_PRODUCTION || 'https://safe-client.safe.global'
export const GATEWAY_URL_STAGING = process.env.NEXT_PUBLIC_GATEWAY_URL_STAGING || 'https://safe-client.staging.5afe.dev'
export const GATEWAY_URL_PRODUCTION = process.env.NEXT_PUBLIC_GATEWAY_URL_PRODUCTION || 'http://localhost:3030'
iamacook marked this conversation as resolved.
Show resolved Hide resolved
export const GATEWAY_URL_STAGING = process.env.NEXT_PUBLIC_GATEWAY_URL_STAGING || 'http://localhost:3030'
iamacook marked this conversation as resolved.
Show resolved Hide resolved

// Magic numbers
export const POLLING_INTERVAL = 15_000
Expand Down
Loading