Cyclestreets: only add maxspeed=30 in Belgium; change 'language' to 'locale' in changeset tags, load notes in import_viewer up to two years back, language tweaks

This commit is contained in:
pietervdvn 2022-01-31 20:52:56 +01:00
parent a11e0fc545
commit d1e99fc2d3
13 changed files with 88 additions and 13 deletions

View file

@ -271,7 +271,7 @@ export class ChangesetHandler {
path = path.substr(1, path.lastIndexOf("/"));
const metadata = [
["created_by", `MapComplete ${Constants.vNumber}`],
["language", Locale.language.data],
["locale", Locale.language.data],
["host", window.location.host],
["path", path],
["source", self.changes.state["currentUserLocation"]?.features?.data?.length > 0 ? "survey" : undefined],

View file

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

View file

@ -70,8 +70,7 @@ export default class LayoutConfig {
{
if (typeof json.title === "string") {
console.error("The title is not a translation, it instead is ", json.title, "("+typeof json.title+")")
throw `The title of a theme should always be a translation, as it sets the corresponding languages (${context}.title)`
throw `The title of a theme should always be a translation, as it sets the corresponding languages (${context}.title). The themenID is ${this.id}; the offending object is ${JSON.stringify(json.title)} which is a ${typeof json.title})`
}
if (this.language.length == 0) {
throw `No languages defined. Define at least one language. (${context}.languages)`

View file

@ -199,11 +199,12 @@ class ImportInspector extends VariableUiElement {
constructor(userDetails: { uid: number } | { display_name: string, search?: string }, state: UserRelatedState) {
let url;
if (userDetails["uid"] !== undefined) {
url = "https://api.openstreetmap.org/api/0.6/notes/search.json?user=" + userDetails["uid"] + "&limit=10000&sort=created_at&q=%23import"
url = "https://api.openstreetmap.org/api/0.6/notes/search.json?user=" + userDetails["uid"] + "&closed=730&limit=10000&sort=created_at&q=%23import"
} else {
url = "https://api.openstreetmap.org/api/0.6/notes/search.json?display_name=" +
encodeURIComponent(userDetails["display_name"]) + "&limit=10000&sort=created_at&q=" + encodeURIComponent(userDetails["search"] ?? "#import")
encodeURIComponent(userDetails["display_name"]) + "&limit=10000&closed=730&sort=created_at&q=" + encodeURIComponent(userDetails["search"] ?? "#import")
}

View file

@ -26,7 +26,7 @@
}
],
"name": {
"en":"Your travelled track",
"en": "Your travelled track",
"nl": "Jouw afgelegde route"
},
"mapRendering": [

View file

@ -274,7 +274,8 @@
"de": "Diese Straße ist eine Fahrradstraße (mit einer Geschwindigkeitsbegrenzung von 30 km/h)",
"it": "Questa è una strada ciclabile (e ha un limite di velocità massima di 30 km/h)",
"hu": "Ez az utca kerékpárosutca (és 30 km/h a sebességkorlátozás)"
}
},
"hideInAnswer": "_country!=be"
},
{
"if": {
@ -292,7 +293,7 @@
"it": "Questa è una strada ciclabile",
"hu": "Ez az utca kerékpárosutca"
},
"hideInAnswer": true
"hideInAnswer": "_country=be"
},
{
"if": {

View file

@ -324,5 +324,4 @@
"enableIframePopout": false,
"enableBackgroundLayerSelection": false,
"enableNoteImports": false
}

View file

@ -1100,6 +1100,10 @@ video {
max-height: 2rem;
}
.max-h-6 {
max-height: 1.5rem;
}
.w-full {
width: 100%;
}

View file

@ -3119,6 +3119,7 @@
}
},
"gps_track": {
"name": "Your travelled track",
"tagRenderings": {
"Privacy notice": {
"render": "This is the path you've travelled since this website is opened. Don't worry - this is only visible to you and no one else. Your location data is never sent off-device."

View file

@ -3066,6 +3066,7 @@
}
},
"gps_track": {
"name": "Jouw afgelegde route",
"tagRenderings": {
"Privacy notice": {
"render": "Dit is waar je was sinds je deze website hebt geopened. Dit is enkel zichtbaar voor jou en niemand anders, je locatie wordt niet verstuurd"

View file

@ -22,7 +22,30 @@
"8": {
"renderings": {
"0": {
"question": "How much bicycle_type "
"question": "How much type_plural can be rented here? ",
"render": "{capacity:bicycle_type} type_plural can be rented here"
}
},
"rewrite": {
"into": {
"0": {
"1": "city bikes"
},
"1": {
"1": "electrical bikes"
},
"2": {
"1": "bikes for children"
},
"3": {
"1": "BMX bikes"
},
"4": {
"1": "mountainbike"
},
"5": {
"1": "bicycle panniers"
}
}
}
},
@ -36,6 +59,12 @@
},
"2": {
"then": "BMX bikes can be rented here"
},
"3": {
"then": "Mountainbikes can be rented here"
},
"4": {
"then": "Bikes for childs can be rented here"
}
},
"question": "What kind of bicycles and accessories are rented here?",

View file

@ -26,11 +26,51 @@
"8": {
"renderings": {
"0": {
"question": "Hoeveel "
"question": "Hoeveel type_plural kunnen hier uitgeleend worden?",
"render": "{capacity:bicycle_type} type_plural kunnen hier uitgeleend worden"
}
},
"rewrite": {
"into": {
"0": {
"1": "Stadsfietsen"
},
"1": {
"1": "elektrische fietsen"
},
"2": {
"1": "Kinderfietsen"
},
"3": {
"1": "BMX-fietsen"
},
"4": {
"1": "mountainbike"
},
"5": {
"1": "Fietstassen"
}
}
}
},
"bicycle-types": {
"mappings": {
"0": {
"then": "Gewone stadsfietsen kunnen hier gehuurd worden"
},
"1": {
"then": "Elektrische fietsen kunnen hier gehuurd worden"
},
"2": {
"then": "BMX-fietsen kunnen hier gehuurd worden"
},
"3": {
"then": "Mountainbikes kunnen hier gehuurd worden"
},
"4": {
"then": "Kinderfietsen kunnen hier gehuurd worden"
}
},
"question": "Wat voor soort fietsen en fietstoebehren worden hier verhuurd?"
},
"bicycle_rental_type": {

View file

@ -37,7 +37,7 @@
"generate:contributor-list": "git log --pretty='%aN' | sort | uniq -c | sort -hr | sed 's/ *\\([0-9]*\\) \\(.*\\)$/{\"contributor\":\"\\2\", \"commits\":\\1}/' | tr '\\n' ',' | sed 's/^/{\"contributors\":[/' | sed 's/,$/]}/' | jq > assets/contributors.json",
"generate:schemas": "ts2json-schema -p Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && ts-node scripts/fixSchemas.ts ",
"optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",
"reset:layeroverview": "echo {\\\"layers\\\":[], \\\"themes\\\":[]} > ./assets/generated/known_layers_and_themes.json",
"reset:layeroverview": "echo {\\\"layers\\\":[], \\\"themes\\\":[]} > ./assets/generated/known_layers_and_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json",
"generate": "mkdir -p ./assets/generated && npm run reset:layeroverview && npm run generate:images && npm run generate:charging-stations && npm run generate:translations && npm run generate:licenses && npm run generate:layeroverview",
"generate:charging-stations": "cd ./assets/layers/charging_station && ts-node csvToJson.ts && cd -",
"prepare-deploy": "./scripts/build.sh",