Skip to content

Commit

Permalink
replaced n/a with --
Browse files Browse the repository at this point in the history
  • Loading branch information
jbibla committed Mar 7, 2019
1 parent feb27c6 commit 12a2352
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 62 deletions.
26 changes: 13 additions & 13 deletions app/src/renderer/components/governance/TabParameters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{
governanceParameters.parameters.deposit.min_deposit
? minimumDeposit
: `n/a`
: `--`
}}
</dd>
</dl>
Expand All @@ -37,7 +37,7 @@
{{
governanceParameters.parameters.deposit.max_deposit_period
? depositPeriodInDays + ` days`
: `n/a`
: `--`
}}
</dd>
</dl>
Expand All @@ -62,9 +62,9 @@
{{
governanceParameters.parameters.tallying.threshold
? `${parseFloat(
governanceParameters.parameters.tallying.threshold
) * 100} %`
: `n/a`
governanceParameters.parameters.tallying.threshold
) * 100} %`
: `--`
}}
</dd>
</dl>
Expand All @@ -82,9 +82,9 @@
{{
governanceParameters.parameters.tallying.veto
? `${parseFloat(
governanceParameters.parameters.tallying.veto
) * 100} %`
: `n/a`
governanceParameters.parameters.tallying.veto
) * 100} %`
: `--`
}}
</dd>
</dl>
Expand All @@ -105,7 +105,7 @@
{{
governanceParameters.parameters.tallying.governance_penalty
? governanceParameters.parameters.tallying.governance_penalty
: `n/a`
: `--`
}}
</dd>
</dl>
Expand All @@ -124,9 +124,9 @@
{{
governanceParameters.parameters.tallying.quorum
? `${parseFloat(
governanceParameters.parameters.tallying.quorum
) * 100} %`
: `n/a`
governanceParameters.parameters.tallying.quorum
) * 100} %`
: `--`
}}
</dd>
</dl>
Expand All @@ -151,7 +151,7 @@
{{
governanceParameters.parameters.voting.voting_period
? votingPeriodInDays + ` days`
: `n/a`
: `--`
}}
</dd>
</dl>
Expand Down
25 changes: 17 additions & 8 deletions app/src/renderer/components/network/PageBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<div class="row">
<div class="page-profile__header__info">
<div class="page-profile__status-and-title">
<h2 class="page-profile__title">
Block {{ blockTitle }}
</h2>
<h2 class="page-profile__title">Block {{ blockTitle }}</h2>
<h3 class="page-profile__subtitle">
{{ block.block_meta && block.block_meta.block_id ? block.block_meta.block_id.hash : '' }}
{{
block.block_meta && block.block_meta.block_id
? block.block_meta.block_id.hash
: ""
}}
</h3>
</div>
</div>
Expand All @@ -29,7 +31,9 @@
<div class="column">
<dl class="info_dl colored_dl">
<dt>Transactions</dt>
<dd>{{ block.block && block.block.data.txs || `No Transactions` }}</dd>
<dd>
{{ (block.block && block.block.data.txs) || `No Transactions` }}
</dd>
</dl>
</div>
</div>
Expand All @@ -40,7 +44,12 @@
<div class="column">
<dl class="info_dl colored_dl">
<dt>Evidence</dt>
<dd>{{ block.block && block.block.evidence.evidence || `No Evidence` }}</dd>
<dd>
{{
(block.block && block.block.evidence.evidence) ||
`No Evidence`
}}
</dd>
</dl>
</div>
</div>
Expand Down Expand Up @@ -81,11 +90,11 @@ export default {
]
},
blockTitle({ num, block } = this) {
if (!block.block) return `n/a`
if (!block.block) return `--`
return `#` + num.prettyInt(block.block.header.height)
},
blockTime({ moment, block } = this) {
if (!block.block) return `n/a`
if (!block.block) return `--`
return moment(block.block.header.time).format(`MMM Do YYYY, HH:mm:ss`)
}
},
Expand Down
18 changes: 9 additions & 9 deletions app/src/renderer/components/network/PageNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
class="page-profile__status"
/>
<h2 class="page-profile__title">
{{ lastHeader.chain_id || `n/a` }}
{{ lastHeader.chain_id || `--` }}
</h2>
</div>
</div>
</div>
<div class="row">
<dl class="info_dl colored_dl">
<dt>Block Height</dt>
<dd>{{ `#` + num.prettyInt(lastHeader.height) || `n/a` }}</dd>
<dd>{{ `#` + num.prettyInt(lastHeader.height) || `--` }}</dd>
</dl>
<dl class="info_dl colored_dl">
<dt>Last Block</dt>
<dd>{{ lastBlock || `n/a` }}</dd>
<dd>{{ lastBlock || `--` }}</dd>
</dl>
<dl class="info_dl colored_dl">
<dt>Transactions</dt>
<dd>{{ lastHeader.total_txs || `n/a` }}</dd>
<dd>{{ lastHeader.total_txs || `--` }}</dd>
</dl>
<dl class="info_dl colored_dl">
<dt>Number of Validators</dt>
<dd>{{ delegates.delegates.length || `n/a` }}</dd>
<dd>{{ delegates.delegates.length || `--` }}</dd>
</dl>
</div>
<div class="row">
Expand All @@ -43,7 +43,7 @@
{{
pool.pool && pool.pool.not_bonded_tokens
? num.full(num.atoms(pool.pool.not_bonded_tokens))
: `n/a`
: `--`
}}
</dd>
</dl>
Expand All @@ -55,7 +55,7 @@
{{
pool.pool && pool.pool.bonded_tokens
? num.full(num.atoms(pool.pool.bonded_tokens))
: `n/a`
: `--`
}}
</dd>
</dl>
Expand All @@ -69,10 +69,10 @@
<tbody>
<tr v-if="blocks.length === 0" class="block data-table__row">
<td>
<img class="loading-icon" src="~assets/images/loader.svg">
<img class="loading-icon" src="~assets/images/loader.svg" />
</td>
<td>
<img class="loading-icon" src="~assets/images/loader.svg">
<img class="loading-icon" src="~assets/images/loader.svg" />
</td>
</tr>
<tr
Expand Down
13 changes: 6 additions & 7 deletions app/src/renderer/components/staking/LiValidator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
class="data-table__row__info__image"
width="48"
height="48"
>
/>
<img
v-else
class="data-table__row__info__image data-table__row__info__image--no-img"
src="~assets/images/validator-icon.svg"
width="48"
height="48"
>
/>
<div class="data-table__row__info__container">
<span

v-tooltip.top="status"
:class="statusColor"
class="data-table__row__info__container__status"
Expand Down Expand Up @@ -45,10 +44,10 @@
}}
</td>
<td class="li-validator__rewards data-table__row__cell__separator">
{{ rewards || "n/a" }}
{{ rewards || "--" }}
</td>
<td class="li-validator__voting-power">
{{ validator.percent_of_vote ? validator.percent_of_vote : `n/a` }}
{{ validator.percent_of_vote ? validator.percent_of_vote : `--` }}
</td>
<td class="li-validator__uptime">
{{ uptime }}
Expand All @@ -57,7 +56,7 @@
{{ commission }}
</td>
<td class="li-validator__slashes">
n/a
--
</td>
</tr>
</template>
Expand Down Expand Up @@ -104,7 +103,7 @@ export default {
const uptimeRollingWindow = info.signed_blocks_counter / rollingWindow
return `${this.num.pretty(uptimeRollingWindow * 100)}%`
}
return `n/a`
return `--`
},
yourVotes() {
return this.committedDelegations[this.validator.operator_address]
Expand Down
4 changes: 2 additions & 2 deletions app/src/renderer/components/staking/TabStakingParameters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{{
stakingParameters.parameters.unbonding_time
? unbondingTimeInDays + ` days`
: `n/a`
: `--`
}}
</dd>
</dl>
Expand All @@ -40,7 +40,7 @@
{{
stakingParameters.parameters.max_validators
? stakingParameters.parameters.max_validators
: `n/a`
: `--`
}}
</dd>
</dl>
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/delegation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
* NOTE: don't use a global `let client = app.client` as the client object changes when restarting the app
*/

test(`delegation`, async function(t) {
test(`delegation`, async function (t) {
const { app } = await getApp(t)
// app.env.COSMOS_MOCKED = false
await restart(app)
Expand All @@ -22,7 +22,7 @@ test(`delegation`, async function(t) {
// default values from e2e mounted node
const bondedStake = 100

t.test(`Validators`, async function(t) {
t.test(`Validators`, async function (t) {
// Select the Validators tab.
await app.client.click(`//a[normalize-space() = 'Validators']`)

Expand Down Expand Up @@ -154,7 +154,7 @@ test(`delegation`, async function(t) {
t.end()
})

t.test(`showing transactions`, async function(t) {
t.test(`showing transactions`, async function (t) {
await navigate(app, `Transactions`)

// delegated
Expand All @@ -173,7 +173,7 @@ test(`delegation`, async function(t) {
t.end()
})

t.test(`Parameters`, async function(t) {
t.test(`Parameters`, async function (t) {
await navigate(app, `Staking`)
await app.client.click(`//a[normalize-space() = 'Parameters']`)
await t.ok(
Expand All @@ -191,7 +191,7 @@ test(`delegation`, async function(t) {
`Shows staking parameters`
)
await t.ok(
!(await app.client.isExisting(`//dd[contains(text(), "n/a")]`)),
!(await app.client.isExisting(`//dd[contains(text(), "--")]`)),
`all parameters and pool fields are defined`
)
await t.ok(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ exports[`PageBlock shows a page with information about a certain block 1`] = `
<h2
class="page-profile__title"
>
Block #100
Block #100
</h2>
<h3
Expand Down Expand Up @@ -71,7 +69,9 @@ exports[`PageBlock shows a page with information about a certain block 1`] = `
</dt>
<dd>
txs
txs
</dd>
</dl>
</div>
Expand All @@ -95,7 +95,9 @@ exports[`PageBlock shows a page with information about a certain block 1`] = `
</dt>
<dd>
evidence
evidence
</dd>
</dl>
</div>
Expand Down Expand Up @@ -125,9 +127,7 @@ exports[`PageBlock shows the page when the block hasn't been loaded yet 1`] = `
<h2
class="page-profile__title"
>
Block n/a
Block --
</h2>
<h3
Expand All @@ -152,7 +152,7 @@ exports[`PageBlock shows the page when the block hasn't been loaded yet 1`] = `
</dt>
<dd>
n/a
--
</dd>
</dl>
</div>
Expand All @@ -175,7 +175,9 @@ exports[`PageBlock shows the page when the block hasn't been loaded yet 1`] = `
</dt>
<dd>
No Transactions
No Transactions
</dd>
</dl>
</div>
Expand All @@ -199,7 +201,9 @@ exports[`PageBlock shows the page when the block hasn't been loaded yet 1`] = `
</dt>
<dd>
No Evidence
No Evidence
</dd>
</dl>
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/components/staking/LiValidator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe(`LiValidator`, () => {
})
})

expect(wrapper.vm.uptime).toBe(`n/a`)
expect(wrapper.vm.uptime).toBe(`--`)
})

it(`should show the validator's commission`, () => {
Expand Down
Loading

0 comments on commit 12a2352

Please sign in to comment.