Skip to content

Commit

Permalink
feat(price create form): init location with last recent (#111)
Browse files Browse the repository at this point in the history
* Price create form: on init, select last location by default

* Improve style
  • Loading branch information
raphodn authored Jan 7, 2024
1 parent 187a549 commit e660b7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/components/LocationSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
<v-chip
class="mb-2"
v-for="location in recentLocations"
elevation="1"
@click="selectLocation(location)">
<v-icon start icon="mdi-history"></v-icon>
{{ location.display_name }}
Expand Down
10 changes: 8 additions & 2 deletions src/views/AddPriceSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<h3 class="mb-2">
<v-item-group v-model="productMode" class="d-inline" mandatory>
<v-item v-for="pm in productModeList" :key="pm.key" :value="pm.key" v-slot="{ isSelected, toggle }">
<v-chip class="mr-1" @click="toggle">
<v-chip class="mr-1" @click="toggle" :style="isSelected ? 'border: 1px solid #9E9E9E' : 'border: 1px solid transparent'">
<v-icon start :icon="isSelected ? 'mdi-checkbox-marked-circle' : 'mdi-circle-outline'"></v-icon>
{{ pm.value }}
</v-chip>
Expand Down Expand Up @@ -140,7 +140,7 @@
</h3>
<v-chip
class="mb-2"
:style="isSelectedLocation(location) ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'"
:style="isSelectedLocation(location) ? 'border: 1px solid #9E9E9E' : 'border: 1px solid transparent'"
v-for="location in recentLocations"
@click="setLocationData(location)">
<v-icon start :icon="isSelectedLocation(location) ? 'mdi-checkbox-marked-circle' : 'mdi-history'"></v-icon>
Expand Down Expand Up @@ -300,8 +300,14 @@ export default {
return !!v
},
initPriceSingleForm() {
/**
* init product mode, currency & last location
*/
this.productMode = this.appStore.user.last_product_mode_used
this.addPriceSingleForm.currency = this.appStore.user.last_currency_used
if (this.recentLocations.length) {
this.setLocationData(this.recentLocations[0])
}
},
clearProof() {
this.proofImage = null
Expand Down

0 comments on commit e660b7d

Please sign in to comment.