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

Billy/1053 balance header #1188

Merged
merged 23 commits into from
Sep 4, 2018
Merged

Billy/1053 balance header #1188

merged 23 commits into from
Sep 4, 2018

Conversation

okwme
Copy link
Contributor

@okwme okwme commented Aug 28, 2018

Closes #1053

Description:
Added the new header style to the wallet balance page. Needed to make some updates to tendermint/cosmos-ui#62 as well.

Including:

  • settings / preferences in icon bar
  • back button icon is most left
  • "claim" link doesn't appear if there are no rewards
  • incorporates the new "copy to clipboard" proposal improve copy to clipboard ux #1174
    • wasn't sure if my colors are right since the dims are done with opactiy settings and wanted to reuse the styles we have in our variables file.

Not sure if this should be merged into our develop branch or if we should be implementing all these larger layout changes into a single branch and then merge them all in at once for consistency in style.

Using the new header on other pages should follow this format in front of the menu slot:

tm-page
  template(slot="menu-body"): tm-balance(:unstakedAtoms="unstakedAtoms", totalRewards="100")
  div(slot="menu")
    vm-tool-bar
      a(@click='connected && updateBalances()' v-tooltip.bottom="'Refresh'" :disabled="!connected")
        i.material-icons refresh
      a(@click='setSearch()' v-tooltip.bottom="'Search'" :disabled="!somethingToSearch")
        i.material-icons search

Where unstakedAtoms, totalRewards & totalEarnings are strings that only show if they're truthy.

also update TmToolBar to consistent naming of VmToolBar do differentiate from the ui library TmToolBar

@okwme
Copy link
Contributor Author

okwme commented Aug 28, 2018

screenshot 2018-08-28 14 33 42
screenshot 2018-08-28 14 33 48

@okwme okwme changed the title Billy/1053 balance header WIP: Billy/1053 balance header Aug 28, 2018
@okwme
Copy link
Contributor Author

okwme commented Aug 28, 2018

e2es failing at this screen:

locally they fail because localstorage isn't persisting for the introduction popup

@okwme
Copy link
Contributor Author

okwme commented Aug 28, 2018

locally on the develop branch my e2e is failing because:

panic: listen tcp 0.0.0.0:26656: bind: address already in use

@faboweb could this have to do with the new multiple validator testing setup?

on circleci the log says:

(node:731) [DEP0016] DeprecationWarning: 'root' is deprecated, use 'global'
Xlib:  extension "RANDR" missing on display ":99".
[731:0828/123843.711219:ERROR:bus.cc(395)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[731:0828/123843.781245:ERROR:bus.cc(395)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
mainWindow opened
[731:0828/123843.788360:ERROR:bus.cc(395)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
Redirecting console output to logfile /home/circleci/project/testArtifacts/cli_home/main.log
Adding new peer: localhost

@codecov
Copy link

codecov bot commented Aug 28, 2018

Codecov Report

Merging #1188 into develop will increase coverage by 0.02%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #1188      +/-   ##
===========================================
+ Coverage    95.86%   95.89%   +0.02%     
===========================================
  Files           80       81       +1     
  Lines         1598     1608      +10     
  Branches        75       75              
===========================================
+ Hits          1532     1542      +10     
  Misses          60       60              
  Partials         6        6
Impacted Files Coverage Δ
app/src/renderer/components/common/VmToolBar.vue 100% <ø> (ø)
...src/renderer/components/common/PagePreferences.vue 100% <100%> (ø) ⬆️
app/src/renderer/components/common/TmBalance.vue 100% <100%> (ø)
...pp/src/renderer/components/staking/PageStaking.vue 100% <100%> (ø) ⬆️
app/src/renderer/vuex/getters.js 100% <100%> (ø) ⬆️
app/src/renderer/components/wallet/PageWallet.vue 94.73% <100%> (+0.14%) ⬆️
app/src/renderer/components/staking/PageBond.vue 100% <100%> (ø) ⬆️
app/src/renderer/components/wallet/PageSend.vue 100% <100%> (ø) ⬆️
...rc/renderer/components/wallet/PageTransactions.vue 100% <100%> (ø) ⬆️

@okwme okwme changed the title WIP: Billy/1053 balance header R4R: Billy/1053 balance header Aug 28, 2018
@okwme
Copy link
Contributor Author

okwme commented Aug 28, 2018

add config for disabling feature

@okwme okwme changed the title R4R: Billy/1053 balance header WIP: Billy/1053 balance header Aug 28, 2018
@okwme okwme changed the title WIP: Billy/1053 balance header Billy/1053 balance header Aug 29, 2018
@faboweb
Copy link
Collaborator

faboweb commented Aug 29, 2018

What does Vm stand for?

.h2 {{totalRewards}}
router-link(to="claim") Claim
.bottom
.address(@click="copy") {{address}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be it's own component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is it used anywhere else?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not yet. OK, we can extract it later.

package.json Outdated
@@ -98,7 +98,7 @@
"webpack-dev-server": "2.11.2"
},
"dependencies": {
"@tendermint/ui": "0.2.20",
"@tendermint/ui": "https://github.com/tendermint/ui.git#5493de3544dae62dfd8f8cc565076a2f161ce909",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's wait for a release to merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good

try {
await app.client.waitUntilTextExists(".tm-page-header-title", titleText)
} catch (error) {
console.log("failed trying to navigate to " + titleText)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a comment on why we need to check for errors here?

@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`VmToolBar has the expected html structure 1`] = `"<div class=\\"tm-tool-bar\\"><div class=\\"tm-tool-bar-container\\"><div class=\\"main\\"><a disabled=\\"disabled\\" class=\\"back\\"><i class=\\"material-icons\\">arrow_back</i></a><a class=\\"help\\"><i class=\\"material-icons\\">help_outline</i></a><a href=\\"#/preferences\\" class=\\"settings\\"><i class=\\"material-icons\\">settings</i></a><a id=\\"signOut-btn\\"><i class=\\"material-icons\\">exit_to_app</i></a></div></div></div>"`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we format the output to better readable?


exports[`TmBalance has the expected html structure before adding props 1`] = `"<div class=\\"header-balance\\"><div class=\\"top\\"><img src=\\"~assets/images/cosmos-logo.png\\" class=\\"icon\\"><div class=\\"total-atoms\\"><div class=\\"h3\\">Total Steak</div><div class=\\"h2\\">321</div></div><!----><!----><!----></div><div class=\\"bottom\\"><div class=\\"address\\">useraddress16876876876876876786876876876876876</div><div class=\\"success\\"><i class=\\"material-icons\\">check</i><span>Copied</span></div></div></div>"`;

exports[`TmBalance shows correct stats depending on props 1`] = `"<div class=\\"header-balance\\"><div class=\\"top\\"><img src=\\"~assets/images/cosmos-logo.png\\" class=\\"icon\\"><div class=\\"total-atoms\\"><div class=\\"h3\\">Total Steak</div><div class=\\"h2\\">321</div></div><div class=\\"unstaked-atoms\\"><div class=\\"h3\\">Unstaked Steak</div><div class=\\"h2\\">1337</div></div><div class=\\"total-earnings\\"><div class=\\"h3\\">Total Earnings</div><div class=\\"h2\\">1337</div></div><div class=\\"total-rewards\\"><div class=\\"h3\\">Total Rewards</div><div class=\\"group\\"><div class=\\"h2\\">1337</div><a href=\\"#/claim\\" class=\\"\\">Claim</a></div></div></div><div class=\\"bottom\\"><div class=\\"address\\">useraddress16876876876876876786876876876876876</div><div class=\\"success\\"><i class=\\"material-icons\\">check</i><span>Copied</span></div></div></div>"`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we format the outputs to better readable?

@okwme okwme added the blocked ✋ issues blocked by other implementations/issues label Aug 29, 2018
@okwme
Copy link
Contributor Author

okwme commented Aug 29, 2018

@Fabo Vm was a quick voyager specific rename of Tm. Wanted to avoid the confusion between two TmToolBar components. Happy to edit all of them if we come up w a voyager-specific-version-of-Tendermin/ui naming convention. Any suggestions?

@faboweb
Copy link
Collaborator

faboweb commented Aug 29, 2018

Just V or no prefix? -> Not a blocker from my side.

@faboweb
Copy link
Collaborator

faboweb commented Aug 30, 2018

I will get npm publish rights soon ;)

@faboweb faboweb removed the blocked ✋ issues blocked by other implementations/issues label Sep 4, 2018
@faboweb faboweb merged commit a045903 into develop Sep 4, 2018
@faboweb faboweb deleted the billy/1053-balance-header branch September 4, 2018 14:36
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.

2 participants