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

clicking a balance will go to the send page with that denom selected... #299

Merged
merged 4 commits into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
24 changes: 16 additions & 8 deletions app/src/renderer/components/wallet/PageBalances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ page(title='Balance')
li-copy(:value="wallet.key.address")

part(title="Denomination Balances")
data-empty(v-if="wallet.balances.length === 0")
data-empty-search(v-else-if="filteredBalances.length === 0")
list-item(
v-else
v-for="i in filteredBalances"
:key="i.denom"
:dt="i.denom.toUpperCase()"
:dd="i.amount")
data-empty(v-if="wallet.balances.length === 0")
data-empty-search(v-else-if="filteredBalances.length === 0")
list-item(
v-for="i in filteredBalances"
v-if="wallet.balances.length > 0 && i.amount > 0"
:key="i.denom"
:dt="i.denom.toUpperCase()"
:dd="i.amount"
:to="{name: 'send', params: {denom: i.denom}}")

part(title="Network Denominations")
list-item(
v-for="i in filteredBalances"
v-if="i.amount === 0"
:key="i.denom"
:dt="i.denom.toUpperCase()")
</template>

<script>
Expand Down
3 changes: 2 additions & 1 deletion app/src/renderer/components/wallet/PageSend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page(title='Send')
field-id='send-denomination' field-label='Denomination')
field#send-denomination(
type="select"
v-model="fields.denom"
v-model="fields.denom || denom"
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 not sure if this works properly. This will set the model to use the property "denom". onSubmit uses "fields.denom". Is it tested, that this works? I proposed another way to set the denom.

:options="denominations"
placeholder="Select token...")
form-msg(name='Denomination' type='required' v-if='!$v.fields.denom.required')
Expand Down Expand Up @@ -121,6 +121,7 @@ export default {
},
...mapActions(['walletSend'])
},
props: ['denom'],
mounted () {
if (this.denominations.length === 1) {
this.fields.denom = this.denominations[0].value
Expand Down
2 changes: 1 addition & 1 deletion app/src/renderer/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default [

// WALLET
{ path: '/', name: 'balances', component: wallet('Balances') },
{ path: '/wallet/send', name: 'send', component: wallet('Send') },
{ path: '/wallet/send', name: 'send', props: true, component: wallet('Send') },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice learning. :)

{ path: '/wallet/transactions', name: 'transactions', component: wallet('Transactions') },

// 404
Expand Down
294 changes: 206 additions & 88 deletions test/unit/specs/__snapshots__/PageBalances.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -171,63 +171,122 @@ exports[`PageBalances has the expected html structure 1`] = `
</header>
<main
class="ni-part-main"
/>
</div>
</section>
<div
class="ni-li proposal-enter proposal-enter-active"
>
<div
class="ni-li-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
>
<div
class="ni-li-dt"
<a
class="ni-li ni-li-link proposal-enter proposal-enter-active"
href="#/wallet/send"
>
FERMION
</div>
<div
class="ni-li-dd"
<div
class="ni-li-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
>
<div
class="ni-li-dt"
>
FERMION
</div>
<div
class="ni-li-dd"
>
456
</div>
</div>
<div
class="ni-li-icon"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
>
my_location
</i>
</div>
</div>
</a>
<a
class="ni-li ni-li-link proposal-enter proposal-enter-active"
href="#/wallet/send"
>
456
</div>
</div>
<div
class="ni-li-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
>
<div
class="ni-li-dt"
>
ATOM
</div>
<div
class="ni-li-dd"
>
123
</div>
</div>
<div
class="ni-li-icon"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
>
my_location
</i>
</div>
</div>
</a>
</main>
</div>
</div>
<div
class="ni-li proposal-enter proposal-enter-active"
</section>
<section
class="ni-part"
>
<div
class="ni-li-container"
class="ni-part-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
<header
class="ni-part-header"
>
<div
class="ni-li-dt"
>
ATOM
</div>
<div
class="ni-li-dd"
class="ni-part-header-container"
>
123
<div
class="ni-part-title h5"
>
Network Denominations
</div>
<menu
class="ni-part-menu"
/>
</div>
</div>
</header>
<main
class="ni-part-main"
/>
</div>
</div>
</section>
</main>
</div>
`;
Expand Down Expand Up @@ -403,63 +462,122 @@ exports[`PageBalances should filter the balances 1`] = `
</header>
<main
class="ni-part-main"
/>
</div>
</section>
<div
class="ni-li"
>
<div
class="ni-li-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
>
<div
class="ni-li-dt"
<a
class="ni-li ni-li-link"
href="#/wallet/send"
>
FERMION
</div>
<div
class="ni-li-dd"
<div
class="ni-li-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
>
<div
class="ni-li-dt"
>
FERMION
</div>
<div
class="ni-li-dd"
>
456
</div>
</div>
<div
class="ni-li-icon"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
>
my_location
</i>
</div>
</div>
</a>
<a
class="ni-li ni-li-link"
href="#/wallet/send"
>
456
</div>
</div>
<div
class="ni-li-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
>
<div
class="ni-li-dt"
>
ATOM
</div>
<div
class="ni-li-dd"
>
123
</div>
</div>
<div
class="ni-li-icon"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
>
my_location
</i>
</div>
</div>
</a>
</main>
</div>
</div>
<div
class="ni-li"
</section>
<section
class="ni-part"
>
<div
class="ni-li-container"
class="ni-part-container"
>
<div
class="ni-li-thumb"
>
<!---->
</div>
<div
class="ni-li-dl"
<header
class="ni-part-header"
>
<div
class="ni-li-dt"
>
ATOM
</div>
<div
class="ni-li-dd"
class="ni-part-header-container"
>
123
<div
class="ni-part-title h5"
>
Network Denominations
</div>
<menu
class="ni-part-menu"
/>
</div>
</div>
</header>
<main
class="ni-part-main"
/>
</div>
</div>
</section>
</main>
</div>
`;