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: notifications renewal [SW-631] #4699

Merged
merged 28 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
250d2ae
feat: enhance notification link handling to support onClick actions
tmjssz Dec 20, 2024
adf93b6
feat: add `useNotificationsTokenVersion` hook to store the notificati…
tmjssz Dec 20, 2024
3dfac6a
feat: in notification registration flow update token version to be up…
tmjssz Dec 20, 2024
5eaa612
feat: add `useNotificationsRenewal` hook to manage notification renew…
tmjssz Dec 20, 2024
475171a
feat: integrate `useNotificationsRenewal` hook to display renewal mes…
tmjssz Dec 20, 2024
15289b3
feat: add `NotificationRenewal` component to handle notification rene…
tmjssz Dec 20, 2024
1471581
feat: merge Safes for notification registration and renewal in Global…
tmjssz Dec 20, 2024
69a17a9
feat: put notifications renewal behind a feature flag
tmjssz Dec 20, 2024
7ddc782
fix: linter warnings
tmjssz Dec 20, 2024
1bae52d
chore: update firebase dependency to version 11.1.0
tmjssz Dec 20, 2024
3bfe5bb
refactor: simplify passed styling props for Typography
tmjssz Dec 30, 2024
c28d2f0
refactor: replace mergeNotifiableSafes with _mergeNotifiableSafes and…
tmjssz Dec 30, 2024
3bb52bc
feat: handle errors in notifications renewal
tmjssz Dec 30, 2024
8e24f03
feat: split useNotificationsRenewal hook
tmjssz Dec 30, 2024
4aa0bc5
feat: add tests for getChainPreferences in useNotificationPreferences…
tmjssz Dec 30, 2024
1482c28
test: add mock for useNotificationsTokenVersion and verify token vers…
tmjssz Dec 30, 2024
0c86a65
feat: add tests for useNotificationsTokenVersion hook
tmjssz Dec 30, 2024
9428b9f
test: add tests for useNotificationsRenewal hook
tmjssz Dec 30, 2024
219a651
test: add tests for useShowNotificationsRenewalMessage hook
tmjssz Dec 30, 2024
9ad37bc
refactor: remove unused lodash import in PushNotifications logic
tmjssz Dec 30, 2024
3341601
fix: update dependency array in useNotificationsRenewal hook to inclu…
tmjssz Dec 30, 2024
c93846d
refactor: use property shorthand for chainId assignment
tmjssz Dec 30, 2024
36a5fa7
refactor: change renewal message + extract it to constants for better…
tmjssz Jan 7, 2025
f7ee1db
fix: show renewal notification again when switching the chain for a m…
tmjssz Jan 7, 2025
36a6075
fix: update snapshot files
tmjssz Jan 7, 2025
ee0f523
fix: update snapshots
tmjssz Jan 7, 2025
72fd18d
Merge branch 'dev' into feat/notifications-renewal
katspaugh Jan 8, 2025
94c917d
Update snapshots
katspaugh Jan 8, 2025
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
Prev Previous commit
Next Next commit
fix: update snapshot files
tmjssz committed Jan 7, 2025

Verified

This commit was signed with the committer’s verified signature.
brynpickering Bryn Pickering
commit 36a607508cb721f375f0eece66d5beab4a0549cb
Original file line number Diff line number Diff line change
@@ -22,15 +22,15 @@ exports[`SignOrExecute should display a confirmation screen 1`] = `
<h3
class="MuiAccordion-heading css-cy7rkm-MuiAccordion-heading"
>
<div
<button
aria-expanded="false"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-6csn7x-MuiButtonBase-root-MuiAccordionSummary-root"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-10sjung-MuiButtonBase-root-MuiAccordionSummary-root"
data-testid="decoded-tx-summary"
role="button"
tabindex="0"
type="button"
>
<div
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1pnrdlh-MuiAccordionSummary-content"
<span
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1r0e0ir-MuiAccordionSummary-content"
>
Advanced details
<span
@@ -46,8 +46,8 @@ exports[`SignOrExecute should display a confirmation screen 1`] = `
<div
class="MuiBox-root css-i9gxme"
/>
</div>
<div
</span>
<span
class="MuiAccordionSummary-expandIconWrapper css-1wqf3nl-MuiAccordionSummary-expandIconWrapper"
>
<svg
@@ -61,8 +61,8 @@ exports[`SignOrExecute should display a confirmation screen 1`] = `
d="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
/>
</svg>
</div>
</div>
</span>
</button>
</h3>
<div
class="MuiCollapse-root MuiCollapse-vertical MuiCollapse-hidden css-cwrbtg-MuiCollapse-root"
@@ -282,15 +282,15 @@ exports[`SignOrExecute should display an error screen 1`] = `
<h3
class="MuiAccordion-heading css-cy7rkm-MuiAccordion-heading"
>
<div
<button
aria-expanded="false"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-6csn7x-MuiButtonBase-root-MuiAccordionSummary-root"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-10sjung-MuiButtonBase-root-MuiAccordionSummary-root"
data-testid="decoded-tx-summary"
role="button"
tabindex="0"
type="button"
>
<div
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1pnrdlh-MuiAccordionSummary-content"
<span
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1r0e0ir-MuiAccordionSummary-content"
>
Advanced details
<span
@@ -306,8 +306,8 @@ exports[`SignOrExecute should display an error screen 1`] = `
<div
class="MuiBox-root css-i9gxme"
/>
</div>
<div
</span>
<span
class="MuiAccordionSummary-expandIconWrapper css-1wqf3nl-MuiAccordionSummary-expandIconWrapper"
>
<svg
@@ -321,8 +321,8 @@ exports[`SignOrExecute should display an error screen 1`] = `
d="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
/>
</svg>
</div>
</div>
</span>
</button>
</h3>
<div
class="MuiCollapse-root MuiCollapse-vertical MuiCollapse-hidden css-cwrbtg-MuiCollapse-root"
Original file line number Diff line number Diff line change
@@ -20,14 +20,14 @@ exports[`BatchTransactions should render a list of batch transactions 1`] = `
<h3
class="MuiAccordion-heading css-cy7rkm-MuiAccordion-heading"
>
<div
<button
aria-expanded="false"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-6csn7x-MuiButtonBase-root-MuiAccordionSummary-root"
role="button"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-10sjung-MuiButtonBase-root-MuiAccordionSummary-root"
tabindex="0"
type="button"
>
<div
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1pnrdlh-MuiAccordionSummary-content"
<span
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1r0e0ir-MuiAccordionSummary-content"
>
<div
class="MuiBox-root css-mvjamn"
@@ -63,8 +63,8 @@ exports[`BatchTransactions should render a list of batch transactions 1`] = `
</span>
</div>
</div>
</div>
<div
</span>
<span
class="MuiAccordionSummary-expandIconWrapper css-1wqf3nl-MuiAccordionSummary-expandIconWrapper"
>
<svg
@@ -78,8 +78,8 @@ exports[`BatchTransactions should render a list of batch transactions 1`] = `
d="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
/>
</svg>
</div>
</div>
</span>
</button>
</h3>
<div
class="MuiCollapse-root MuiCollapse-vertical MuiCollapse-hidden css-cwrbtg-MuiCollapse-root"
@@ -235,7 +235,7 @@ exports[`BatchTransactions should render a list of batch transactions 1`] = `
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
data-testid="tx-data-row"
>
9/20/2024, 10:20:15 AM
20.9.2024, 10:20:15
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -126,15 +126,15 @@ exports[`ConfirmationView should display a confirmation screen for a SETTINGS_CH
<h3
class="MuiAccordion-heading css-cy7rkm-MuiAccordion-heading"
>
<div
<button
aria-expanded="false"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-6csn7x-MuiButtonBase-root-MuiAccordionSummary-root"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-10sjung-MuiButtonBase-root-MuiAccordionSummary-root"
data-testid="decoded-tx-summary"
role="button"
tabindex="0"
type="button"
>
<div
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1pnrdlh-MuiAccordionSummary-content"
<span
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1r0e0ir-MuiAccordionSummary-content"
>
Advanced details
<span
@@ -151,8 +151,8 @@ exports[`ConfirmationView should display a confirmation screen for a SETTINGS_CH
class="MuiBox-root css-i9gxme"
/>
addOwnerWithThreshold
</div>
<div
</span>
<span
class="MuiAccordionSummary-expandIconWrapper css-1wqf3nl-MuiAccordionSummary-expandIconWrapper"
>
<svg
@@ -166,8 +166,8 @@ exports[`ConfirmationView should display a confirmation screen for a SETTINGS_CH
d="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
/>
</svg>
</div>
</div>
</span>
</button>
</h3>
<div
class="MuiCollapse-root MuiCollapse-vertical MuiCollapse-hidden css-cwrbtg-MuiCollapse-root"
@@ -631,15 +631,15 @@ exports[`ConfirmationView should display a confirmation with method call when th
<h3
class="MuiAccordion-heading css-cy7rkm-MuiAccordion-heading"
>
<div
<button
aria-expanded="false"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-6csn7x-MuiButtonBase-root-MuiAccordionSummary-root"
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-gutters accordion css-10sjung-MuiButtonBase-root-MuiAccordionSummary-root"
data-testid="decoded-tx-summary"
role="button"
tabindex="0"
type="button"
>
<div
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1pnrdlh-MuiAccordionSummary-content"
<span
class="MuiAccordionSummary-content MuiAccordionSummary-contentGutters css-1r0e0ir-MuiAccordionSummary-content"
>
Advanced details
<span
@@ -656,8 +656,8 @@ exports[`ConfirmationView should display a confirmation with method call when th
class="MuiBox-root css-i9gxme"
/>
addOwnerWithThreshold
</div>
<div
</span>
<span
class="MuiAccordionSummary-expandIconWrapper css-1wqf3nl-MuiAccordionSummary-expandIconWrapper"
>
<svg
@@ -671,8 +671,8 @@ exports[`ConfirmationView should display a confirmation with method call when th
d="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
/>
</svg>
</div>
</div>
</span>
</button>
</h3>
<div
class="MuiCollapse-root MuiCollapse-vertical MuiCollapse-hidden css-cwrbtg-MuiCollapse-root"

Unchanged files with check annotations Beta

jest.spyOn(useDraftBatch, 'useDraftBatch').mockImplementation(() => mockedDarftBatch)
describe('BatchTransactions', () => {
it('should render a list of batch transactions', () => {

Check failure on line 9 in apps/web/src/components/tx/confirmation-views/BatchTransactions/BatchTransactions.test.tsx

GitHub Actions / Tests annotations (🧪 jest-coverage-report-action)

BatchTransactions > should render a list of batch transactions

Error: expect(received).toMatchSnapshot() Snapshot name: `BatchTransactions should render a list of batch transactions 1` - Snapshot - 1 + Received + 1 @@ -230,11 +230,11 @@ </div> <div class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root" data-testid="tx-data-row" > - 20.9.2024, 10:20:15 + 9/20/2024, 10:20:15 AM </div> </div> </div> </div> </div> at Object.toMatchSnapshot (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/apps/web/src/components/tx/confirmation-views/BatchTransactions/BatchTransactions.test.tsx:12:23) at Promise.then.completed (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 9 in apps/web/src/components/tx/confirmation-views/BatchTransactions/BatchTransactions.test.tsx

GitHub Actions / Tests annotations (🧪 jest-coverage-report-action)

BatchTransactions > should render a list of batch transactions

Error: expect(received).toMatchSnapshot() Snapshot name: `BatchTransactions should render a list of batch transactions 1` - Snapshot - 1 + Received + 1 @@ -230,11 +230,11 @@ </div> <div class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root" data-testid="tx-data-row" > - 20.9.2024, 10:20:15 + 9/20/2024, 10:20:15 AM </div> </div> </div> </div> </div> at Object.toMatchSnapshot (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/apps/web/src/components/tx/confirmation-views/BatchTransactions/BatchTransactions.test.tsx:12:23) at Promise.then.completed (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/safe-wallet-monorepo/safe-wallet-monorepo/node_modules/jest-runner/build/testWorker.js:106:12)
const { container, getByText } = render(<BatchTransactions />)
expect(container).toMatchSnapshot()