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

Issues/import errors #98

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
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
20 changes: 19 additions & 1 deletion ui/src/components/nav-bar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { authComputed } from '@state/helpers'
import { mapGetters } from 'vuex'
import { mapGetters, mapState } from 'vuex'
import NavBarRoutes from './nav-bar-routes.vue'

export default {
Expand Down Expand Up @@ -52,10 +52,19 @@ export default {
},
computed: {
...authComputed,
...mapState('users', ['me']),
...mapGetters('vehicles', ['unprocessedQuickEntries']),
isAdmin() {
return this.loggedIn && this.currentUser.role === 'ADMIN'
},
currencyOutdated() {
if (this.me !== null) {
if (this.me.currency.indexOf('(') !== -1) {
return true
}
}
return false
}
},
}
</script>
Expand All @@ -77,5 +86,14 @@ export default {
</b-navbar-dropdown>
</template>
</b-navbar>
<b-notification
v-model="currencyOutdated"
type="is-danger"
has-icon
aria-close-label="Close notification"
role="alert"
:closable=false>
Please select your currency again in <router-link to="/settings">settings</router-link> and then save.
</b-notification>
</div>
</template>
11 changes: 6 additions & 5 deletions ui/src/router/views/initialize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ export default {
})
.finally(() => (this.isWorking = false))
},
formatCurrency(option) {
return `${option.namePlural} (${option.code})`
},
},
}
</script>
Expand Down Expand Up @@ -212,14 +209,18 @@ export default {
<b-field :label="$t('currency')">
<b-autocomplete
v-model="registerModel.currency"
:custom-formatter="formatCurrency"
:placeholder="$t('currency')"
:data="filteredCurrencyMasters"
field="code"
:keep-first="true"
:open-on-focus="true"
required
@select="(option) => (selected = option)"
></b-autocomplete>
>
<template slot-scope="props">
<span>{{ props.option.namePlural }} ({{ props.option.code }})</span>
</template>
</b-autocomplete>
</b-field>
<b-field :label="$t('distanceunit')">
<b-select v-model.number="registerModel.distanceUnit" :placeholder="$t('distanceunit')" required expanded>
Expand Down
11 changes: 6 additions & 5 deletions ui/src/router/views/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ export default {
this.tryingToSave = false
})
},
formatCurrency(option) {
return `${option.namePlural} (${option.code})`
},
},
}
</script>
Expand All @@ -142,14 +139,18 @@ export default {
<b-field :label="$t('currency')">
<b-autocomplete
v-model="settingsModel.currency"
:custom-formatter="formatCurrency"
:placeholder="$t('currency')"
:data="filteredCurrencyMasters"
field="code"
:keep-first="true"
:open-on-focus="true"
required
@select="(option) => (selected = option)"
></b-autocomplete>
>
<template slot-scope="props">
<span>{{ props.option.namePlural }} ({{ props.option.code }})</span>
</template>
</b-autocomplete>
</b-field>
<b-field :label="$t('distanceunit')">
<b-select v-model.number="settingsModel.distanceUnit" placeholder="Distance Unit" required expanded>
Expand Down
Loading