Skip to content

Display result pages using the ApprovalController#1442

Merged
matthewwalsh0 merged 6 commits intomainfrom
feat/707-result-pages
Jun 24, 2023
Merged

Display result pages using the ApprovalController#1442
matthewwalsh0 merged 6 commits intomainfrom
feat/707-result-pages

Conversation

@matthewwalsh0
Copy link
Copy Markdown
Member

@matthewwalsh0 matthewwalsh0 commented Jun 21, 2023

Explanation

Adds success and error methods to the ApprovalController to easily create standardised approvals to display success or error pages in the clients.

These methods both support optional arguments including message, error, and header to configure what text or components are displayed in the approval, plus flowToEnd which will end the specified flow when the result confirmation is approved.

This PR also includes some minor refactors for consistency, including:

  • Replacing use of the private modifier with the # syntax to protect private properties and methods at runtime.
  • Removing calls to any private methods from the unit tests.
  • Grouping the many types into categories to simplify future additions.

Changelog

@metamask/approval-controller

  • ADDED: success and error methods to display standardised result pages

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

Remove private method access from unit tests.
Create related option and result types.
Create associated unit tests.
Add new approval types.
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review June 21, 2023 17:52
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner June 21, 2023 17:52
@matthewwalsh0 matthewwalsh0 merged commit 83c5610 into main Jun 24, 2023
@matthewwalsh0 matthewwalsh0 deleted the feat/707-result-pages branch June 24, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants