From de956a1ced87ed11d74c9b94d55835c9756da2c6 Mon Sep 17 00:00:00 2001
From: Raphael Odini
Date: Fri, 31 May 2024 16:47:06 +0200
Subject: [PATCH 1/2] User settings: new option to show the Location OSM ID
---
src/i18n/locales/en.json | 4 +++-
src/store.js | 1 +
src/views/UserSettings.vue | 11 ++++++++---
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json
index 3be6d50340f..cd037ea7c3e 100644
--- a/src/i18n/locales/en.json
+++ b/src/i18n/locales/en.json
@@ -110,7 +110,8 @@
"AddPrice": "Add a price",
"AddToOFF": "Add to {name}",
"Country": "Country",
- "Language": "Languages",
+ "Language": "Language",
+ "Locations": "Locations",
"Date": "Date",
"Delete": "Delete",
"Edit": "Edit",
@@ -379,6 +380,7 @@
"FavoriteCurrencies": "Favorite currencies",
"CurrencyRequired": "At least one currency is required",
"LanguageLabel": "Languages",
+ "LocationDisplayOSMID": "Display OSM ID",
"ProductDisplayBarcode": "Display barcode",
"Save": "Save",
"Title": "Settings",
diff --git a/src/store.js b/src/store.js
index a1823992bbc..8a0b5e81c87 100644
--- a/src/store.js
+++ b/src/store.js
@@ -15,6 +15,7 @@ export const useAppStore = defineStore('app', {
proofs: [],
proofTotal: null,
product_display_barcode: false,
+ location_display_osm_id: false,
},
}),
getters: {
diff --git a/src/views/UserSettings.vue b/src/views/UserSettings.vue
index eabbcf8b72f..ce532878b6b 100644
--- a/src/views/UserSettings.vue
+++ b/src/views/UserSettings.vue
@@ -8,6 +8,7 @@
+
{{ $t('Common.Country') }}
@@ -19,6 +20,7 @@
item-title="native"
item-value="code"
/>
+
{{ $t('Common.Language') }}
@@ -42,16 +44,19 @@
+
{{ $t('Common.Products') }}
+
+
+ {{ $t('Common.Locations') }}
+
+
-
-
-
From 3374aa6e9922b2dca41c77381a9be2aba090eaa6 Mon Sep 17 00:00:00 2001
From: Raphael Odini
Date: Fri, 31 May 2024 17:00:27 +0200
Subject: [PATCH 2/2] Show Location OSM ID chip in LocationCard & Location
search
---
src/components/LocationCard.vue | 15 +++++++++++++++
src/components/LocationSelectorDialog.vue | 18 ++++++++++++------
src/utils.js | 4 ++--
src/views/AddPriceMultiple.vue | 6 +++---
src/views/AddPriceSingle.vue | 6 +++---
src/views/LocationList.vue | 2 +-
src/views/UserSettings.vue | 2 +-
7 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/src/components/LocationCard.vue b/src/components/LocationCard.vue
index 1eee4559178..aeaa5901432 100644
--- a/src/components/LocationCard.vue
+++ b/src/components/LocationCard.vue
@@ -10,6 +10,9 @@
{{ getLocationCategory(location) }}
+
+ {{ getLocationOSMID(location) }}
+
@@ -27,11 +30,20 @@ export default {
type: [Object, null],
required: true
},
+ hideLocationOSMID: {
+ type: Boolean,
+ default: false
+ },
readonly: {
type: Boolean,
default: false
}
},
+ computed: {
+ showLocationOSMID() {
+ return !this.hideLocationOSMID && this.appStore.user.username && this.appStore.user.location_display_osm_id
+ }
+ },
methods: {
getLocationTitle(location) {
if (location) {
@@ -42,6 +54,9 @@ export default {
getLocationCategory(location) {
return utils.getLocationCategory(location)
},
+ getLocationOSMID(location) {
+ return utils.getLocationOSMID(location)
+ },
goToLocation(location) {
if (this.readonly) {
return
diff --git a/src/components/LocationSelectorDialog.vue b/src/components/LocationSelectorDialog.vue
index 8f7790e289b..29a39767093 100644
--- a/src/components/LocationSelectorDialog.vue
+++ b/src/components/LocationSelectorDialog.vue
@@ -45,7 +45,7 @@
{{ getLocationTitle(location, true, false, false) }}
{{ getLocationTitle(location, false, true, true) }}
-
+
{{ getLocationCategory(location) }}
+
+ {{ getLocationOSMID(location) }}
+
-
+
{{ getLocationTitle(location, true, false, false) }}
{{ getLocationTitle(location, false, true, true) }}
@@ -93,7 +96,7 @@
-
+
diff --git a/src/views/UserSettings.vue b/src/views/UserSettings.vue
index ce532878b6b..4949b4a325d 100644
--- a/src/views/UserSettings.vue
+++ b/src/views/UserSettings.vue
@@ -48,8 +48,8 @@
{{ $t('Common.Products') }}
-
+
{{ $t('Common.Locations') }}