Fix build

This commit is contained in:
Pieter Vander Vennet 2023-12-30 16:33:52 +01:00
parent bad0edd4b0
commit 3cf6ebbb69
5 changed files with 53 additions and 104 deletions

View file

@ -1,16 +1,13 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"title": { "title": {
"en": "Changes made with MapComplete", "en": "Changes made with MapComplete"
"de": "Mit MapComplete vorgenommene Änderungen"
}, },
"shortDescription": { "shortDescription": {
"en": "Shows changes made by MapComplete", "en": "Shows changes made by MapComplete"
"de": "Zeigt die von MapComplete vorgenommenen Änderungen an"
}, },
"description": { "description": {
"en": "This maps shows all the changes made with MapComplete", "en": "This maps shows all the changes made with MapComplete"
"de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen"
}, },
"icon": "./assets/svg/logo.svg", "icon": "./assets/svg/logo.svg",
"hideFromOverview": true, "hideFromOverview": true,
@ -23,8 +20,7 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"name": { "name": {
"en": "Changeset centers", "en": "Changeset centers"
"de": "Zentrum der Änderungssätze"
}, },
"minzoom": 0, "minzoom": 0,
"source": { "source": {
@ -35,48 +31,41 @@
}, },
"title": { "title": {
"render": { "render": {
"en": "Changeset for {theme}", "en": "Changeset for {theme}"
"de": "Änderungssatz für {theme}"
} }
}, },
"description": { "description": {
"en": "Shows all MapComplete changes", "en": "Shows all MapComplete changes"
"de": "Zeigt alle MapComplete-Änderungen"
}, },
"tagRenderings": [ "tagRenderings": [
{ {
"id": "show_changeset_id", "id": "show_changeset_id",
"render": { "render": {
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>", "en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
"de": "Änderungssatz <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
} }
}, },
{ {
"id": "contributor", "id": "contributor",
"question": { "question": {
"en": "What contributor did make this change?", "en": "What contributor did make this change?"
"de": "Wer hat diese Änderung vorgenommen?"
}, },
"freeform": { "freeform": {
"key": "user" "key": "user"
}, },
"render": { "render": {
"en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>", "en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
"de": "Änderung von <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
} }
}, },
{ {
"id": "theme-id", "id": "theme-id",
"question": { "question": {
"en": "What theme was used to make this change?", "en": "What theme was used to make this change?"
"de": "Welches Theme wurde für diese Änderung verwendet?"
}, },
"freeform": { "freeform": {
"key": "theme" "key": "theme"
}, },
"render": { "render": {
"en": "Change with theme <a href='https://mapcomplete.org/{theme}'>{theme}</a>", "en": "Change with theme <a href='https://mapcomplete.org/{theme}'>{theme}</a>"
"de": "Geändert mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
} }
}, },
{ {
@ -85,23 +74,19 @@
"key": "locale" "key": "locale"
}, },
"question": { "question": {
"en": "What locale (language) was this change made in?", "en": "What locale (language) was this change made in?"
"de": "In welcher Benutzersprache wurde diese Änderung vorgenommen?"
}, },
"render": { "render": {
"en": "User locale is {locale}", "en": "User locale is {locale}"
"de": "Benutzersprache {locale}"
} }
}, },
{ {
"id": "host", "id": "host",
"render": { "render": {
"en": "Change with with <a href='{host}'>{host}</a>", "en": "Change with with <a href='{host}'>{host}</a>"
"de": "Geändert über <a href='{host}'>{host}</a>"
}, },
"question": { "question": {
"en": "What host (website) was this change made with?", "en": "What host (website) was this change made with?"
"de": "Über welchen Host (Webseite) wurde diese Änderung vorgenommen?"
}, },
"freeform": { "freeform": {
"key": "host" "key": "host"
@ -122,12 +107,10 @@
{ {
"id": "version", "id": "version",
"question": { "question": {
"en": "What version of MapComplete was used to make this change?", "en": "What version of MapComplete was used to make this change?"
"de": "Welche Version von MapComplete wurde verwendet, um diese Änderung vorzunehmen?"
}, },
"render": { "render": {
"en": "Made with {editor}", "en": "Made with {editor}"
"de": "Erstellt mit {editor}"
}, },
"freeform": { "freeform": {
"key": "editor" "key": "editor"
@ -477,8 +460,7 @@
} }
], ],
"question": { "question": {
"en": "Themename contains {search}", "en": "Themename contains {search}"
"de": "Themename enthält {search}"
} }
} }
] ]
@ -494,8 +476,7 @@
} }
], ],
"question": { "question": {
"en": "Themename does <b>not</b> contain {search}", "en": "Themename does <b>not</b> contain {search}"
"de": "Der Name enthält <b>nicht</b> {search}"
} }
} }
] ]
@ -511,8 +492,7 @@
} }
], ],
"question": { "question": {
"en": "Made by contributor {search}", "en": "Made by contributor {search}"
"de": "<b>Nicht</b> erstellt von {search}"
} }
} }
] ]
@ -528,8 +508,7 @@
} }
], ],
"question": { "question": {
"en": "<b>Not</b> made by contributor {search}", "en": "<b>Not</b> made by contributor {search}"
"de": "Erstellt vor {search}"
} }
} }
] ]
@ -546,8 +525,7 @@
} }
], ],
"question": { "question": {
"en": "Made before {search}", "en": "Made before {search}"
"de": "Erstellt nach {search}"
} }
} }
] ]
@ -564,8 +542,7 @@
} }
], ],
"question": { "question": {
"en": "Made after {search}", "en": "Made after {search}"
"de": "Benutzersprache (ISO-Code) {search}"
} }
} }
] ]
@ -581,8 +558,7 @@
} }
], ],
"question": { "question": {
"en": "User language (iso-code) {search}", "en": "User language (iso-code) {search}"
"de": "Erstellt mit Host {search}"
} }
} }
] ]
@ -598,8 +574,7 @@
} }
], ],
"question": { "question": {
"en": "Made with host {search}", "en": "Made with host {search}"
"de": "Im Änderungssatz wurde mindestens ein Bild hinzugefügt"
} }
} }
] ]
@ -610,8 +585,7 @@
{ {
"osmTags": "add-image>0", "osmTags": "add-image>0",
"question": { "question": {
"en": "Changeset added at least one image", "en": "Changeset added at least one image"
"de": "Änderungssatz hat mindestens ein Bild hinzugefügt"
} }
} }
] ]
@ -622,8 +596,7 @@
{ {
"osmTags": "theme!=grb", "osmTags": "theme!=grb",
"question": { "question": {
"en": "Exclude GRB theme", "en": "Exclude GRB theme"
"de": "GRB-Theme ausschließen"
} }
} }
] ]
@ -634,8 +607,7 @@
{ {
"osmTags": "theme!=etymology", "osmTags": "theme!=etymology",
"question": { "question": {
"en": "Exclude etymology theme", "en": "Exclude etymology theme"
"de": "Etymologie-Thema ausschließen"
} }
} }
] ]
@ -650,8 +622,7 @@
{ {
"id": "link_to_more", "id": "link_to_more",
"render": { "render": {
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>", "en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
"de": "Mehr Statistiken gibt es <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>"
} }
}, },
{ {

View file

@ -921,42 +921,42 @@
"2": { "2": {
"options": { "options": {
"0": { "0": {
"question": "<b>Nicht</b> erstellt von {search}" "question": "Der Name enthält <b>nicht</b> {search}"
} }
} }
}, },
"3": { "3": {
"options": { "options": {
"0": { "0": {
"question": "Erstellt vor {search}" "question": "<b>Nicht</b> erstellt von {search}"
} }
} }
}, },
"4": { "4": {
"options": { "options": {
"0": { "0": {
"question": "Erstellt nach {search}" "question": "Erstellt vor {search}"
} }
} }
}, },
"5": { "5": {
"options": { "options": {
"0": { "0": {
"question": "Benutzersprache (ISO-Code) {search}" "question": "Erstellt nach {search}"
} }
} }
}, },
"6": { "6": {
"options": { "options": {
"0": { "0": {
"question": "Erstellt mit Host {search}" "question": "Benutzersprache (ISO-Code) {search}"
} }
} }
}, },
"7": { "7": {
"options": { "options": {
"0": { "0": {
"question": "Im Änderungssatz wurde mindestens ein Bild hinzugefügt" "question": "Erstellt mit Host {search}"
} }
} }
}, },

View file

@ -18,6 +18,7 @@ npm run prep:layeroverview &&
npm run generate && # includes a single "refresh:layeroverview". Resetting the files is unnecessary as they are not in there in the first place npm run generate && # includes a single "refresh:layeroverview". Resetting the files is unnecessary as they are not in there in the first place
npm run refresh:layeroverview && # run refresh:layeroverview a second time to propagate all calls npm run refresh:layeroverview && # run refresh:layeroverview a second time to propagate all calls
npm run refresh:layeroverview && # run refresh:layeroverview a third time to fix some issues with the favourite layer all calls npm run refresh:layeroverview && # run refresh:layeroverview a third time to fix some issues with the favourite layer all calls
npm run generate:mapcomplete-changes-theme &&
npm run generate:layouts npm run generate:layouts

View file

@ -3,40 +3,12 @@ import { Utils } from "../../Utils"
export class ThemeMetaTagging { export class ThemeMetaTagging {
public static readonly themeName = "usersettings" public static readonly themeName = "usersettings"
public metaTaggging_for_usersettings(feat: { properties: Record<string, string> }) { public metaTaggging_for_usersettings(feat: {properties: Record<string, string>}) {
Utils.AddLazyProperty(feat.properties, "_mastodon_candidate_md", () => Utils.AddLazyProperty(feat.properties, '_mastodon_candidate_md', () => feat.properties._description.match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/)?.at(1) )
feat.properties._description Utils.AddLazyProperty(feat.properties, '_d', () => feat.properties._description?.replace(/&lt;/g,'<')?.replace(/&gt;/g,'>') ?? '' )
.match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/) Utils.AddLazyProperty(feat.properties, '_mastodon_candidate_a', () => (feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName("a")).filter(a => a.href.match(/mastodon|en.osm.town/) !== null)[0]?.href }) (feat) )
?.at(1) Utils.AddLazyProperty(feat.properties, '_mastodon_link', () => (feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName("a")).filter(a => a.getAttribute("rel")?.indexOf('me') >= 0)[0]?.href})(feat) )
) Utils.AddLazyProperty(feat.properties, '_mastodon_candidate', () => feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a )
Utils.AddLazyProperty( feat.properties['__current_backgroun'] = 'initial_value'
feat.properties,
"_d",
() => feat.properties._description?.replace(/&lt;/g, "<")?.replace(/&gt;/g, ">") ?? ""
)
Utils.AddLazyProperty(feat.properties, "_mastodon_candidate_a", () =>
((feat) => {
const e = document.createElement("div")
e.innerHTML = feat.properties._d
return Array.from(e.getElementsByTagName("a")).filter(
(a) => a.href.match(/mastodon|en.osm.town/) !== null
)[0]?.href
})(feat)
)
Utils.AddLazyProperty(feat.properties, "_mastodon_link", () =>
((feat) => {
const e = document.createElement("div")
e.innerHTML = feat.properties._d
return Array.from(e.getElementsByTagName("a")).filter(
(a) => a.getAttribute("rel")?.indexOf("me") >= 0
)[0]?.href
})(feat)
)
Utils.AddLazyProperty(
feat.properties,
"_mastodon_candidate",
() => feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a
)
feat.properties["__current_backgroun"] = "initial_value"
} }
} }

File diff suppressed because one or more lines are too long