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: MMI adds note to trader support to the new Tx confirmation view #27214

Merged
merged 22 commits into from
Sep 23, 2024

Conversation

zone-live
Copy link
Contributor

@zone-live zone-live commented Sep 17, 2024

Description

Adds the MMI transaction "note to trader" functionality to the new transactions redesign, the current one is also kept in order to facilitate backwards compatibility with the current confirmation view (to be removed later).
It also adds a few parameters that were missing for MMI like the tx metadata.

note_to_trader_ss

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.

@github-actions github-actions bot added the team-mmi PRs from the MMI team label Sep 17, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [8bd8283]
Page Load Metrics (1753 ± 94 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15152311175319694
domContentLoaded15062299173319292
load15132310175319794
domInteractive1210937199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 5 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

sonarcloud bot commented Sep 18, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [28ebb05]
Page Load Metrics (1642 ± 111 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29921511584374180
domContentLoaded139321011622231111
load142921511642231111
domInteractive21149413416
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 5 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@zone-live zone-live marked this pull request as ready for review September 19, 2024 12:27
@zone-live zone-live requested review from a team as code owners September 19, 2024 12:27
@zone-live zone-live requested a review from a team as a code owner September 19, 2024 12:27
labelText: string;
};

const TabbedNoteToTrader: React.FC<NoteToTraderProps> = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be removed towards the end of the year.

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.

LGTM!

<Text className="note-header__counter">
{noteText.length}/{maxLength}
{noteText.length}/{280}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what's the intended behaviour with this, but do we want to do {noteText.length}/280 or {noteText.length}/{MAX_LENGTH} with const MAX_LENGTH = 280?

Copy link
Contributor Author

@zone-live zone-live Sep 23, 2024

Choose a reason for hiding this comment

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

the 280 is the max length. I'll assign it to a const in a next PR I have open 👍🏼

return () => clearTimeout(timer);
}, [noteText]);

return isNoteToTraderSupported && !isSignature ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit]: Can instead be expressed with an early return which is arguably more readable:

if (!isNotToTraderSupported || isSignature) {
  return null
}

@@ -63,6 +64,11 @@ const Confirm = () => (
<Title />
<Info />
<PluggableSection />
{
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

@zone-live zone-live merged commit 34259a3 into develop Sep 23, 2024
78 checks passed
@zone-live zone-live deleted the MMI-5391-add-note-to-trader-support branch September 23, 2024 10:19
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2024
@metamaskbot metamaskbot added release-12.6.0 Issue or pull request that will be included in release 12.6.0 release-12.5.0 Issue or pull request that will be included in release 12.5.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 23, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-12.5.0 on PR. Adding release label release-12.5.0 on PR and removing other release labels(release-12.6.0), as PR was added to branch 12.5.0 when release was cut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-mmi PRs from the MMI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants