From 3374aa6e9922b2dca41c77381a9be2aba090eaa6 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 31 May 2024 17:00:27 +0200 Subject: [PATCH] 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') }}