From 2cbebfe8d43ec5a592be3c68feeb244b9c69d96a Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 14 Mar 2022 20:59:06 +0100 Subject: [PATCH 1/3] Fixed shadowed mapping --- .../charging_station/charging_station.json | 24 +++++++++---------- .../charging_station.protojson | 24 +++++++++---------- langs/layers/en.json | 11 +++++---- langs/layers/nl.json | 11 +++++---- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/assets/layers/charging_station/charging_station.json b/assets/layers/charging_station/charging_station.json index 6c05fa04b..9bde3a320 100644 --- a/assets/layers/charging_station/charging_station.json +++ b/assets/layers/charging_station/charging_station.json @@ -3370,18 +3370,6 @@ "nl": "Moet men betalen om dit oplaadpunt te gebruiken?" }, "mappings": [ - { - "if": { - "and": [ - "fee=no" - ] - }, - "then": { - "nl": "Gratis te gebruiken", - "en": "Free to use" - }, - "hideInAnswer": true - }, { "if": { "and": [ @@ -3410,6 +3398,18 @@ "en": "Free to use, but one has to authenticate" } }, + { + "if": { + "and": [ + "fee=no" + ] + }, + "then": { + "nl": "Gratis te gebruiken", + "en": "Free to use" + }, + "hideInAnswer": true + }, { "if": { "and": [ diff --git a/assets/layers/charging_station/charging_station.protojson b/assets/layers/charging_station/charging_station.protojson index 7c6d492ec..ad748caa2 100644 --- a/assets/layers/charging_station/charging_station.protojson +++ b/assets/layers/charging_station/charging_station.protojson @@ -224,18 +224,6 @@ "nl": "Moet men betalen om dit oplaadpunt te gebruiken?" }, "mappings": [ - { - "if": { - "and": [ - "fee=no" - ] - }, - "then": { - "nl": "Gratis te gebruiken", - "en": "Free to use" - }, - "hideInAnswer": true - }, { "if": { "and": [ @@ -264,6 +252,18 @@ "en": "Free to use, but one has to authenticate" } }, + { + "if": { + "and": [ + "fee=no" + ] + }, + "then": { + "nl": "Gratis te gebruiken", + "en": "Free to use" + }, + "hideInAnswer": true + }, { "if": { "and": [ diff --git a/langs/layers/en.json b/langs/layers/en.json index 4b8f0a4ac..8374aca58 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -494,6 +494,9 @@ }, "5": { "then": "Tandem bicycles can be rented here" + }, + "6": { + "then": "Race bicycles can be rented here" } }, "question": "What kind of bicycles and accessories are rented here?", @@ -1794,14 +1797,14 @@ "fee": { "mappings": { "0": { - "then": "Free to use" - }, - "1": { "then": "Free to use (without authenticating)" }, - "2": { + "1": { "then": "Free to use, but one has to authenticate" }, + "2": { + "then": "Free to use" + }, "3": { "then": "Paid use, but free for customers of the hotel/pub/hospital/... who operates the charging station" }, diff --git a/langs/layers/nl.json b/langs/layers/nl.json index a20a9da1b..4c5b20427 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -494,6 +494,9 @@ }, "5": { "then": "Tandems kunnen hier gehuurd worden" + }, + "6": { + "then": "Wielerfietsen (sportfietsen) kunnen hier gehuurd worden" } }, "question": "Wat voor soort fietsen en fietstoebehren worden hier verhuurd?", @@ -1803,14 +1806,14 @@ "fee": { "mappings": { "0": { - "then": "Gratis te gebruiken" - }, - "1": { "then": "Gratis te gebruiken (zonder aan te melden)" }, - "2": { + "1": { "then": "Gratis te gebruiken, maar aanmelden met een applicatie is verplicht" }, + "2": { + "then": "Gratis te gebruiken" + }, "3": { "then": "Betalend te gebruiken, maar gratis voor klanten van het bijhorende hotel/café/ziekenhuis/..." }, From f2f2c01e48d48b67c3b72910274e6ed3c144321b Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 14 Mar 2022 20:59:28 +0100 Subject: [PATCH 2/3] Version bump --- Models/Constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Models/Constants.ts b/Models/Constants.ts index 3655b2ed0..a1b3e2605 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import {Utils} from "../Utils"; export default class Constants { - public static vNumber = "0.16.6"; + public static vNumber = "0.16.7"; public static ImgurApiKey = '7070e7167f0a25a' public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85" From ae04047346d4fc8d699259a4d21a4995e4ebb66c Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Tue, 15 Mar 2022 13:44:34 +0100 Subject: [PATCH 3/3] Fix changeset uploading --- Logic/Osm/ChangesetHandler.ts | 19 ++++++++++++++++++- Models/Constants.ts | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Logic/Osm/ChangesetHandler.ts b/Logic/Osm/ChangesetHandler.ts index 5b07a0faf..1861afa3a 100644 --- a/Logic/Osm/ChangesetHandler.ts +++ b/Logic/Osm/ChangesetHandler.ts @@ -50,6 +50,22 @@ export class ChangesetHandler { } + /** + * Creates a new list which contains every key at most once + */ + public static removeDuplicateMetaTags(extraMetaTags: ChangesetTag[]): ChangesetTag[]{ + const r : ChangesetTag[] = [] + const seen = new Set() + for (const extraMetaTag of extraMetaTags) { + if(seen.has(extraMetaTag.key)){ + continue + } + r.push(extraMetaTag) + seen.add(extraMetaTag.key) + } + return r + } + /** * Inplace rewrite of extraMetaTags * If the metatags contain a special motivation of the format ":node/-", this method will rewrite this negative number to the actual ID @@ -95,7 +111,7 @@ export class ChangesetHandler { } extraMetaTags = [...extraMetaTags, ...this.defaultChangesetTags()] - + extraMetaTags = ChangesetHandler.removeDuplicateMetaTags(extraMetaTags) if (this.userDetails.data.csCount == 0) { // The user became a contributor! this.userDetails.data.csCount = 1; @@ -316,6 +332,7 @@ export class ChangesetHandler { private async UpdateTags( csId: number, tags: ChangesetTag[]) { + tags = ChangesetHandler.removeDuplicateMetaTags(tags) console.trace("Updating tags of " + csId) const self = this; diff --git a/Models/Constants.ts b/Models/Constants.ts index a1b3e2605..bba84fb33 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import {Utils} from "../Utils"; export default class Constants { - public static vNumber = "0.16.7"; + public static vNumber = "0.16.8"; public static ImgurApiKey = '7070e7167f0a25a' public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85"