Skip to content

feat: add support dynamic actions in alert modal#24214

Merged
vinistevam merged 155 commits intodevelopfrom
feat/add-support-dynamic-actions-alert-modal
May 22, 2024
Merged

feat: add support dynamic actions in alert modal#24214
vinistevam merged 155 commits intodevelopfrom
feat/add-support-dynamic-actions-alert-modal

Conversation

@vinistevam
Copy link
Copy Markdown
Contributor

@vinistevam vinistevam commented Apr 24, 2024

Description

This PR aims to include an options property in Alerts called actions which enables specific actions depending on the alert.
Updated AlertModal component to support displaying suitable buttons based on the alert actions.
Created hooks to support the handling of these actions.

Context
Currently, the alert modal components display a single Got it button that is used to close the modal or progress to the next alert in the case of the MultipleAlertModal.

In addition to this button, some alerts can define additional actions for the user to carry out, each of which will require an additional button in the alert modal.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2322

Manual testing steps

Those components are currently not in use and are not available to users. It is part of the new alert system, and we will have a dedicated PR to integrate this component into the new confirmation screens.

Screenshots/Recordings

Before

After

image

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

vinistevam and others added 30 commits March 18, 2024 10:35
…al.tsx

Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
…al.tsx

Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
…al.test.tsx

Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
Base automatically changed from feat/trigger-alert-modal-confirm-btn to develop May 22, 2024 08:27
@vinistevam vinistevam dismissed OGPoyraz’s stale review May 22, 2024 08:27

The base branch was changed.

@vinistevam vinistevam changed the title add support dynamic actions in alert modal feat: add support dynamic actions in alert modal May 22, 2024
@vinistevam vinistevam merged commit 4135b68 into develop May 22, 2024
@vinistevam vinistevam deleted the feat/add-support-dynamic-actions-alert-modal branch May 22, 2024 13:21
@github-actions github-actions bot locked and limited conversation to collaborators May 22, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [6b0e265]
Page Load Metrics (1081 ± 539 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint701681002814
domContentLoaded95120147
load58247910811123539
domInteractive95120147
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 2.12 KiB (0.03%)
  • common: 0 Bytes (0.00%)

@gauthierpetetin gauthierpetetin added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-12.0.0 Issue or pull request that will be included in release 12.0.0 team-confirmations-system-deprecated DEPRECATED: please use "team-confirmations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants