1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

76 Commits

Author SHA1 Message Date
Ariella Vu
e60af93f2a
Storybook: add TransactionListItem component page (#14786)
* TransactionListItem: add storybook page

* SB:TransactionListItem: update retry status

* SB:TranslationListItem: exclude CANCEL & RETRY

* TransactionListItem: exclude SIGNED status

* TransactionListItem: fix mock transactions

* SB:TransactionListItem: add isEarliestNonce param

* SB:TransactionListItem: fix args

* SB:TransactionListItem: add "Speed Up" params

* SB: add nonce to mock transactions
2022-06-03 12:50:23 -05:00
George Marshall
87bba78d1f
Updating all instances of Metamask to MetaMask in content, comments and tests (#14848) 2022-06-03 09:32:50 -07:00
George Marshall
8fcbebc546
Update design tokens library from 1.5 to 1.6 WIP (#14732)
* Updating account menu icon color

* Updating design-tokens and making appropriate updates to extension styles

* Adding more deprecated tags to colors

* Adding spinner and removing todo comment

* Remove comment

* Updates

* Updating snapshots

* More color and ui updates

* reverting transition change
2022-05-25 08:35:36 -07:00
Niranjana Binoy
0a10b425ea
Add New Tokens Found page (#14366) 2022-05-09 13:47:06 -04:00
Erik Marks
cef95f8733
Stop storing request and response objects in the permission activity log (#14485)
We currently store the JSON-RPC request and response objects in the permission activity log. The utility of doing this was always rather dubious, but never problematic. Until now.

In Flask, as the restricted methods have expanded in number, user secrets may be included on JSON-RPC message objects. This PR removes these properties from the permission activity log, and adds a migration which does the same to existing log objects. We don't interact with the log objects anywhere in our codebase, but we don't want unexpected properties to cause errors in the future should any log objects be retained.

This PR also updates relevant tests and test data. It makes a minor functional change to how a request is designated as a success or failure, but this should not change any behavior in practice.
2022-04-21 08:44:15 -07:00
filipsekulic
8cb1f4af2e
Renamed metametrics.new.js to metametrics.js (#14327) 2022-04-01 14:11:12 -05:00
Niranjana Binoy
afcc3a8f26
Token Value component for Tokens Detected page (#14274) 2022-04-01 11:52:22 -04:00
filipsekulic
59131f5da5
Deleted the old metametrics.js (#14292) 2022-03-31 12:10:19 -05:00
VSaric
8184b150cb
Redesign screen/page "List of networks" (#13560)
Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2022-03-31 09:41:39 -05:00
Alex Donesky
524e0aaf07
unbreak storybook (#14059) 2022-03-18 19:04:59 -05:00
David Walsh
b0c050fece
Dark Mode: Create Theme-friendly top left logo component (#13897)
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2022-03-11 10:45:13 -06:00
Guillaume Roux
23e6c073c4
Dark Theme setup and button theming (#13651)
* Add design-tokens and apply colors to button

* swap more colors

* tweak button and add dark theme switch to storybook

* tweak buttons

* fix typo

* remove comments

* add dep to ignored list

* fix linting issue

* fix linting issues

* Updating some styles and removing some deprecated buttons (#13742)

* Updating some styles and removing some deprecated buttons

* Warning button fixes

* Fixing warning text for darkmode

* bump design tokens and update storybook theme strategy

Co-authored-by: George Marshall <george.marshall@consensys.net>
2022-02-25 14:11:22 -08:00
George Marshall
a1eaa33b45
Installing design tokens and writing docs in storybook (#13657)
* Installing design tokens and writing docs in storybook

* Adding design-tokens to dep check ignore

* Link updates, Sentence casing, better css code formatting, other grammer fixes
2022-02-22 18:26:11 -08:00
Erik Marks
35ac762e10
Add Snaps via Flask (#13462)
This PR adds `snaps` under Flask build flags to the extension. This branch is mostly equivalent to the current production version of Flask, excepting some bug fixes and tweaks.

Closes #11626
2022-02-14 16:02:51 -08:00
Ariella Vu
a5b114c4f9
Use ActionableMessage for ConfirmAddSuggestionToken warnings (#13402)
* ConfirmAddSuggestedToken: update duplicate logic

* ConfirmAddSuggestedToken: update duplicate fn names

* ConfirmAddSuggestedToken: add ActionableMessage
- fixes #13347

* base-styles.scss: deprecate .warning

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedToken: clean JSDoc comments
- following GitHub suggestion commits

* ConfirmAddSuggestedToken: warning Learn More btn

* add zendesk-url constants
- use for ConfirmAddSuggestedToken & ImportToken pages

* storybook: add ConfirmAddSuggestedToken controls

* stories: add ConfirmAddSuggestedTokens states

* stories: rm unused args ConfirmAddSuggestedToken

* rn ZENDESK_URL -> ZENDESK_URLS

* AddSuggestedToken: check case-insensitive symbols

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2022-02-01 15:30:15 +00:00
George Marshall
4af7f250a2
Updating storybook docs (#13055)
* Updating and moving docs to .storybook/ folder and updating Button to be the standard of docs we want to strive for

* Capitalizing API
2022-01-07 12:30:37 -08:00
George Marshall
c95da7dbb6
Updating storybook webpack config and changing font paths (#13028) 2022-01-04 16:41:10 -08:00
Alex Donesky
1b6e58c417
Feat/collectibles the return (#12970)
* Wire collectibles frontend UI with controller data
2021-12-13 17:41:10 -06:00
Erik Marks
c03b6dd19b
Subject metadata cleanup (#13090)
This PR fixes some subject metadata-related issues that were missed in #13026.
2021-12-13 12:10:20 -08:00
Erik Marks
31cf7c10a4
Permission System 2.0 (#12243)
# Permission System 2.0

## Background

This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.

With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.

Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.

The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.

## Changes in Detail

First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.

- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.

Reviewers should focus their attention on the following files:

- `app/scripts/`
  - `metamask-controller.js`
    - This is where most of the integration work for the new `PermissionController` occurs.
      Some functions that were internal to the original controller were moved here.
  - `controllers/permissions/`
    - `selectors.js`
      - These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
    - `specifications.js`
      - The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
        See the `PermissionController` readme for details.
  - `migrations/068.js`
    - The new state should be cross-referenced with the controllers that manage it.
      The accompanying tests should also be thoroughly reviewed.

Some files may appear new but have just moved and/or been renamed:

- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
  - This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
  - A truncated version of `test/mocks/permission-controller.js`.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-06 19:16:49 -08:00
George Marshall
3054991c9b
Updating styles so they don't override fontawesome, removing duplicate addons (#12971) 2021-12-06 15:55:21 -08:00
George Marshall
4cd957953d
Updating Storybook base styles (#12862)
* Adding branding and updating styles for storybook docs

* Making code blocks light gray
2021-12-02 09:11:35 -08:00
George Marshall
854fc71ae7
Organizing storybook to echo app folder structure (#12796)
* Organizing storybook to echo app folder structure

* Updating new stories to follow new convention from develop
2021-12-01 11:27:57 -08:00
George Marshall
d72f7295a3
Docs/12367 Adding storybook essentials addons (#12393)
* Adding storybook essentials and documentation contribution guidelines

* Deprecation updates

* Update ui/2.DOCUMENTATION.stories.mdx

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>

* Updating spelling and adding label to i18n-party plugin in toolbar

Co-authored-by: kumavis <kumavis@users.noreply.github.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2021-10-29 07:22:07 -10:00
Niranjana Binoy
532927368d
Network Form Design and switch to full screen enhancements (#12302) 2021-10-25 16:38:43 -04:00
Etienne Dusseault
be0508d41e
Add send-hex-data-row to Storybook (#12085)
* send-hex-data

* id filename

* lint
2021-10-15 09:32:13 -02:30
Etienne Dusseault
1e5c0078dd
Add send-asset-row to Storybook (#12081)
* send-asset

* id filename
2021-10-15 09:30:36 -02:30
Etienne Dusseault
9de632e9d1
Fix contact-list Storybook (#12262) 2021-10-05 09:13:07 -05:00
ryanml
f741712255
Fixing confirmation screen storybook views (#12271) 2021-10-04 06:46:18 -07:00
ryanml
c14f46eb92
Fixing confirm-add-suggested-token storybook entry (#12261) 2021-10-01 09:07:29 -07:00
Etienne Dusseault
bf89226ca1
Add send-header to Storybook (#12084) 2021-09-29 13:43:18 -05:00
Etienne Dusseault
c2bbbdd19c
Add account-list component to Storybook (#12228) 2021-09-29 13:42:49 -05:00
Etienne Dusseault
bf4e565497
edit-gas-display (#12165) 2021-09-23 22:40:03 -03:00
Etienne Dusseault
3ec3baa3a1
send-content (#12167) 2021-09-23 22:39:22 -03:00
Etienne Dusseault
6b7444c257
Add add-recipient to Storybook (#12076) 2021-09-20 14:05:58 -05:00
kumavis
f472c2615a
CI - add metamaskbot comment "highlights" section for showing relevant storybook changes (#12095)
* ci/announce/highlight - add bot announcement section for "highlights" showing off important diffs + storybook highlights

* ci/announce/highlight - fix announcement message

* Update index.js

* xxx tmp xxx

* ci/announce/highlight - fix dirty file calculation

* ci/announce/highlight - try/catch wrap highlight generation for build stability

* ui - put fox emojis in the mascot component

* ci/announce/highlight - start storybook permalinks

* ci/announce/highlight - fix storybook permalink util

* ci/announce/highlight - fix storybook permalink util

* ci/announce/highlight - small styling fix

* storybook - use any easily predictable story id

* ci/announce/highlight - revert sample commit

* ci/announce/highlight - minimal documentation
2021-09-15 08:55:48 -10:00
Etienne Dusseault
d1d01f434d
Add contact-list-tab to Storybook (#12079) 2021-09-13 16:04:31 -05:00
Etienne Dusseault
68c5f23569
Add transaction-list to Storybook (#12011) 2021-09-13 16:01:29 -05:00
Alex Donesky
490d3b8d40
Integrate TokensController (#11552)
* Integrate controllers/tokensController

* address rebase issues

* small cleanup

* addressing feedback

* more feedback
2021-09-10 12:37:19 -05:00
Etienne Dusseault
09e79f273a
fix state problems with Storybook (#11984)
* fix state problems with Storybook

* lint

* lint

* Cleanup

Co-authored-by: ryanml <ryanlanese@gmail.com>
2021-09-07 13:51:41 -10:00
Etienne Dusseault
7d0d6013af
Add connected-accounts component to Storybook (#11637)
* name change

* add actions

* lintfix
2021-08-30 12:56:34 -10:00
Etienne Dusseault
7b4aac7755
Add connected-sites component to Storybook (#11415)
* connectd-sites

* fix image path for storybook

* lintfixd, namechange
2021-08-30 12:56:03 -10:00
Etienne Dusseault
46c4cc1966
Add confirm-add-suggested-token & confirm-add-token components to Storybook (#11175)
* add suggessted token

* lintfix

* lintfix

* silence use effect warning

* download token icons and use paths to avoid web urls

* lintifx

* Add confirm-add-token component to Storyboard (#11195)

* create story for add token

* change code

* add confirm add token story

* lintfix

* Update confirm-add-token.component.js

* Update confirm-add-token.component.js

* different token list for confirm add token

* lintfix

* Update confirm-add-suggested-token.component.js

* remove bnb png

* remove redundant images and fix storybook image path
2021-08-17 00:33:46 -05:00
Etienne Dusseault
71a9fe2ed1
Add confirm-token-transaction-base component to Storybook (#11414)
* confirm-token-transaction-base

* Update ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.stories.js

Co-authored-by: Brad Decker <git@braddecker.dev>

Co-authored-by: Brad Decker <git@braddecker.dev>
2021-08-17 00:33:32 -05:00
David Walsh
5e18013468
Fix Storybook components by updating state for 1559 (#11676) 2021-07-30 05:06:35 -05:00
Etienne Dusseault
96b0730a89
add confirm-encryption-public-key component to Storybook (#11364)
* confirm-encryption-public-key

* lintfix

* lintfix
2021-07-20 09:29:38 -07:00
ryanml
a69ed05141
Removing obsolete client-side transaction metrics events (#11329)
* Removing metametrics send count tracking

* Removing client side Transaction Completed and Canceled events
2021-06-24 15:37:44 -07:00
Etienne Dusseault
d260b81cd5
Add confirm-deploy-contract component to Storybook (#11211)
* confirm deploy contract

* use downloaded image
2021-06-15 14:20:15 -07:00
Etienne Dusseault
4c341d83ab
Add Approval Confirmation Screen component to Storybook (#10998)
* add metametrics wrapper

* add history dep

* provide test data and mock react router

* add first confirmaion screen

* figure out a way to mock match.params

* render token approval with data

* fix lockfile

* fix lint

* remove use effect

* lintfix

* add . for src paths

* litfix

* Add knobs to change redux store for confirm-approve component (Storybook) (#11135)

* add knob for domain

* knobify

* remove logs

* remove comment

* lintfix

* fix comments

* add background calls + metriccs event to storybook acctions

* lintfixxxx
2021-05-25 08:20:09 +08:00
Brad Decker
09d81ac5f2
remove the ui/app and ui/lib folders (#10911) 2021-04-28 14:53:59 -05:00