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

(Feature) [Spending Limit] Send funds#1276

Merged
fernandomg merged 19 commits intofeature/#413-SpendingLimit-in-appfrom
feature/#693-sendFunds-SpendingLimit
Sep 3, 2020
Merged

(Feature) [Spending Limit] Send funds#1276
fernandomg merged 19 commits intofeature/#413-SpendingLimit-in-appfrom
feature/#693-sendFunds-SpendingLimit

Conversation

@fernandomg
Copy link
Contributor

This PR closes #693, by:

  • enabling using spending limit amount when sending funds
  • tweaking send form to use spending limit or safe's funds
  • signing tx (despite this worked with the first attempt, I'm still curious how the Safe will be aware of the module's tx)

spending-limit-send-funds

- this allows to display data hash when there's no info to display
- also helps to decode data that has not being decoded by the backend and the frontend can do
…ormation

- same layout as the Remove tx modal
several things going on here.
- The txs is under the `custom tx` umbrella, instead of `Modify settings` one.
- This is a WIP as there's still missing SpendingLimitTxExecute information
- also, I'm not ok with how the components are structured
@fernandomg fernandomg self-assigned this Aug 25, 2020
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Aug 25, 2020

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 1 0
Ignored 1 N/A
  • Result: ✅ success

  • Annotations: 1 total


[warning] @typescript-eslint/explicit-module-boundary-types

Require explicit return and argument types on exported functions' and classes' public class methods


Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Aug 25, 2020

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

@lukasschor
Copy link
Contributor

image

We should display Spending limit modifications in the transaction list with a gear icon and "Spending Limit" instead of "Contract Interactions"

When a spending limit is added / changed / removed, we should say "Modify Spending Limit" instead of "New Spending Limit".
image

@lukasschor
Copy link
Contributor

image

Let's remove the "tx" in all Spending limit - related notifications

@ghost
Copy link

ghost commented Aug 27, 2020

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

…dFunds-SpendingLimit

# Conflicts:
#	src/routes/safe/store/actions/transactions/utils/multiSendDecodedDetails.ts
- close modal once the user confirms the tx
@fernandomg fernandomg marked this pull request as ready for review August 28, 2020 23:51
@ghost
Copy link

ghost commented Aug 29, 2020

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

@ghost
Copy link

ghost commented Sep 1, 2020

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

export const SPENDING_LIMIT_METHOD_TO_ID = {
'0xe71bdf41': 'addDelegate',
'0xbeaeb388': 'setAllowance',
'0x4515641a': 'executeAllowanceTransfer',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here we are using string instead of const defined in SPENDING_LIMIT_METHOD_NAMES.

I think you are trying to use same pattern used in
src/routes/safe/store/models/types/transactions.d.ts SAFE_METHOD_NAMES -> METHOD_TO_ID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, thanks for the catch

/>
</Col>
</Row>
{tokenSpendingLimit && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

This component is getting really big

Should we plan to extract some fragments into smaller child components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

honestly, I didn't want to jump into the refactor hell. So I decided, at the time, to keep everything in the same place.

But anyway, extracted the radioButtons-related row to a SpendingLimitRow component.

Any feedback is welcome.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine to keep it as is in this PR but address it in a different one.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Appreciate that some of the new additions were split on a new component.

I'm fine with it as long as a task of tech debt is added to backlog

@ghost
Copy link

ghost commented Sep 2, 2020

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

@fernandomg fernandomg requested a review from dasanra September 2, 2020 18:42
@ghost
Copy link

ghost commented Sep 2, 2020

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

/>
</Col>
</Row>
{tokenSpendingLimit && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Appreciate that some of the new additions were split on a new component.

I'm fine with it as long as a task of tech debt is added to backlog

@fernandomg fernandomg merged commit e3ddb1f into feature/#413-SpendingLimit-in-app Sep 3, 2020
@fernandomg fernandomg deleted the feature/#693-sendFunds-SpendingLimit branch September 3, 2020 18:04
@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 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