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

Jordan/2188 page network bug #2214

Merged
merged 14 commits into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions PENDING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### Added
### Fixed

- [\#1959](https://github.com/cosmos/voyager/issues/1959) display transactions on block page @fedekunze
- [#\2188](https://github.com/cosmos/voyager/issues/2188) Fixed issues with the way we were loading PageNetwork @jbibla
- [#\2246](https://github.com/cosmos/voyager/issues/2246) Fix from moniker not visible on withdraw txs @faboweb

### Fixed
### Added

- [#\2246](https://github.com/cosmos/voyager/issues/2246) Fix from moniker not visible on withdraw txs @faboweb
- [\#1959](https://github.com/cosmos/voyager/issues/1959) display transactions on block page @fedekunze
23 changes: 12 additions & 11 deletions app/src/renderer/components/common/TmDataConnecting.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<template>
<tm-data-msg>
<div slot="title">
Waiting for connection
<div class="tm-data-msg">
<img class="tm-data-msg__icon" src="~assets/images/loader.svg">
<div class="tm-data-msg__text">
<div slot="title" class="tm-data-msg__title">
Finding connection
</div>
<div slot="subtitle" class="tm-data-msg__subtitle">
You are currently not connected to a node. We will load this information
when a connection is established.
</div>
</div>
<div slot="subtitle">
You are currently not connected to a node. Voyager will load this data
when a connection is established.
</div>
</tm-data-msg>
</div>
</template>

<script>
import TmDataMsg from "common/TmDataMsg"
export default {
name: `tm-data-connecting`,
components: { TmDataMsg }
name: `tm-data-connecting`
}
</script>
40 changes: 28 additions & 12 deletions app/src/renderer/components/common/TmPage.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
<template>
<div class="tm-page">
<tm-page-header v-if="!hideHeader" :tabs="tabs">
<h2 v-if="title" slot="title">
<tm-page-header
v-if="!hideHeader"
:tabs="tabs"
>
<h2
v-if="title"
slot="title"
>
{{ title }}
</h2>
<h3 v-if="subtitle" slot="subtitle">
<h3
v-if="subtitle"
slot="subtitle"
>
{{ subtitle }}
</h3>
<slot slot="menu-body" name="menu-body">
<slot
slot="menu-body"
name="menu-body"
>
<tm-balance v-if="session.signedIn" />
<tool-bar :refresh="refreshable" />
</slot>
<slot slot="header-buttons" name="header-buttons" />
<slot
slot="header-buttons"
name="header-buttons"
/>
</tm-page-header>
<main class="tm-page-main">
<card-sign-in-required v-if="signInRequired && !session.signedIn" />
Expand All @@ -20,13 +35,14 @@
<tm-data-loading v-else-if="!loaded && loading" />
<tm-data-error v-else-if="error" />
<slot
v-else-if="
(!dataset || dataset.length === 0) && this.$slots['no-data']
"
v-else-if="dataEmpty && this.$slots['no-data']"
name="no-data"
/>
<tm-data-empty v-else-if="!dataset || dataset.length === 0" />
<slot v-else name="managed-body" />
<tm-data-empty v-else-if="dataEmpty" />
<slot
v-else
name="managed-body"
/>
</template>
<slot />
</main>
Expand Down Expand Up @@ -86,8 +102,8 @@ export default {
type: Boolean,
default: undefined
},
dataset: {
type: Array,
dataEmpty: {
type: Boolean,
default: undefined
},
refresh: {
Expand Down
11 changes: 1 addition & 10 deletions app/src/renderer/components/governance/PageGovernance.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<template>
<tm-page
:tabs="tabs"
:dataset="proposalList"
search="proposals"
class="governance"
data-title="Governance"
>
<tm-page :tabs="tabs" class="governance" data-title="Governance">
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we cover the case when we have no proposals with the new Boolean dataEmpty?

Copy link
Collaborator Author

@jbibla jbibla Mar 12, 2019

Choose a reason for hiding this comment

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

yes, we do. but currently the logic for this is in TabProposals, not PageGov. Our page structure is a bit funny. But this is not needed here, now.

#2237 #2060

<tm-btn
v-if="session.signedIn"
id="propose-btn"
Expand Down Expand Up @@ -54,9 +48,6 @@ export default {
`connected`,
`session`
]),
proposalList() {
return Object.values(this.proposals.proposals)
}
},
mounted() {
this.ps = new PerfectScrollbar(this.$el.querySelector(`.tm-page-main`))
Expand Down
12 changes: 7 additions & 5 deletions app/src/renderer/components/network/PageNetwork.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<tm-page data-title="Network">
<tm-data-error v-if="!connected" />
<template v-else>
<tm-page
:loading="!lastHeader"
:loaded="!!lastHeader"
:error="blocks.error"
data-title="Network"
>
<template slot="managed-body">
<div class="page-profile__header page-profile__section network">
<div class="row">
<div class="page-profile__header__info">
Expand Down Expand Up @@ -100,13 +104,11 @@ import moment from "moment"
import { mapGetters } from "vuex"
import num from "scripts/num"
import PanelSort from "staking/PanelSort"
import TmDataError from "common/TmDataError"
import TmPage from "common/TmPage"
export default {
name: `page-network`,
components: {
PanelSort,
TmDataError,
TmPage
},
data: () => ({
Expand Down
5 changes: 4 additions & 1 deletion app/src/renderer/components/wallet/PageTransactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:loading="transactions.loading"
:loaded="transactions.loaded"
:error="transactions.error"
:dataset="orderedTransactions"
:data-empty="dataEmpty"
:refresh="refreshTransactions"
data-title="Transactions"
:sign-in-required="true"
Expand Down Expand Up @@ -73,6 +73,9 @@ export default {
[this.sort.property],
[this.sort.order]
)
},
dataEmpty() {
return this.orderedTransactions.length === 0
}
},
watch: {
Expand Down
12 changes: 8 additions & 4 deletions app/src/renderer/components/wallet/PageWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
:loading="wallet.loading"
:loaded="wallet.loaded"
:error="wallet.error"
:dataset="allBalances"
:data-empty="dataEmpty"
:refresh="queryWalletBalances"
data-title="Wallet"
:sign-in-required="true"
>
<tm-data-msg id="account_empty_msg" slot="no-data" icon="help_outline">
<tm-data-msg
id="account_empty_msg"
slot="no-data"
icon="help_outline"
>
<div slot="title">
Account empty
</div>
Expand Down Expand Up @@ -72,8 +76,8 @@ export default {
}
return balances
},
allBalances() {
return this.wallet.balances
dataEmpty() {
return this.wallet.balances.length === 0
},
filteredBalances() {
return orderBy(
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/components/common/TmPage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe(`TmPage`, () => {
store,
localVue,
propsData: {
dataset: [1, 2, 3],
dataEmpty: true
},
mocks: {
$route: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,31 @@ exports[`TmDataConnecting has the expected html structure 1`] = `
<div
class="tm-data-msg"
>
<div
<img
class="tm-data-msg__icon"
>
<i
class="material-icons"
>

</i>
</div>
src="~assets/images/loader.svg"
/>

<div
class="tm-data-msg__text"
>
<div
class="tm-data-msg__title"
slot="title"
>
<div>

Waiting for connection

</div>

Finding connection

</div>

<div
class="tm-data-msg__subtitle"
slot="subtitle"
>
<div>

You are currently not connected to a node. Voyager will load this data
when a connection is established.

</div>

You are currently not connected to a node. We will load this information
when a connection is established.

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`PageGovernance disables proposal creation if not connected 1`] = `
<div
class="tm-page governance"
data-title="Governance"
search="proposals"
>
<header
class="tm-page-header"
Expand Down Expand Up @@ -127,7 +126,6 @@ exports[`PageGovernance has the expected html structure 1`] = `
<div
class="tm-page governance"
data-title="Governance"
search="proposals"
>
<header
class="tm-page-header"
Expand Down
Loading