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

feat: added edit accounts modal #26413

Merged
merged 5 commits into from
Sep 2, 2024
Merged

feat: added edit accounts modal #26413

merged 5 commits into from
Sep 2, 2024

Conversation

NidhiKJha
Copy link
Member

@NidhiKJha NidhiKJha commented Aug 14, 2024

This PR is to add an edit accounts modal

Related issues

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

Manual testing steps

  1. Go to EditAccountsModal in storybook
  2. Note: Two AvatarAccounts in This modal is not a bug related to this PR

Screenshots/Recordings

Before

NA

After

Screenshot 2024-08-27 at 2 10 44 PM

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.

@NidhiKJha NidhiKJha marked this pull request as ready for review August 27, 2024 13:12
@NidhiKJha NidhiKJha requested a review from a team as a code owner August 27, 2024 13:12
@NidhiKJha NidhiKJha added the needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. label Aug 27, 2024
@NidhiKJha NidhiKJha requested a review from jonybur August 27, 2024 13:12
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Aug 27, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [2f04498]
Page Load Metrics (93 ± 22 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint752951275426
domContentLoaded42209894622
load48216934522
domInteractive10147333115
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.55 KiB (0.05%)
  • common: 39 Bytes (0.00%)

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.12%. Comparing base (761562a) to head (78b7533).
Report is 28 commits behind head on develop.

Files with missing lines Patch % Lines
...ichain/edit-accounts-modal/edit-accounts-modal.tsx 84.62% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #26413   +/-   ##
========================================
  Coverage    70.11%   70.12%           
========================================
  Files         1416     1417    +1     
  Lines        49389    49402   +13     
  Branches     13799    13800    +1     
========================================
+ Hits         34628    34639   +11     
- Misses       14761    14763    +2     

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

return renderWithProvider(<EditAccountsModal {...props} />, store);
};
describe('EditAccountsModal', () => {
it('should render correctly', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add more unit test for this component:

  • calls onClose when the close button is clicked
  • handles checkbox click

Copy link
Contributor

Choose a reason for hiding this comment

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

+1. Also if possible, a test for the Select All button

Copy link
Member Author

Choose a reason for hiding this comment

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

Checkbox click is for account list item component and it's included there and so is the onClose for modal but I added a test for select all

Copy link
Contributor

@jonybur jonybur left a comment

Choose a reason for hiding this comment

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

Good start! Please check out my comments

isPinned={Boolean(account.pinned)}
startAccessory={<Checkbox isChecked />}
onClick={() => console.log(null)}
selected={false}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please finish implementing this

Copy link

@EtherWizard33 EtherWizard33 Aug 28, 2024

Choose a reason for hiding this comment

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

nit: might be nice to consider including the avatar with badge for the account, as well as the tokens avatargroup, with mock values, that would get the UI done to what the corresponding issue shows.

Doing this was useful for mobile since it revealed some adjustments DS team had to do to these components who had not been used much yet on mobile, maybe your extension components are already matching figma

2024-08-28 12 56 55

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a dumb component so having a console on click is fine. The selection is not gonna be based on this component so it's fine to keep it this way. @jonybur

Copy link
Member Author

Choose a reason for hiding this comment

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

@EtherWizard33 the connected badges for avatar is visible when it's in the popup view. So, it's already included in there

// isIndeterminate={isIndeterminate}
/>
</Box>
{mergedAccounts.map((account) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Also add the key to the map

Copy link
Member Author

Choose a reason for hiding this comment

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

It does have a key

Copy link
Contributor

Choose a reason for hiding this comment

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

True, sorry


type EditAccountsModalProps = {
onClose: () => void;
allowedAccountTypes?: KeyringAccountType[]; // Made optional to match default
Copy link
Contributor

Choose a reason for hiding this comment

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

To match what default?

Copy link

@metamaskbot
Copy link
Collaborator

Builds ready [78b7533]
Page Load Metrics (1671 ± 71 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15012242166814670
domContentLoaded14932106164412258
load15012253167114871
domInteractive226535157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.55 KiB (0.05%)
  • common: 39 Bytes (0.00%)

@NidhiKJha NidhiKJha merged commit 1ef0c49 into develop Sep 2, 2024
78 checks passed
@NidhiKJha NidhiKJha deleted the edit-accounts-modal branch September 2, 2024 21:20
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 2, 2024
@gauthierpetetin gauthierpetetin added 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 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design-qa INVALID-PR-TEMPLATE PR's body doesn't match template needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants