(account) add a new tab with all locations in a map

This commit is contained in:
Julien Calixte
2020-03-15 01:11:23 +01:00
parent 9401fc12f4
commit 66059ea840
4 changed files with 60 additions and 15 deletions

View File

@@ -58,6 +58,15 @@
<awe-icon icon="dollar-sign" />
</a>
</li>
<li v-if="locations.length">
<a
:style="colorStyle(activeTab === 'location')"
href="#"
@click.prevent="toggleTab('location')"
>
<awe-icon icon="globe-europe" />
</a>
</li>
<li v-if="tagCount > 1">
<a
:style="colorStyle(activeTab === 'tag')"
@@ -97,6 +106,13 @@
:transactions="transactions"
/>
</div>
<div
key="location"
class="location-panel tab-content is-centered"
v-if="locations.length && activeTab === 'location'"
>
<earth-map :locations="locations" />
</div>
<div
key="tag"
class="tag-panel tab-content is-centered"
@@ -175,6 +191,7 @@ import { primary, main, findContrastColor, findDarkValue } from '@/utils'
'account-share': () => import('@/components/AccountShare.vue'),
'account-transaction-list': () =>
import('@/components/AccountTransactionList.vue'),
'earth-map': () => import('@/components/EarthMap.vue'),
'tag-list': () => import('@/components/TagList.vue'),
'chart-balance': () => import('@/components/ChartBalance.vue'),
'online-view': () => import('@/components/OnlineView.vue'),
@@ -359,6 +376,12 @@ export default class AccountItem extends BaseAccount {
})
}
public get locations() {
return this.transactions
.filter((transaction) => transaction.location)
.map((transaction) => transaction.location)
}
public get myTotalCost(): number {
if (!this.account) {
return 0