safe-react
safe-react copied to clipboard
[WIP] Delegates management PoC
What it solves
Part of https://github.com/safe-global/safe-pm/issues/85
How this PR fixes it
A new Settings page was added under Delegates where it is possible to manage Safe delegates through the UI
How to test it
Go to Settings/Delegates and if you are a Safe's owner you will be able to add/remove delegates and modify existent delegates labels
Todo tasks
- [ ] Use Client GW SDK for /delegates calls once https://github.com/safe-global/safe-react-gateway-sdk/pull/72 is merged
~Allow to delete all delegates~
- [x] Only allow owners to edit/remove
Screenshots
CLA Assistant Lite All Contributors have signed the CLA.
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 | 1 | N/A |
- Result: :white_check_mark: success
- Annotations: 0 total
Report generated by eslint-plus-action
Pull Request Test Coverage Report for Build 2473926990
- 0 of 118 (0.0%) changed or added relevant lines in 12 files are covered.
- 3843 unchanged lines in 403 files lost coverage.
- Overall coverage decreased (-36.6%) to 0.0%
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
---|---|---|---|
src/config/index.ts | 0 | 1 | 0.0% |
src/routes/safe/components/Settings/Delegates/AddDelegateModal/style.ts | 0 | 1 | 0.0% |
src/routes/safe/components/Settings/Delegates/EditDelegateModal/style.ts | 0 | 1 | 0.0% |
src/routes/safe/components/Settings/Delegates/RemoveDelegateModal/style.ts | 0 | 1 | 0.0% |
src/routes/safe/components/Settings/Delegates/style.ts | 0 | 1 | 0.0% |
src/routes/safe/components/Settings/index.tsx | 0 | 2 | 0.0% |
src/logic/delegates/api/delegates.ts | 0 | 3 | 0.0% |
src/routes/safe/components/Settings/Delegates/RemoveDelegateModal/index.tsx | 0 | 5 | 0.0% |
src/routes/safe/components/Settings/Delegates/EditDelegateModal/index.tsx | 0 | 8 | 0.0% |
src/routes/safe/components/Settings/Delegates/AddDelegateModal/index.tsx | 0 | 10 | 0.0% |
<!-- | Total: | 0 | 118 |
Files with Coverage Reduction | New Missed Lines | % |
---|---|---|
src/components/CustomIconText/index.tsx | 1 | 0% |
src/components/forms/Field/index.tsx | 1 | 0% |
src/components/layout/Tooltip/index.tsx | 1 | 0% |
src/components/Providers/index.tsx | 1 | 0% |
src/components/ScanQRModal/style.ts | 1 | 0% |
src/components/WalletSwitch/index.tsx | 1 | 0% |
src/config/chain.d.ts | 1 | 0% |
src/logic/collectibles/store/actions/fetchCollectibles.ts | 1 | 0% |
src/logic/config/store/actions/index.ts | 1 | 0% |
src/logic/contracts/contracts.d.ts | 1 | 0% |
<!-- | Total: | 3843 |
Totals | |
---|---|
Change from base Build 2468503349: | -36.6% |
Covered Lines: | 0 |
Relevant Lines: | 9658 |
💛 - Coveralls
The CRUD looks great! Is it not possible to use the CGW atm? We should also save the delegates to the store so we can reference it to allow for delegate transaction proposal.
Despite having set a task to "implement delete all delegates" it seems there is no such endpoint AFAIK -> https://github.com/safe-global/safe-client-gateway/blob/main/src/routes/delegates/routes.rs
Despite having set a task to "implement delete all delegates" it seems there is no such endpoint AFAIK -> https://github.com/safe-global/safe-client-gateway/blob/main/src/routes/delegates/routes.rs
There are two delete endpoints. You can also use my open gateway SDK PR as a reference.