safe-global / safe-wallet-web

Safe{Wallet} – smart contract wallet for Ethereum (ex-Gnosis Safe multisig)
https://app.safe.global
GNU General Public License v3.0
311 stars 360 forks source link

iteration on Roles integration #3869

Open jfschwarz opened 1 week ago

jfschwarz commented 1 week ago

Taking into account the feedback points from design & QA, this PR improves the integration of role-based access control into the execution flow previously delivered with #3768.

Integrate into the main "execute or sign" card

Previously we've integrated the execution through a role as new card appearing above the default "execute or sign" card. As suggested by the wallet design team, we've now improved the user experience by enabling the execution through a role directly from the default form.

Call is allowed for the role:

image

Call is not allowed:

image

Logic: default execution as owner vs execution as role member

Handle edge cases with batch transactions

So far we didn't correctly handle cases where the Role mod expects a different multi-send address than the one used per default in Safe Wallet. This PR fixes it through a lookup of the multi-send address configured on the Roles mod and routing the batch transaction accordingly.

More user-friendly error messages for failing permission checks

Review the complete list of potential messages here.

github-actions[bot] commented 1 week ago

Branch preview

βœ… Deploy successful!

Website: https://role_multisend_fix--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6

Storybook: https://role_multisend_fix--walletweb.review.5afe.dev/storybook/

github-actions[bot] commented 1 week ago

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A

Report generated by eslint-plus-action

github-actions[bot] commented 1 week ago

πŸ“¦ Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. πŸ€–

πŸŽ‰ Global Bundle Size Decreased

Page Size (compressed)
global 1000.1Β KB (-1Β B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

github-actions[bot] commented 1 week ago

Coverage report

[!CAUTION] Test run failed

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
78.79% (-0.01% πŸ”»)
11440/14520
πŸ”΄ Branches
58.24% (+0.12% πŸ”Ό)
2789/4789
🟑 Functions
65.8% (+0.02% πŸ”Ό)
1837/2792
🟒 Lines
80.16% (-0.02% πŸ”»)
10306/12857
Show new covered files 🐣
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟒 |
`...` / index.tsx
| 87.1% | 70.59% | 100% | 87.78% | | 🟑 |
`...` / hooks.ts
| 79.38% | 60.81% | 81.08% | 78.99% |
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟒 |
`...` / index.tsx
|
82.35% (-8.82% πŸ”»)
|
66.67% (-16.67% πŸ”»)
|
50% (-12.5% πŸ”»)
|
83.87% (-9.68% πŸ”»)
|

Test suite run failed

Failed tests: 1/1417. Failed suites: 1/196.
``` ● ReviewSignMessageOnChain β€Ί can handle messages with EIP712Domain type in the JSON-RPC payload thrown: "Exceeded timeout of 5000 ms for a test. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." 23 | 24 | describe('ReviewSignMessageOnChain', () => { > 25 | test('can handle messages with EIP712Domain type in the JSON-RPC payload', async () => { | ^ 26 | jest.spyOn(web3, 'getWeb3ReadOnly').mockImplementation(() => new JsonRpcProvider()) 27 | jest.spyOn(useSafeInfo, 'default').mockImplementation( 28 | () => at test (src/components/tx-flow/flows/SignMessageOnChain/ReviewSignMessageOnChain.test.tsx:25:3) at Object.describe (src/components/tx-flow/flows/SignMessageOnChain/ReviewSignMessageOnChain.test.tsx:24:1) ```

Report generated by πŸ§ͺjest coverage report action from 6655d398c6c4e323c59da640aa3b96b5ff9efd61

github-actions[bot] commented 3 days ago

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A

Report generated by eslint-plus-action