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/338 tx history #441

Merged
merged 13 commits into from
Feb 6, 2018
2 changes: 0 additions & 2 deletions app/src/renderer/components/common/NiPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export default {
.ni-page-main
flex 1
position relative
display flex
flex-flow column nowrap
max-width width-main-max

.ni-page-title
Expand Down
4 changes: 4 additions & 0 deletions app/src/renderer/components/staking/LiDelegate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default {

&.name
flex 2
padding-left 1rem

&.bar
position relative
Expand Down Expand Up @@ -129,4 +130,7 @@ export default {
overflow hidden
text-overflow ellipsis
padding-right 1rem

.sort-by.name
padding-left 1rem
</style>
2 changes: 0 additions & 2 deletions app/src/renderer/components/staking/PanelSort.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ export default {
position relative
min-width 0


.label
font-size sm
color dim

white-space nowrap
text-overflow ellipsis
overflow hidden
Expand Down
100 changes: 32 additions & 68 deletions app/src/renderer/components/wallet/LiTransaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ mixin tx-container-sent
.tx-container
.tx-element.tx-coins
.tx-coin(v-for='coin in coinsSent')
.key {{ coin.denom.toUpperCase() }}
.value {{ num.pretty(coin.amount) }}
.key {{ coin.denom }}
.tx-element.tx-date(v-if="devMode") {{ date }}
.tx-element.tx-address {{ receiver }}
div
.tx-element.tx-date(v-if="devMode") {{ date }}
.tx-element.tx-address(v-if="!sentSelf") Sent to {{ receiver }}
.tx-element.tx-address(v-if="sentSelf") You sent this amount to yourself.

.ni-li-tx(v-if="sentSelf" @click="() => devMode && viewTransaction()")
.tx-icon: i.material-icons swap_horiz
Expand All @@ -21,10 +23,11 @@ mixin tx-container-sent
.tx-container
.tx-element.tx-coins
.tx-coin(v-for='coin in coinsReceived')
.key {{ coin.denom.toUpperCase() }}
.value {{ num.pretty(coin.amount) }}
.key {{ coin.denom }}
.tx-element.tx-date(v-if="devMode") {{ date }}
.tx-element.tx-address {{ sender }}
div
.tx-element.tx-date(v-if="devMode") {{ date }}
.tx-element.tx-address Received from {{ sender }}
</template>

<script>
Expand Down Expand Up @@ -53,18 +56,15 @@ export default {
return this.transactionValue.tx.inputs[0].coins
},
date () {
return this.transactionValue.time ? moment(this.transactionValue.time).fromNow() : 'N/A'
return moment(this.transactionValue.time).format('MMMM Do YYYY, h:mm:ss a')
}
},
data: () => ({
num: num
}),
methods: {
viewTransaction () {
this.$store.commit('notify', {
title: 'TODO: View Transaction',
body: 'tx details page not implemented yet'
})
console.log('TODO: implement tx viewer')
}
},
props: ['transaction-value', 'address', 'devMode']
Expand All @@ -78,112 +78,76 @@ export default {
display flex
font-size sm
border-bottom 1px solid bc-dim
min-height 3rem
&:nth-of-type(2n-1)
background app-fg

.tx-icon
flex 0 0 2rem
padding 0 0.5rem
background app-fg
display flex
align-items center
justify-content center

.tx-container
flex 1
flex-direction column
flex-wrap nowrap
padding 0.5rem 0
margin 0.5rem 0
display flex
flex-flow row wrap
align-items flex-start
justify-content center

min-width 0 // fix text-overflow

.tx-element
padding 0 0.5rem
padding 0 2rem 0 1.5rem
line-height 1.5rem

.tx-coins
flex 0 0 60%

.tx-coin
display flex
flow-flow row nowrap
.value
flex 3
text-align right
flex 0 0 100%
font-size sm
color dim
&:before
content ''
display inline
.key
flex 2
padding-left 0.5rem

.tx-date
flex 0 0 40%
color dim
font-weight 500
font-size m
.value,
.key
line-height 1.5rem

.tx-address
flex 100%

white-space nowrap
overflow hidden
text-overflow ellipsis

color dim
font-size sm

&.ni-li-tx-sent
.tx-icon
background alpha(mc, 5%)
i
color danger
background alpha(dim, 5%)
.tx-coin .value
color danger
&:before
content '-'

&.ni-li-tx-received
.tx-icon
background alpha(link, 5%)
i
color success
background alpha(success, 5%)
.tx-coin .value
color success
&:before
content '+'

&:hover
cursor pointer
background app-fg
.tx-coin
.key
color txt
.tx-date, .tx-address
color txt
background hover-bg

@media screen and (min-width: 375px)
@media screen and (min-width: 700px)
.ni-li-tx
font-size 0.875rem
@media screen and (min-width: 414px)
.ni-li-tx
.tx-container
padding 0.5rem

@media screen and (min-width: 768px)
.ni-li-tx
.tx-icon
flex 0 0 3rem

.tx-container
flex-flow row nowrap

.tx-element
line-height 2rem

.tx-coins
flex 3

.tx-date
flex 2
flex-direction row

.tx-address
flex 6
</style>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"pack": "npm run pack:main && npm run pack:renderer",
"pack:main": "cross-env NODE_ENV=production webpack --colors --config webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --colors --config webpack.renderer.config.js",
"test": "npm run test:unit",
"test": "npm run lint && npm run test:unit",
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we remove the linting step in the circleci config then?

Copy link
Collaborator Author

@jbibla jbibla Feb 5, 2018

Choose a reason for hiding this comment

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

good point. yes, i think so. i added this in because i was sick of running yarn test and then pushing my PR expecting it to pass.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done in latest commit dd23bc6

"test:unit": "cross-env LOGGING=false MOCK=false jest --maxWorkers=2",
"test:e2e": "tape \"test/e2e/!(main)*.js\"",
"test:exe": "node tasks/test-build.js",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/components/wallet/LiTransaction.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('LiTransaction', () => {
}
]
},
time: Date.now()
time: null
},
address: 'myAddress'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,28 @@ exports[`LiTransaction has the expected html structure 1`] = `
class="tx-coin"
>
<div
class="value"
class="key"
>
1,234.00
JBCOINS
</div>
<div
class="key"
class="value"
>
jbcoins
1,234.00
</div>
</div>
</div>
<div
class="tx-element tx-date"
>
a few seconds ago
</div>
<div
class="tx-element tx-address"
>
otherAddress
<div>
<div
class="tx-element tx-date"
>
Invalid date
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes. remember the time zone issues i was having?

</div>
<div
class="tx-element tx-address"
>
Received from otherAddress
</div>
</div>
</div>
</div>
Expand Down