Merge master

This commit is contained in:
pietervdvn 2022-03-15 13:45:20 +01:00
commit daa23fad95
6 changed files with 51 additions and 34 deletions

View file

@ -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<string>()
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 "<change-type>:node/-<number>", 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;

View file

@ -2,7 +2,7 @@ import {Utils} from "../Utils";
export default class Constants {
public static vNumber = "0.17.0-alpha-2";
public static vNumber = "0.17.0-alpha-3";
public static ImgurApiKey = '7070e7167f0a25a'
public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85"

View file

@ -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": [

View file

@ -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": [

View file

@ -1797,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"
},

View file

@ -1806,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/..."
},