Skip to content

Part of #17670 for file ui\pages\onboarding-flow\create-password\create-password.js#20795

Merged
garrettbear merged 21 commits intoMetaMask:developfrom
PrgrmrHarshShukla:New-Experiment
Jan 24, 2024
Merged

Part of #17670 for file ui\pages\onboarding-flow\create-password\create-password.js#20795
garrettbear merged 21 commits intoMetaMask:developfrom
PrgrmrHarshShukla:New-Experiment

Conversation

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor

@PrgrmrHarshShukla PrgrmrHarshShukla commented Sep 8, 2023

Explanation

This PR is a part of the issue #17670 Replace deprecated Typography with Text component for file
ui\pages\onboarding-flow\create-password\create-password.js

Screenshots/Screencaps

Before

image

After

image

Manual Testing Steps

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@PrgrmrHarshShukla PrgrmrHarshShukla requested a review from a team as a code owner September 8, 2023 03:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 8, 2023

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.

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

PrgrmrHarshShukla commented Sep 8, 2023

Hey @georgewrmarshall , @garrettbear ,
Kindly look into this PR once you get time.

Some inconsistencies

I had to use bodyXs for H7 instead of bodyMd to better match the current UI.
Similar changes had to be made for H2 and H4 to better match with the current UI.
Please let me know if that is all right or not.

Visual regression

Presently, I can see a small visual regression in the alignment of New Password and Show/Hide toggle.

image

If we add an extra marginBottom={1} it gets solved,

image

Also,

I am working on replacing the deprecated components, like the Button, CheckBox, etc.

Will introduce those changes in next commit in this PR if you find it OK.

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1e5e386) 68.15% compared to head (540f233) 68.15%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20795      +/-   ##
===========================================
- Coverage    68.15%   68.15%   -0.00%     
===========================================
  Files         1083     1083              
  Lines        42491    42491              
  Branches     11333    11333              
===========================================
- Hits         28959    28957       -2     
- Misses       13532    13534       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Sep 8, 2023
@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

Hey @georgewrmarshall , @garrettbear , Kindly look into this PR once you get time.

Some inconsistencies

I had to use bodyXs for H7 instead of bodyMd to better match the current UI. Similar changes had to be made for H2 and H4 to better match with the current UI. Please let me know if that is all right or not.

Visual regression

Presently, I can see a small visual regression in the alignment of New Password and Show/Hide toggle.

image

If we add an extra marginBottom={1} it gets solved,

image

Also,

I am working on replacing the deprecated components, like the Button, CheckBox, etc.

Will introduce those changes in next commit in this PR if you find it OK.

Hey @georgewrmarshall ,
Would you like to say something about this?

Regards,
Harsh

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

Hey @georgewrmarshall ,
All the tests have passed for this PR.
Please look into this so that any remaining problems can be solved.

Regards,
Harsh

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

Hey @georgewrmarshall , All the tests have passed for this PR. Please look into this so that any remaining problems can be solved.

Regards, Harsh

Hey @georgewrmarshall ,
Please look into this.

Regards,
Harsh

Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Looking good @PrgrmrHarshShukla! Left some small suggestions. Could we also create a storybook file for this component

import React from 'react';
import CreatePassword from './create-password';

export default {
  title: 'Pages/OnboardingFlow/CreatePassword',
  argTypes: {
    createNewAccount: {
      action: 'createNewAccount',
    },
    importWithRecoveryPhrase: {
      action: 'importWithRecoveryPhrase',
    },
    secretRecoveryPhrase: {
      control: 'text',
    },
  },
};

export const DefaultStory = (args) => <CreatePassword {...args} />;

DefaultStory.storyName = 'Default';

value={password}
titleDetail={
<Typography variant={TypographyVariant.H7}>
<Text variant={TextVariant.bodyXs}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's replace the Text and link element with the ButtonLink component. Then we will be reducing the html bloat and using the correct semantic html element

 <ButtonLink
    variant={TextVariant.bodySm}
    data-testid="show-password"
    className="create-password__form--password-button"
    onClick={(e) => {
      e.preventDefault();
      setShowPassword(!showPassword);
    }}
    marginBottom={1}
  >
    {showPassword ? t('hide') : t('show')}
  </ButtonLink>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure,
Will do it now.

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

Looking good @PrgrmrHarshShukla! Left some small suggestions. Could we also create a storybook file for this component

import React from 'react';
import CreatePassword from './create-password';

export default {
  title: 'Pages/OnboardingFlow/CreatePassword',
  argTypes: {
    createNewAccount: {
      action: 'createNewAccount',
    },
    importWithRecoveryPhrase: {
      action: 'importWithRecoveryPhrase',
    },
    secretRecoveryPhrase: {
      control: 'text',
    },
  },
};

export const DefaultStory = (args) => <CreatePassword {...args} />;

DefaultStory.storyName = 'Default';

Sure,
I will try and do that as soon as possible.

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

PrgrmrHarshShukla commented Sep 26, 2023

Looking good @PrgrmrHarshShukla! Left some small suggestions. Could we also create a storybook file for this component

Hey @georgewrmarshall ,
You have provided me the complete code.
Thanks a lot.🙏🏼
I had to just add it there like the others.

Done.
🙏🏼

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

PrgrmrHarshShukla commented Sep 26, 2023

Hey @georgewrmarshall , You have provided me the complete code. Thanks a lot.🙏🏼 I had to just add it there like the others.

Done. 🙏🏼

Storybook file added for the component.

image

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

Hey @georgewrmarshall ,
All checks have passed here.

Please look into it for any remaining improvements.

Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for your contribution @PrgrmrHarshShukla

</h2>
<h4
class="box box--margin-top-1 box--margin-bottom-1 box--flex-direction-row typography typography--h4 typography--weight-normal typography--style-normal typography--align-center typography--color-text-default"
align="center"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When updating the prop from the below suggestion it should remove this, so you will need to update snapshot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure,
Will do that now.

Co-authored-by: Garrett Bear <gwhisten@gmail.com>
@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

PrgrmrHarshShukla commented Oct 5, 2023

image

Hey @garrettbear ,
Please help me with how to resolve the above conflict in the file
ui/pages/onboarding-flow/create-password/__snapshots__/create-password.test.js.snap

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

Hey @garrettbear ,
Tried to solve the merge conflicts.
Please check the files to see everything is fine.

Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Hey @PrgrmrHarshShukla, looks like there is some unintentional code that has been removed in a rebase. We want to keep all the logic just replace stale components. Would you be able to revert those changes so it's just replacement of the components?

Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

I pushed a fix for the missing closing environment tag. Let's see if there are any tests we need to update

Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM!

  • pulled branch checked storybook
  • pull branch checked local build
after.mov

@PrgrmrHarshShukla
Copy link
Copy Markdown
Contributor Author

Hey @garrettbear ,
Your help is probably needed here.

@garrettbear garrettbear merged commit 39a0405 into MetaMask:develop Jan 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants