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

Activity filter fixes #937

Merged
merged 3 commits into from
Nov 30, 2022
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: 7 additions & 2 deletions src/components/ActivityFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{ $t('components.activityFilter.dateRange') }}
</div>
<div class="date-filter-inputs h-padding form">
<date-pick v-model="dateFilters.start">
<date-pick v-model="dateFilters.start" @input="changeTrigered">
<template v-slot:default="{ toggle, inputValue, inputEvents }">
<div class="input-group" @click="toggle">
<input
Expand All @@ -37,7 +37,7 @@
</div>
</template>
</date-pick>
<date-pick v-model="dateFilters.end">
<date-pick v-model="dateFilters.end" @input="changeTrigered">
<template v-slot:default="{ toggle, inputValue, inputEvents }">
<div class="input-group" @click="toggle">
<input
Expand Down Expand Up @@ -261,6 +261,11 @@ export default {
statuses,
dates: this.dateFilters
})
},
changeTrigered() {
this.$nextTick(() => {
this.applyFilters()
})
}
}
}
Expand Down
27 changes: 27 additions & 0 deletions src/components/NoTransactionsFound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div class="empty-state">
<p>{{ message || `${$t('common.noResults')}` }}</p>
</div>
</template>
<script>
export default {
name: 'NoTransactionsFound',
props: ['message']
}
</script>
<style scoped lang="scss">
.empty-state {
min-height: 300px;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

p {
font-size: 1rem;
margin: 0;
}
}
</style>
9 changes: 7 additions & 2 deletions src/components/TransactionList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div class="transaction-list">
<NoTransactionsFound v-if="!transactions.length" />
<ListItem
v-else
v-for="item in transactions"
:key="item.id"
:id="item.type + '_' + item.from + '_' + item.to"
Expand Down Expand Up @@ -39,6 +41,8 @@
<script>
import ListItem from '@/components/ListItem'
import TransactionStatus from '@/components/TransactionStatus'
import NoTransactionsFound from '@/components/NoTransactionsFound.vue'

import {
getStep,
ACTIVITY_STATUSES,
Expand All @@ -58,7 +62,8 @@ import { mapState } from 'vuex'
export default {
components: {
ListItem,
TransactionStatus
TransactionStatus,
NoTransactionsFound
},
props: ['transactions'],
computed: {
Expand Down Expand Up @@ -156,4 +161,4 @@ export default {
}
</script>

<style lang="scss"></style>
<style lang="sss"></style>
3 changes: 2 additions & 1 deletion src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"pt": "Português",
"ph": "Tagalog",
"cb": "Cebuano"
}
},
"noResults": "No results found"
}
6 changes: 3 additions & 3 deletions src/views/Wallet/WalletActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<ActivityFilter
@filters-changed="applyFilters"
:activity-data="activityData"
v-if="activityData.length > 0"
v-if="activity.length"
:showTypeFilters="true"
/>
<TransactionList :transactions="activityData" />
<EmptyActivity v-show="activityData.length <= 0" :active-network="activeNetwork" />
<TransactionList v-if="activity.length" :transactions="activityData" />
<EmptyActivity v-else :active-network="activeNetwork" />
</div>
</template>

Expand Down