Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature/dapp quick pay route #2930

Merged
merged 16 commits into from
Sep 14, 2021

Conversation

weilbith
Copy link
Contributor

@weilbith weilbith commented Sep 8, 2021

Thank you for submitting this pull request :)

Fixes #2882

Short description
The most exciting feature for the dApp since the connection manager 😬
All the previous refactoring enabled to do such nice thing like this.

Definition of Done

  • Steps to manually test the change have been documented
  • Acceptance criteria are met
  • Change has been manually tested by the reviewer (dApp)

Steps to manually test the change (dApp)

  1. Please checkout the image with the different cases in the linked issue.

@weilbith weilbith requested a review from taleldayekh September 8, 2021 14:39
@codecov
Copy link

codecov bot commented Sep 8, 2021

Codecov Report

Merging #2930 (ae40e3f) into master (18d3398) will decrease coverage by 0.04%.
The diff coverage is 90.99%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2930      +/-   ##
==========================================
- Coverage   93.37%   93.32%   -0.05%     
==========================================
  Files         203      207       +4     
  Lines        8598     8812     +214     
  Branches     1356     1381      +25     
==========================================
+ Hits         8028     8224     +196     
- Misses        473      487      +14     
- Partials       97      101       +4     
Flag Coverage Δ
dapp 89.03% <90.99%> (+0.18%) ⬆️
dapp.unit 89.03% <90.99%> (+0.18%) ⬆️
sdk 95.83% <ø> (ø)
sdk.e2e 72.34% <ø> (+0.17%) ⬆️
sdk.integration 79.71% <ø> (ø)
sdk.unit 49.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
raiden-dapp/src/components/AmountDisplay.vue 100.00% <ø> (ø)
raiden-dapp/src/components/TokenInformation.vue 83.33% <ø> (ø)
raiden-dapp/src/router/routes.ts 100.00% <ø> (ø)
raiden-dapp/src/views/TransferStepsRoute.vue 89.28% <ø> (ø)
raiden-dapp/src/components/ActionProgressCard.vue 88.00% <66.66%> (-3.31%) ⬇️
raiden-dapp/src/views/QuickPayRoute.vue 84.95% <84.95%> (ø)
...mponents/channels/ChannelOpenAndTransferAction.vue 94.73% <94.73%> (ø)
raiden-dapp/src/components/AddressInput.vue 99.10% <100.00%> (+<0.01%) ⬆️
raiden-dapp/src/components/AmountInput.vue 94.80% <100.00%> (+0.21%) ⬆️
...dapp/src/components/channels/ChannelActionForm.vue 100.00% <100.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18d3398...ae40e3f. Read the comment docs.

@weilbith
Copy link
Contributor Author

weilbith commented Sep 8, 2021

I need to add a CHANGELOG entry.

Copy link
Contributor

@taleldayekh taleldayekh left a comment

Choose a reason for hiding this comment

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

Went through this together with @weilbith and looks very good, thx! 👍🏼

@weilbith
Copy link
Contributor Author

@taleldayekh thanks for the nice review. I always appreciate that you take the time to do it together and discuss the details. Also thanks to always improve my user translations! 🙏🏾

@weilbith
Copy link
Contributor Author

I addressed all feedback. I'm very positive that I don't need an in-between CI confirmation. Therefore I'll go ahead and squash the fixups. Then I'll wait for CI to finally merge it.

@weilbith weilbith force-pushed the feature/dapp-quick-pay-route branch from 196fc1b to 3b6b449 Compare September 10, 2021 10:38
@weilbith
Copy link
Contributor Author

Sorry, I messed something up... So much to I'm optimistic.
We really need some basic commit/push hooks.

@weilbith weilbith force-pushed the feature/dapp-quick-pay-route branch from 3b6b449 to d7d257c Compare September 10, 2021 12:15
@andrevmatos
Copy link
Contributor

@weilbith can you rebase on top of master on next run, please? some dependencies updates (including jest/test related stuff) got merged. Hopefully it won't impact actual code nor conflict, but it'll be better to have that tested before merging. Thanks

@weilbith weilbith force-pushed the feature/dapp-quick-pay-route branch from d7d257c to 67ca27a Compare September 13, 2021 12:23
Depending on which of the values of the form are editable, this makes
the first input auto focused.

While the amount input already had the autofocus property implemented,
the address input did not and was in need of an extension.
This allows the parent component of a channel action form to be update
when then input value changes. The advantages of such a single event are
that it is debounced and limited to valid inputs per default, as well as
it does not require to force the usage of synced properties and thereby
make it more optional.
As the amount input component can be configured to not exceed a maximum
amount, this adds the feature to require a minimum amount.
This feature gets used/forwarded inside the channel action form.
When the Raiden service gets started, a hook is placed to prevent the
unloading of the page. This can be removed again once the service
disconnects again.
There is the use case that the SDK should automatically do a transfer.
This includes the whole detection if a direct transfer is possible or
not, getting the best path finding service and the cheapest route for
a mediated transfer. This does not work if the dApps Raiden service
requires a value for the path parameter.
Actions which have just a single step look kinda awkward if the progress
card displays this step. Though it still makes sense to have a step for
example for the description with the hints for the user what to do.
Actions do emit an event when they completed successfully or failed.
This adds another event to signal that the actions has been started.
This is helpful for the parent component to act accordingly.
While the amount input expects to work on a plain string, the amount
display requires the BigNumber value. In the channel action form both
components got feed with the same value for the amount. This does not
work and leads to errors. But the form component is already of this type
difference and has a computed property for it. Thereby the fix was very
simple.
This is a quite common error, especially for transfers to new
Raiden nodes. Even for us developers this happens from time to time in
our test setups. Then we have to waste time to find the original error
behind the else very generic error message. This shows the actual cause
and helps the user to solve the issue.
This includes actions which kinda contain of multiple actions, or rather
combine multiple actions which also exist standalone.
This allows to deposit more tokens into a channel and then do a direct
transfer through the same channel. The same works with first opening
a new channel and then a direct transfer.
This is very useful for straight forward transfers without user
interactions and a clear visual progress without interruptions.
The quick pay route is meant to do transfers without much effort my the
user. The URL must contain all information do to such a transfer. Then
no matter if the user has ever used Raiden, this specific token network
or what his connectivity and liquidity is, without one or two clicks he
can do a transfer.
Please checkout issue raiden-network#2882 for all the details of how the different
cases look like and how the decision tree must be implemented.
After all it is mostly just a smart combination of all the nice features
that have been refactored/added to the dApp recently.

This does not yet handle too low UDC deposits to pay for mediated
transfer route requests.
This adds two features. First it also allows the user to close the
dialog early when it was successful and it is not necessary to wait for
the timeout.
Second this adds a new event when the dialog gets closed by the user.
The transfer action was handled a little special in contrast to the
other actions. This included to show the progress inline. This got
unified in combination with a better error visualization.
All actions show their progress in a dialog now. The transfer action
just has some empty translations to make it less obtrusively as intended
before already. This allows to re-use the nice looking error
visualization of the action progress card in the dialog. It provides
more information and looks better. Before this was hidden by a second
error dialog on top of it.

This change did also allow to get rid of the extra functionality to hide
and display again the action message (which was only for the inline
progress of the transfer action).

Though there is still an error dialog remaining to handle all errors
which are not caused by actions themselves. For the moment this is only
the case for invalid query parameters.

Moreover does the changing of query parameters during an active action
not cancel this action anymore. Furthermore do action errors take
precedence.

Finally the closing of the action progress dialog will also cause the
direction. This solves a missing feature where the user was stuck for
failed actions, waiting for ever to get redirected. Second this allows
the user to get quicker redirected in case of a success by closing the
dialog manually. This became possible by a recent extension of the
action mixin.
@weilbith
Copy link
Contributor Author

Rebase as requested by Andre...

@weilbith weilbith force-pushed the feature/dapp-quick-pay-route branch from 67ca27a to b5a8c16 Compare September 13, 2021 12:37
@weilbith
Copy link
Contributor Author

Okay, apparently this did break something...

@weilbith
Copy link
Contributor Author

The Jest update changed the behavior of the toContain has changed.

The `toContain` function has changed and does not automatically adapt
the types anymore.
@weilbith
Copy link
Contributor Author

I don't know why the license/cla check is not reporting. But I'm the only one who contributed code to this PR. And I have signed. So I use my permissions to merge this PR anyway.

@weilbith weilbith merged commit 4817258 into raiden-network:master Sep 14, 2021
@weilbith weilbith deleted the feature/dapp-quick-pay-route branch September 14, 2021 08:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dApp - quick pay feature
3 participants