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 improve display and input components #2920

Conversation

weilbith
Copy link
Contributor

This PR got split out of a bigger PR that will come afterwards. It basically includes a couple a smaller improvements which will be used later.

This allows to specify an optional label for the amount display
component. Furthermore it can be set to be full width. This makes
basically only sense in combination with a label.

The display amount usage in the transfer component had to be adopted due
to these changes.

The unit tests of the amount display were extended, but also refactored
to align with the most recent standards.
This allows to specify an optional label for the address display
component. Furthermore it can be set to be full width. This makes
basically only sense in combination with a label.

The display amount usage in the transfer component had to be adopted due
to these changes.
Depending on where the address input component is used, the excluded
addresses are defined differently. The according error message when
a user types one of those addresses should reflect the specific case.
@weilbith
Copy link
Contributor Author

No CHANGELOG entry necessary for this. No new feature or bugfix for the user.

@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #2920 (db64faf) into master (c3e0fee) will decrease coverage by 0.70%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2920      +/-   ##
==========================================
- Coverage   93.77%   93.07%   -0.71%     
==========================================
  Files         116      199      +83     
  Lines        6348     8015    +1667     
  Branches     1140     1339     +199     
==========================================
+ Hits         5953     7460    +1507     
- Misses        340      458     +118     
- Partials       55       97      +42     
Flag Coverage Δ
dapp 87.11% <100.00%> (+6.53%) ⬆️
dapp.unit 87.11% <100.00%> (+6.53%) ⬆️
sdk 95.83% <ø> (-0.04%) ⬇️
sdk.e2e 74.35% <ø> (-0.06%) ⬇️
sdk.integration 79.62% <ø> (ø)
sdk.unit 49.26% <ø> (ø)

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

Impacted Files Coverage Δ
raiden-dapp/src/components/TokenInformation.vue 77.77% <ø> (ø)
...n-dapp/src/components/transfer/TransferHeaders.vue 94.44% <ø> (ø)
raiden-dapp/src/components/AddressDisplay.vue 78.26% <100.00%> (ø)
raiden-dapp/src/components/AddressInput.vue 97.00% <100.00%> (ø)
raiden-dapp/src/components/AmountDisplay.vue 100.00% <100.00%> (ø)
raiden-dapp/src/components/AmountInput.vue 96.82% <100.00%> (ø)
raiden-dapp/src/utils/balance-utils.ts 100.00% <100.00%> (ø)
raiden-ts/src/transfers/reducer.ts 94.44% <0.00%> (-0.93%) ⬇️
raiden-ts/src/transfers/epics/locked.ts 96.55% <0.00%> (-0.25%) ⬇️
raiden-dapp/src/views/NoConnectedTokenRoute.vue 100.00% <0.00%> (ø)
... and 82 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 c3e0fee...db64faf. Read the comment docs.

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.

LGTM 👍🏼

As he address input component can be configured to exclude a list of
addresses that are not allowed to be used, this ads the option to
restrict the input to a fixed list of allowed addresses. A practical use
case is for example the selection of a channel partner to make a deposit
to.

The unit tests of the amount input component are a nightmare. But that
became too big to easily improve them now.
When it fails to parse a balance for a token, instead of failing with an
uncaught error (e.g. amount display) it falls back to zero. This
lead automatically leads to all actions to fail due to a non-positive
amount.
The default for an empty amount input might be set to zero. Depending on
the decimals of the targeted token, this should switch between `0` and
`0.00`. This was formerly done by other components using the amount
input component. This got hereby simplified and keep it within this
component.
@weilbith
Copy link
Contributor Author

weilbith commented Sep 8, 2021

All feedback addressed. I'll will squash the fixup commits now.

@weilbith weilbith force-pushed the feature/dapp-improve-display-and-input-components branch from 64a8c4c to db64faf Compare September 8, 2021 11:51
@weilbith
Copy link
Contributor Author

weilbith commented Sep 8, 2021

I'll wait for the CI to confirm and then I'll merge. Afterwards I'll rebase #2921 on top of it.

@weilbith weilbith merged commit d0a25b0 into raiden-network:master Sep 8, 2021
@weilbith weilbith deleted the feature/dapp-improve-display-and-input-components branch September 8, 2021 12:04
# 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.

2 participants