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: add account type tag label #7641

Merged
merged 19 commits into from
Nov 9, 2023
Merged

Conversation

stanleyyconsensys
Copy link
Contributor

@stanleyyconsensys stanleyyconsensys commented Oct 30, 2023

Description

Enable account type tag label

  • Add account type tag label on the right hand side of the account address to display it's account type
    • when account type is QR, it will show QR Hardware
    • when account type is simple, it will show Imported
  • Update existing account type tag label render in some components , to show the label when it is QR or simple
  • Add utils method getKeyringByAddress to get keyring by address for reuse logic purpose
  • Add utils method isHardwareAccount to determined address is hardware account or not
  • add utils method getLabelTextByAddress to return label transaction key base on account type
  • add unit test for affecting components
    • replace invalid address 0x0 and 0x1 to correct format eth address to make the tests more robust.

Related issues

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@stanleyyconsensys stanleyyconsensys added team-accounts Ledger Ledger hardware wallet related issue or development labels Oct 30, 2023
@github-actions
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 INVALID-PR-TEMPLATE PR's body doesn't match template and removed INVALID-PR-TEMPLATE PR's body doesn't match template labels Oct 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (86a6593) 34.99% compared to head (34055ac) 35.08%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7641      +/-   ##
==========================================
+ Coverage   34.99%   35.08%   +0.08%     
==========================================
  Files        1034     1034              
  Lines       27537    27530       -7     
  Branches     2298     2301       +3     
==========================================
+ Hits         9637     9658      +21     
+ Misses      17387    17355      -32     
- Partials      513      517       +4     
Files Coverage Δ
...ts-temp/Accounts/AccountBalance/AccountBalance.tsx 100.00% <ø> (ø)
...ts-temp/Accounts/AccountBase/AccountBase.styles.ts 100.00% <ø> (ø)
...ents/Pickers/PickerAccount/PickerAccount.styles.ts 100.00% <ø> (ø)
app/components/UI/AccountInfoCard/index.js 100.00% <100.00%> (+4.54%) ⬆️
app/components/UI/AddressInputs/index.js 82.85% <100.00%> (+0.50%) ⬆️
...roveTransactionHeader/ApproveTransactionHeader.tsx 80.00% <100.00%> (+0.45%) ⬆️
app/components/UI/WalletAccount/WalletAccount.tsx 83.33% <ø> (ø)
...s/SendFlow/AddressElement/AddressElement.styles.ts 100.00% <ø> (ø)
app/util/address/index.js 60.60% <100.00%> (+6.91%) ⬆️
...mponents-temp/Accounts/AccountBase/AccountBase.tsx 60.00% <0.00%> (-15.00%) ⬇️
... and 6 more

... and 4 files with indirect coverage changes

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

@dawnseeker8 dawnseeker8 marked this pull request as ready for review November 1, 2023 04:00
@dawnseeker8 dawnseeker8 requested a review from a team as a code owner November 1, 2023 04:00
Copy link
Contributor

github-actions bot commented Nov 1, 2023

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9d5dedcb-3171-43df-aef9-9f82cc30107c
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

NicolasMassart
NicolasMassart previously approved these changes Nov 6, 2023
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Nice work!
I only added a few suggestions, but nothing that should prevent this to go through.

app/components/UI/DrawerView/index.js Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Nov 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug C 4 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

71.2% 71.2% Coverage
0.0% 0.0% Duplication

@dawnseeker8 dawnseeker8 merged commit 7ab69f4 into main Nov 9, 2023
26 checks passed
@dawnseeker8 dawnseeker8 deleted the feat/add-account-type-tag branch November 9, 2023 11:24
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2023
@metamaskbot metamaskbot added the release-7.12.0 Issue or pull request that will be included in release 7.12.0 label Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ledger Ledger hardware wallet related issue or development release-7.12.0 Issue or pull request that will be included in release 7.12.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants