Commit 6f88fb93 authored by Seemann Benjamin's avatar Seemann Benjamin

proper tagging for OSM opening hours

parent b904ef21
Pipeline #75327182 passed with stages
in 2 minutes and 30 seconds
......@@ -27,7 +27,6 @@ export function addOrUpdateUser(userId, displayName) {
}
export function fetchBusinessPOIs(userId) {
console.log('fetchbusinessPOIS called by update.js');
if (fakeOsmybizApi) {
return mockFetchBusinessPOIs(userId);
}
......
......@@ -55,7 +55,7 @@
type="text"
v-on:blur="blurOpeningHours()"
id="openingHoursURL"
v-model="details.opening_hours_url"
v-model="details.opening_url"
:placeholder="$t('detail.placeholders.opening_hours_url')">
<span v-show="errors.has('website')"
......
......@@ -29,7 +29,7 @@ const initialState = {
},
name: '',
opening_hours: '',
opening_hours_url: '',
opening_url: '',
phone: '',
email: '',
website: '',
......@@ -89,6 +89,9 @@ function constructSuccessMessage(response, isNote) {
}
function parseTagToString(tag, value, initialValue, additionalText) {
if (tag === 'opening_url') {
tag = 'opening_hours:url';
}
if (deepEqual(value, initialValue)) {
if (value) {
return `${additionalText}${tag} = ${value}\n`;
......@@ -194,7 +197,7 @@ export function clearDetails() {
},
name: '',
opening_hours: '',
opening_hours_url: '',
opening_url: '',
phone: '',
email: '',
website: '',
......
......@@ -49,7 +49,6 @@ const actions = {
resolve(subscribedBusinessPOI);
}
});
promise.then(() => {
if (isNoteWithoutOsmElement(subscribedBusinessPOI.id)) {
subscribedBusinessPOI.tags = {};
......
......@@ -7,7 +7,7 @@ function parseDetails(businessPOITags) {
const tags = [
'name',
'opening_hours',
'opening_hours_url',
'opening_hours:url',
'phone',
'email',
'website',
......@@ -129,8 +129,8 @@ function createDetailTags(businessPOI) {
if (businessPOI.details.opening_hours.length !== 0) {
text += `<tag k="opening_hours" v="${businessPOI.details.opening_hours}"/>`;
}
if (businessPOI.details.opening_hours_url.length !== 0) {
text += `<tag k="opening_hours:url" v="${businessPOI.details.opening_hours_url}"/>`;
if (businessPOI.opening_url.length !== 0) {
text += `<tag k="opening_hours:url" v="${businessPOI.details.opening_url}"/>`;
}
if (businessPOI.details.phone.length !== 0) {
text += `<tag k="phone" v="${businessPOI.details.phone}"/>`;
......@@ -239,7 +239,6 @@ function extractId(businessPOIDiff) {
return getAttributes(diffJson).new_id;
}
export default {
parseUser,
constructUpload,
......
......@@ -65,7 +65,7 @@ function createNoteFromBusinessPOI(businessPOI) {
category: getBizCategory(businessPOI),
name: extractTag(businessPOI, 'name'),
opening_hours: extractTag(businessPOI, 'opening_hours'),
opening_hours_url: extractTag(businessPOI, 'opening_hours_url'),
opening_url: extractTag(businessPOI, 'opening_hours:url'),
phone: extractTag(businessPOI, 'phone'),
email: extractTag(businessPOI, 'email'),
website: extractTag(businessPOI, 'website'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment