From 057188d1550116f8f71cf21ffbf90b0c9e4341c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Oliv=C3=A9?= Date: Wed, 24 May 2023 13:41:21 +0200 Subject: [PATCH] =?UTF-8?q?[MMI]=C2=A0Add=20code=20fences=20in=20signature?= =?UTF-8?q?-request=20(#18770)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Started adding code fences in signature-request * Finished code fencing * Improving code * Fixed storybook and code fences bundle * Added missing dependency * Fixed yarn.lock * Fixing policies * Updated package.json * updating lavamoat * lavamoat fix * adds missing package * runs yarn dedupe * updates method name * run lavamoat:auto again * Added more code fences * updates snapshot * snapshot updates * updates mmi packages to lighter versions * updates mmi packages * runs lavamoat auto * updates yarn lock and runs lavamoat auto * updates yarn lock * updates targets file * Removed console log and added tests --------- Co-authored-by: António Regadas Co-authored-by: Brad Decker Co-authored-by: Antonio Regadas --- coverage-targets.js | 8 +- lavamoat/build-system/policy.json | 71 ++++- package.json | 3 +- .../account-list-item-component.test.js.snap | 1 + .../account-list-item-component.test.js | 25 +- .../account-list-item/account-list-item.js | 20 +- .../signature-request-original.component.js | 11 - .../signature-request-siwe-header.js | 3 + ...ture-request-header.component.test.js.snap | 136 ++++++++++ .../signature-request-header.component.js | 9 +- ...signature-request-header.component.test.js | 23 ++ .../signature-request.component.js | 24 ++ .../signature-request.container.js | 130 +++++++++- ...nt-mismatch-warning.component.test.js.snap | 1 + .../account-mismatch-warning.component.js | 5 +- ...irm-decrypt-message.component.test.js.snap | 2 + ...cryption-public-key.component.test.js.snap | 2 + .../institutional/institution-background.ts | 18 +- yarn.lock | 242 ++++++++++++++++-- 19 files changed, 675 insertions(+), 59 deletions(-) create mode 100644 ui/components/app/signature-request/signature-request-header/__snapshots__/signature-request-header.component.test.js.snap create mode 100644 ui/components/app/signature-request/signature-request-header/signature-request-header.component.test.js diff --git a/coverage-targets.js b/coverage-targets.js index 1b49a117e..c9b4ac370 100644 --- a/coverage-targets.js +++ b/coverage-targets.js @@ -6,10 +6,10 @@ // subset of files to check against these targets. module.exports = { global: { - lines: 71.12, - branches: 58.94, - statements: 70.58, - functions: 63.84, + lines: 71.15, + branches: 59.17, + statements: 70.6, + functions: 63.82, }, transforms: { branches: 100, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index e41d0153c..166b663a6 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -980,6 +980,7 @@ "packages": { "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>are-we-there-yet": true, "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>console-control-strings": true, "@storybook/react>@storybook/node-logger>npmlog>console-control-strings": true, "nyc>yargs>set-blocking": true } @@ -1008,6 +1009,9 @@ "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>aproba": true, "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>string-width": true, "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>strip-ansi": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>console-control-strings": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>has-unicode": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>wide-align": true, "@storybook/react>@storybook/node-logger>npmlog>console-control-strings": true, "@storybook/react>@storybook/node-logger>npmlog>gauge>has-unicode": true, "@storybook/react>@storybook/node-logger>npmlog>gauge>wide-align": true, @@ -1133,11 +1137,33 @@ "@metamask/jazzicon>color>color-convert>color-name": true } }, + "@sentry/cli>mkdirp": { + "builtin": { + "fs": true, + "path.dirname": true, + "path.resolve": true + } + }, "@storybook/addon-knobs>qs": { "packages": { "string.prototype.matchall>side-channel": true } }, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>has-unicode": { + "builtin": { + "os.type": true + }, + "globals": { + "process.env.LANG": true, + "process.env.LC_ALL": true, + "process.env.LC_CTYPE": true + } + }, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>wide-align": { + "packages": { + "yargs>string-width": true + } + }, "@storybook/core>@storybook/core-server>x-default-browser>default-browser-id>untildify>os-homedir": { "builtin": { "os.homedir": true @@ -4886,9 +4912,20 @@ }, "packages": { "@storybook/core>@storybook/core-server>x-default-browser>default-browser-id>untildify>os-homedir": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": true, "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": true } }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": { + "builtin": { + "os.homedir": true + }, + "globals": { + "process.env": true, + "process.getuid": true, + "process.platform": true + } + }, "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": { "globals": { "process.env.SystemRoot": true, @@ -4910,9 +4947,34 @@ "setTimeout": true }, "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": true, "nyc>glob": true } }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": { + "builtin": { + "assert": true, + "events.EventEmitter": true, + "fs": true, + "path.join": true, + "path.resolve": true, + "util": true + }, + "globals": { + "console.error": true, + "process.cwd": true, + "process.nextTick": true, + "process.platform": true + }, + "packages": { + "eslint>minimatch": true, + "gulp-watch>path-is-absolute": true, + "nyc>glob>fs.realpath": true, + "nyc>glob>inflight": true, + "pump>once": true, + "pumpify>inherits": true + } + }, "gulp-watch>chokidar>fsevents>node-pre-gyp>semver": { "globals": { "console": true, @@ -8246,14 +8308,7 @@ "path.dirname": true }, "packages": { - "stylelint>file-entry-cache>flat-cache>write>mkdirp": true - } - }, - "stylelint>file-entry-cache>flat-cache>write>mkdirp": { - "builtin": { - "fs": true, - "path.dirname": true, - "path.resolve": true + "@sentry/cli>mkdirp": true } }, "stylelint>global-modules": { diff --git a/package.json b/package.json index 803b024b9..8fab87ec7 100644 --- a/package.json +++ b/package.json @@ -216,7 +216,8 @@ "@keystonehq/metamask-airgapped-keyring": "^0.9.2", "@lavamoat/snow": "^1.5.0", "@material-ui/core": "^4.11.0", - "@metamask-institutional/portfolio-dashboard": "1.1.2", + "@metamask-institutional/extension": "^0.1.3", + "@metamask-institutional/portfolio-dashboard": "^1.1.3", "@metamask/address-book-controller": "^2.0.0", "@metamask/announcement-controller": "^3.0.0", "@metamask/approval-controller": "^2.1.0", diff --git a/ui/components/app/account-list-item/__snapshots__/account-list-item-component.test.js.snap b/ui/components/app/account-list-item/__snapshots__/account-list-item-component.test.js.snap index 459d3357e..cc47406ef 100644 --- a/ui/components/app/account-list-item/__snapshots__/account-list-item-component.test.js.snap +++ b/ui/components/app/account-list-item/__snapshots__/account-list-item-component.test.js.snap @@ -79,6 +79,7 @@ exports[`AccountListItem Component render should match snapshot 1`] = ` >