Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

(Feature) [Spending Limit] List of beneficiaries#1261

Merged
fernandomg merged 80 commits intofeature/#413-SpendingLimit-in-appfrom
feature/#1039-list-SpendingLimit
Sep 1, 2020
Merged

(Feature) [Spending Limit] List of beneficiaries#1261
fernandomg merged 80 commits intofeature/#413-SpendingLimit-in-appfrom
feature/#1039-list-SpendingLimit

Conversation

@fernandomg
Copy link
Contributor

@fernandomg fernandomg commented Aug 19, 2020

This PR closes #1039, by listing the beneficiaries and its spending limits.
Also, closes #692, by allowing the limit removal.
Also, will wait for this PR complete feedback to properly close #690.

spending-limit-list

Still WIP.

Refactored the code, for better organization. It's almost all contained in the src/routes/safe/components/Settings/SpendingLimit directory, as a first iteration I think it's ok and helps to find patterns and improvement points easily.

Some tweaks around tx creation: it'll be using multiSend txs only when it's needed (enable SpendingLimit module or adding a new delegate)

- marked `isValid` as optional, with default `true` value
- marked `initialValue` as optional
- migrated to hooks for material-ui styles
- migrated to hooks for material-ui styles
- make `label` parametrized and optional, with default value
- make `setIsValidAddress` optional
- migrated to hooks for material-ui styles
…w-SpendingLimit

# Conflicts:
#	src/routes/safe/components/Apps/index.tsx
Also:
- fixed styles
- handled form state while going back and forth between create and review
- had to change `Review` Button as submitting wasn't triggered on the first click.
- also refactored `ScanQRWrapper` so it uses the specified icon
…w-SpendingLimit

# Conflicts:
#	package.json
#	src/routes/safe/components/Apps/index.tsx
#	yarn.lock
- if the module is not enabled it will be enabled on the first tx
- beneficiary is added to the delegate list in the contract
- allowance is set

Still several things to address, like informing the user about an existing allowance, code cleanup
- create
- verify existent and inform the user
…m multiSend txs

- Added notifications messages (this is extremely verbose, not sure if I should only use the Settings messages)
@ghost
Copy link

ghost commented Aug 24, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

@ghost
Copy link

ghost commented Aug 24, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

1 similar comment
@ghost
Copy link

ghost commented Aug 24, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

@ghost
Copy link

ghost commented Aug 24, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

@lukasschor
Copy link
Contributor

image

Abbreviated addresses should have shortened with 4 leading and trailing characters, if possible. So this should be displayed as 0x83eC...0769.

@fernandomg
Copy link
Contributor Author

Abbreviated addresses should have shortened with 4 leading and trailing characters, if possible. So this should be displayed as 0x83eC...0769.

@lukasschor, ah. I just tried to be aligned with the owners' table. Starting with the long-shortened view and shrinking to 4 chars when the viewport is smaller (also hides the token icons).

adaptive-content

If it's not valid, then I'll definitively remove those behaviors.

@lukasschor
Copy link
Contributor

lukasschor commented Aug 24, 2020

We should generally move to standardize the addresses and either show full length or abbreviated with 4 chars (which should be the default, full address should only be an exception). We have started doing so here: #1174
It's not crucial to have this implemented everywhere immediately, but at least for new features, we should already take this into account.

@ghost
Copy link

ghost commented Aug 25, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

@lukasschor
Copy link
Contributor

lukasschor commented Aug 25, 2020

We should not display "UNKNOWN" for addresses where there is no address book entry.

See this ticket for reference: #1068

UPDATE: It seems like this is already the case, right? At least when I tested it did not show UNKNOWN.

export const TIMEOUT = process.env.NODE_ENV === 'test' ? 1500 : 5000
export const ETHERSCAN_API_KEY = process.env.REACT_APP_ETHERSCAN_API_KEY
export const SPENDING_LIMIT_MODULE_ADDRESS =
process.env.REACT_APP_SPENDING_LIMIT_MODULE_ADDRESS || '0x9e9Bf12b5a66c0f0A7435835e0365477E121B110'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This address should be named. I understand this is something will be removed later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly, this is there to make the feature work while on dev, as the variable is not set in the CI builds

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a task in [Backlog] - Stability saying that this should be reviewed before deployment

@ghost
Copy link

ghost commented Aug 26, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

@ghost
Copy link

ghost commented Aug 26, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

…ist-SpendingLimit

# Conflicts:
#	package.json
#	src/logic/safe/store/actions/fetchSafe.ts
#	src/routes/safe/components/Layout/index.tsx
#	yarn.lock
@fernandomg fernandomg requested a review from dasanra August 28, 2020 23:52
@github-actions
Copy link

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: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Aug 29, 2020

Travis automatic deployment:
https://pr1261--safereact.review.gnosisdev.com/app

@fernandomg fernandomg merged commit 1387ed4 into feature/#413-SpendingLimit-in-app Sep 1, 2020
@fernandomg fernandomg deleted the feature/#1039-list-SpendingLimit branch September 1, 2020 14:51
@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants