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

chore: migrated institutional ui components to ts #25858

Merged
merged 35 commits into from
Jul 24, 2024

Conversation

albertolive
Copy link
Contributor

@albertolive albertolive commented Jul 16, 2024

Description

Most of our components are still written in JS; there’s nothing wrong with that, but since MM has been making an effort to move their components to TS and all our new UI pieces are written in TS, we should start moving our UI elements to TS, starting from:

ui/components/institutional/

AC:

  • At least 50% of our components have been updated to TS along with their unit tests. (start with the smaller, easier components first and then afterwards move to the more complex ones and probably split it into its tickets)

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-mmi PRs from the MMI team label Jul 16, 2024
@albertolive albertolive changed the title chore: migrated jwt-url-form to ts chore: migrated institutional ui components to ts Jul 17, 2024
@albertolive albertolive marked this pull request as ready for review July 19, 2024 09:44
@albertolive albertolive requested review from a team as code owners July 19, 2024 09:44
onChange: () => {
/**/
},
},
};

export const DefaultStory = (args) => <NoteToTrader {...args} />;
export const DefaultStory = (args: any) => <NoteToTrader {...args} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case we can define a type instead of any from observing the args values above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedronfigueiredo changes are done

@albertolive albertolive requested a review from a team as a code owner July 22, 2024 11:44
@albertolive
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@metamaskbot metamaskbot requested review from a team as code owners July 22, 2024 12:00
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should try to remove the remaining any declarations, see the contributor docs for more info, and follow a recent thread on this.

@albertolive
Copy link
Contributor Author

I think we should try to remove the remaining any declarations, see the contributor docs for more info, and follow a recent thread on this.

@pedronfigueiredo I already removed all of the any that I introduced. There is only one left, ui/components/institutional/wrong-network-notification/wrong-network-notification.stories.tsx but that component is deprecated and removed in this PR #26000

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Migrated institutional UI components to TypeScript for improved type safety and maintainability.

  • Updated lavamoat/browserify/mmi/policy.json to simplify dependency paths for @metamask-institutional/types.
  • Added @metamask-institutional/types dependency in package.json.
  • Migrated ui/components/institutional/confirm-remove-jwt-modal/* files to TypeScript, ensuring type safety and consistency.
  • Migrated ui/components/institutional/custody-confirm-link-modal/* files to TypeScript, enhancing type definitions and maintainability.
  • Migrated ui/components/institutional/interactive-replacement-token-modal/* files to TypeScript, improving type annotations and reducing runtime errors.

27 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

Migrated institutional UI components to TypeScript for improved type safety and maintainability.

  • Added app/scripts/migrations/122.ts to enable redesignedConfirmationsEnabled by default.
  • Updated app/scripts/metamask-controller.js to refactor hardware wallet keyring handling.
  • Enhanced test/e2e/helpers.js with tempToggleSettingRedesignedConfirmations for redesigned confirmation tests.
  • Modified app/scripts/lib/setupSentry.js to track redesignedConfirmationsEnabled in Sentry.
  • Updated test/e2e/tests/* to include redesigned confirmation settings in various test cases.

22 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@metamaskbot
Copy link
Collaborator

Builds ready [eeba795]
Page Load Metrics (155 ± 150 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint733121296129
domContentLoaded1089342010
load401507155312150
domInteractive1089342010
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

Migrated institutional UI components to TypeScript for improved type safety and maintainability.

  • Updated ui/components/institutional/* to TypeScript, enhancing type safety.
  • Modified app/scripts/background.js to include test-specific keyring overrides.
  • Added test/stub/keyring-bridge.js for simulating keyring bridges in tests.
  • Updated ui/pages/asset/components/token-buttons.tsx to TypeScript, including MetaMetrics and marketing data selectors.
  • Removed test-e2e-swap-playwright job from .circleci/config.yml, potentially reducing test coverage but streamlining CI pipeline.

27 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@metamaskbot
Copy link
Collaborator

Builds ready [bc73047]
Page Load Metrics (251 ± 246 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint832861225426
domContentLoaded109334199
load451978251513246
domInteractive109334199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@albertolive albertolive merged commit be1c107 into develop Jul 24, 2024
76 checks passed
@albertolive albertolive deleted the MMI-5205-mmi-ui-components-to-ts branch July 24, 2024 08:50
@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-mmi PRs from the MMI team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants