safe-react icon indicating copy to clipboard operation
safe-react copied to clipboard

[WIP] Delegates management PoC

Open DiogoSoaress opened this issue 2 years ago • 7 comments

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

Screenshot 2022-05-27 at 09 10 58

DiogoSoaress avatar May 27 '22 07:05 DiogoSoaress

CLA Assistant Lite All Contributors have signed the CLA.

github-actions[bot] avatar May 27 '22 07:05 github-actions[bot]

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

github-actions[bot] avatar May 27 '22 07:05 github-actions[bot]

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 Coverage Status
Change from base Build 2468503349: -36.6%
Covered Lines: 0
Relevant Lines: 9658

💛 - Coveralls

coveralls avatar May 27 '22 07:05 coveralls

Deployment links

:white_circle: Mainnet     :purple_circle: Polygon     :orange_circle: Rinkeby

github-actions[bot] avatar May 27 '22 07:05 github-actions[bot]

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.

iamacook avatar May 27 '22 07:05 iamacook

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

DiogoSoaress avatar May 29 '22 10:05 DiogoSoaress

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.

iamacook avatar May 29 '22 10:05 iamacook