Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Transaction styling #3181

Merged
merged 83 commits into from
Dec 2, 2019
Merged

Transaction styling #3181

merged 83 commits into from
Dec 2, 2019

Conversation

mariopino
Copy link
Contributor

Closes #3078

Description:

Implement the new transaction page design:

image

Bonus: Add support for multisend transactions.

Thank you! 🚀


For contributor:

  • Added changes entries. Run yarn changelog for a guided process.
  • Reviewed Files changed in the github PR explorer
  • Attach screenshots of the UI components on the PR description (if applicable)
  • Scope of work approved for big PRs

For reviewer:

  • Manually tested the changes on the UI

@jbibla
Copy link
Collaborator

jbibla commented Nov 22, 2019

really nice work mario!

  • let's add a slight animation / transition to the extra info box
  • the background color of the tx should change on hover (like with li-validators)
  • we have new icons we can use (but i don't think fabo likes them 🤭)
  • there are a number of alignment and spacing issues that need to be addressed - and many places where there are extra spaces or not enough spaces

Screen Shot 2019-11-22 at 11 50 54 AM

@mariopino
Copy link
Contributor Author

Thanks! I saw that there is room to improve in the mobile view :-D The transition was on my plans, for sure and will follow the rest of your suggestions.

@jbibla
Copy link
Collaborator

jbibla commented Nov 22, 2019

@fedekunze i know this PR is close to your heart - you can check it out here https://deploy-preview-3181--lunieio.netlify.com/

@codecov
Copy link

codecov bot commented Nov 23, 2019

Codecov Report

Merging #3181 into develop will increase coverage by 0.68%.
The diff coverage is 99.16%.

@@             Coverage Diff             @@
##           develop    #3181      +/-   ##
===========================================
+ Coverage    88.15%   88.83%   +0.68%     
===========================================
  Files          126      125       -1     
  Lines         1832     1908      +76     
  Branches       275      291      +16     
===========================================
+ Hits          1615     1695      +80     
+ Misses         210      206       -4     
  Partials         7        7
Impacted Files Coverage Δ
src/components/transactions/TransactionList.vue 90% <ø> (+25%) ⬆️
src/components/wallet/PageTransactions.vue 47.82% <ø> (ø) ⬆️
src/components/transactions/messageTypes.js 100% <ø> (ø) ⬆️
...ransactions/message-view/DepositMessageDetails.vue 100% <100%> (ø) ⬆️
...sactions/message-view/UndelegateMessageDetails.vue 100% <100%> (ø) ⬆️
src/vuex/modules/connection.js 100% <100%> (ø) ⬆️
src/components/network/PageBlock.vue 50% <100%> (+2.17%) ⬆️
src/components/transactions/TransactionItem.vue 100% <100%> (ø) ⬆️
...ions/message-view/SubmitProposalMessageDetails.vue 100% <100%> (ø) ⬆️
...ge-view/WithdrawDelegationRewardMessageDetails.vue 100% <100%> (ø) ⬆️
... and 16 more

@faboweb
Copy link
Collaborator

faboweb commented Nov 23, 2019

Improvement idea: Use icons for the meta information.
Currently the information looks very noisy.
Also: It necessary to hide the transaction details like the recipient validator. I think they are very important. @jbibla

@mariopino
Copy link
Contributor Author

Also: It necessary to hide the transaction details like the recipient validator. I think they are very important. @jbibla

What do you mean?

},
computed: {
icon() {
if (this.transactionType === `Sent`) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you know ob the object switch approach?

const dictionary = {
  keyA: value,
  keyB: value
}

const valueForKey = dictionary[key]

Copy link
Contributor Author

@mariopino mariopino Nov 25, 2019

Choose a reason for hiding this comment

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

Definitely more cleaner but as I need to make some comparisons for Withdrawal, Vote and Deposit types like:

} else if (this.transactionType.search('Voted') === 0) {

It's possible to do that in a dictionary?

Another option is just to simplify the caption for that messages and include the info in the tx detail, then we can use a dictionary. Maybe a better solution.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks funky to me. What are the options for transactionType that there are multiple with Voted in it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah I think you are on the right track. there should be an enum "transactionType" that should be different then the title.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I finally implemented that way. The icon name should be the caption string, so that way we don't need a dictionary, only need to handle Update withdraw address, which is the only specific case. A bit hacky but simplier :-)

computed: {
    icon() {
      if (this.transactionType.indexOf(` `) !== -1) {
        if (this.transactionType === `Update withdraw address`) {
          return `/img/icons/activity/Withdrawal.svg`
        } else {
          return `/img/icons/activity/${this.transactionType.substr(
            0,
            this.transactionType.indexOf(` `)
          )}.svg`
        }
      } else {
        return `/img/icons/activity/${this.transactionType}.svg`
      }
    }
  }

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am still worried, that the transactionType is the title of the transaction. If we change the title now, we need to change the name of the icon. feels like an unnecessary linkage. But we can improve later.

@mariopino
Copy link
Contributor Author

Hey @jbibla, we have some missing icons for:

  • Create validator
  • Edit validator
  • Submitted proposal
  • Unjail

@mariopino
Copy link
Contributor Author

Hey @jbibla, we have some missing icons for:

  • Create validator
  • Edit validator
  • Submitted proposal
  • Unjail

Also having a generic icon could be useful, just to have a fallback.

@jbibla
Copy link
Collaborator

jbibla commented Nov 29, 2019

Screen Shot 2019-11-29 at 4 27 38 PM

Screen Shot 2019-11-29 at 4 27 54 PM

@jbibla
Copy link
Collaborator

jbibla commented Nov 29, 2019

this is done IMO and should be merged as soon as possible.

i think @mariopino and @Bitcoinera encountered a number of issues while working on this code — please make sure you open issues so we can fix these problems in the future!

@mariopino
Copy link
Contributor Author

Looks great! New format is missing in multisend though, you can check it signing with cosmos1z8mzakma7vnaajysmtkwt4wgjqr2m84tzvyfkz

@faboweb
Copy link
Collaborator

faboweb commented Nov 30, 2019

Great seeing Jordan helping out the team here!!

},
computed: {
icon() {
if (this.transactionType.indexOf(` `) !== -1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still have concerns around these string searches in comparison to some enum. Also transactionType is used here as title which I think is a bad naming.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True! let's do an small refactor (no new features, I promise! ;-)).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@faboweb i think it should be in a new PR!

return transaction.value.amount[0]
} else {
return transaction.value.amount
}
}

export const getMultiSendCoin = (transaction, sessionAddress) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Misses a comment, why this is necessary

</div>
</template>

<script>
import TransactionIcon from "./TransactionIcon"
import TransactionDetails from "./TransactionDetails"
import { messageType } from "./messageTypes.js"
Copy link
Collaborator

Choose a reason for hiding this comment

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

here is the messageType enum I would have liked to see in the icon handling as well. no need for a separate form of declaring the types.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But we can do that as a follow up.

mariopino and others added 2 commits December 2, 2019 11:58
@faboweb faboweb merged commit b9566b9 into develop Dec 2, 2019
@faboweb faboweb deleted the mario/3078-improve-transaction-styling branch December 2, 2019 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve transaction styling
4 participants