diff --git a/assets/layers/usertouched/usertouched.json b/assets/layers/usertouched/usertouched.json deleted file mode 100644 index f22e5e104..000000000 --- a/assets/layers/usertouched/usertouched.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "id": "usertouched", - "description": { - "en": "Special layer showing all items which were changed by a certain user" - }, - "name": { - "en": "Changed by user" - }, - "title": { - "render": { - "en": "Changed by user" - } - }, - "source": "special", - "tagRenderings": [ - { - "id": "test", - "render": { - "en": "Changed by user" - } - }, - "all_tags" - ], - "pointRendering": [ - { - "location": [ - "point", - "centroid" - ], - "iconSize": "15,15", - "marker": [ - { - "icon": "circle", - "color": "#aaa" - }, - { - "icon": "ring", - "color": "#000" - } - ] - } - ], - "lineRendering": [ - { - "color": "black", - "width": 3, - "fillColor": "#00000000" - }, - { - "color": "#cccccccc", - "width": { - "render": 0, - "mappings": [ - { - "if": { - "or": [ - "_geometry:type=Polygon", - "_geometry:type=MultiPolygon" - ] - }, - "then": 20 - } - ] - }, - "offset": 15, - "fillColor": "#00000000" - } - ], - "allowMove": false -} diff --git a/assets/themes/inspector/inspector.json b/assets/themes/inspector/inspector.json deleted file mode 100644 index 9a531f3d8..000000000 --- a/assets/themes/inspector/inspector.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": "inspector", - "title": { - "en": "Inspect changes from a single user" - }, - "description": { - "en": "A theme to inspect what a single user did in the past" - }, - "icon": "./assets/svg/add.svg", - "layers": [ - "usertouched" - ] -} diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 9cc62392c..f06464705 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -4,20 +4,26 @@ "en": "Changes made with MapComplete", "de": "Änderungen mit MapComplete", "cs": "Změny provedené pomocí MapComplete", - "es": "Cambios realizados con MapComplete" + "es": "Cambios realizados con MapComplete", + "fr": "Modifications faites avec MapComplete", + "nl": "Wijzigingen gemaakt met MapComplete" }, "shortDescription": { "en": "Shows changes made by MapComplete", "de": "Zeigt die von MapComplete vorgenommenen Änderungen an", "cs": "Zobrazuje změny provedené nástrojem MapComplete", - "es": "Muestra los cambios realizados por MapComplete" + "es": "Muestra los cambios realizados por MapComplete", + "fr": "Afficher les modifications faites avec MapComplete", + "nl": "Toont wijzigingen gemaakt met MapComplete" }, "description": { "en": "This maps shows all the changes made with MapComplete", "de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen", "es": "Este mapa muestra todos los cambios realizados con MapComplete", "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete", - "cs": "Tyto mapy zobrazují všechny změny provedené pomocí MapComplete" + "cs": "Tyto mapy zobrazují všechny změny provedené pomocí MapComplete", + "fr": "Cette carte montre tous les changements effectués avec MapComplete", + "nl": "Deze kaarten tonen alle wijzigingen die zijn gemaakt met MapComplete" }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -30,7 +36,10 @@ "name": { "en": "Changeset centers", "de": "Changeset-Zentren", - "es": "Centros de conjuntos de cambios" + "es": "Centros de conjuntos de cambios", + "fr": "Centre du groupe de modifications", + "nl": "Changeset centra", + "cs": "Changeset centra" }, "minzoom": 0, "source": { @@ -43,14 +52,16 @@ "en": "Changeset for {theme}", "de": "Änderungssatz für {theme}", "cs": "Sada změn pro {theme}", - "es": "Conjunto de cambios para {theme}" + "es": "Conjunto de cambios para {theme}", + "nl": "Changeset voor {theme}" } }, "description": { "en": "Shows all MapComplete changes", "de": "Zeigt alle MapComplete-Änderungen", "es": "Muestra todos los cambios de MapComplete", - "cs": "Zobrazí všechny změny MapComplete" + "cs": "Zobrazí všechny změny MapComplete", + "nl": "Toon alle MapComplete-wijzigingen" }, "tagRenderings": [ { @@ -59,7 +70,8 @@ "en": "Changeset {id}", "de": "Änderungssatz {id}", "cs": "Sada změn {id}", - "es": "Conjunto de cambios {id}" + "es": "Conjunto de cambios {id}", + "nl": "Changeset {id}" } }, { @@ -68,7 +80,8 @@ "en": "What contributor did make this change?", "de": "Wer hat zu dieser Änderung beigetragen?", "cs": "Který přispěvatel provedl tuto změnu?", - "es": "¿Qué colaborador realizó este cambio?" + "es": "¿Qué colaborador realizó este cambio?", + "nl": "Welke bijdrager maakte deze verandering?" }, "freeform": { "key": "user" @@ -77,7 +90,9 @@ "en": "Change made by {user}", "de": "Änderung vorgenommen von {user}", "cs": "Změna provedena uživatelem {user}", - "es": "Cambio realizado por {user}" + "es": "Cambio realizado por {user}", + "fr": "Modification faite par {user}", + "nl": "Wijziging aangebracht door {user}" } }, { @@ -86,7 +101,8 @@ "en": "What theme was used to make this change?", "de": "Welches Thema wurde für diese Änderung verwendet?", "cs": "Jaký motiv byl použit k provedení této změny?", - "es": "¿Qué tema se utilizó para realizar este cambio?" + "es": "¿Qué tema se utilizó para realizar este cambio?", + "nl": "Welk thema werd gebruikt voor deze wijziging?" }, "freeform": { "key": "theme" @@ -94,7 +110,9 @@ "render": { "en": "Change with theme {theme}", "de": "Änderung mit Thema {theme}", - "es": "Cambio con el tema {theme}" + "es": "Cambio con el tema {theme}", + "nl": "Verander met thema {theme}", + "cs": "Změna pomocí tématu {theme}" } }, { @@ -106,13 +124,15 @@ "en": "What locale (language) was this change made in?", "de": "In welcher Sprache (Locale) wurde diese Änderung vorgenommen?", "cs": "V jakém prostředí (jazyce) byla tato změna provedena?", - "es": "¿En qué configuración regional (idioma) se realizó este cambio?" + "es": "¿En qué configuración regional (idioma) se realizó este cambio?", + "nl": "In welke 'locale' (taal) is deze wijziging gemaakt?" }, "render": { "en": "User locale is {locale}", "de": "Die Benutzersprache ist {locale}", "cs": "Uživatelské prostředí je {locale}", - "es": "Configuración regional del usuario es {locale}" + "es": "Configuración regional del usuario es {locale}", + "nl": "De gebruikerstaal (locale) is {locale}" } }, { @@ -121,13 +141,15 @@ "en": "Change with with {host}", "de": "Änderung mit {host}", "cs": "Změnit pomocí {host}", - "es": "Cambio realizado con {host}" + "es": "Cambio realizado con {host}", + "nl": "Gewijzigd met {host}" }, "question": { "en": "What host (website) was this change made with?", "de": "Bei welchem Host (Website) wurde diese Änderung vorgenommen?", "cs": "U jakého hostitele (webové stránky) byla tato změna provedena?", - "es": "¿Con qué anfitrión (sitio web) se realizó este cambio?" + "es": "¿Con qué anfitrión (sitio web) se realizó este cambio?", + "nl": "Met welke host (website) is deze wijziging gemaakt?" }, "freeform": { "key": "host" @@ -151,13 +173,17 @@ "en": "What version of MapComplete was used to make this change?", "de": "Welche Version von MapComplete wurde verwendet, um diese Änderung vorzunehmen?", "cs": "Jaká verze aplikace MapComplete byla použita k provedení této změny?", - "es": "¿Qué versión de MapComplete se utilizó para realizar este cambio?" + "es": "¿Qué versión de MapComplete se utilizó para realizar este cambio?", + "fr": "Quelle version de MapCompletee a été utilisée pour faire cette modification ?", + "nl": "Welke versie van MapComplete is gebruikt voor deze wijziging?" }, "render": { "en": "Made with {editor}", "de": "Erstellt mit {editor}", "cs": "Vytvořeno pomocí {editor}", - "es": "Hecho con {editor}" + "es": "Hecho con {editor}", + "fr": "Fait avec {editor}", + "nl": "Gemaakt met {editor}" }, "freeform": { "key": "editor" @@ -352,8 +378,8 @@ "then": "./assets/layers/entrance/entrance.svg" }, { - "if": "theme=inspector", - "then": "./assets/svg/add.svg" + "if": "theme=insects", + "then": "./assets/layers/insect_hotel/insect_hotel.svg" }, { "if": "theme=items_with_image", @@ -563,7 +589,9 @@ "de": "Themenname enthält {search}", "es": "El nombre del tema contiene {search}", "pl": "Nazwa tematu zawiera {search}", - "cs": "Název obsahuje {search}" + "cs": "Název obsahuje {search}", + "fr": "Le nom du thème contient {search}", + "nl": "Themanaam bevat {search}" } } ] @@ -582,7 +610,9 @@ "en": "Themename does not contain {search}", "de": "Themename enthält nicht {search}", "es": "El nombre del tema no contiene {search}", - "cs": "Název motivu neobsahuje {search}" + "cs": "Název motivu neobsahuje {search}", + "fr": "Le nom du thème ne contient pas {search}", + "nl": "Themanaam bevat geen {search}" } } ] @@ -601,7 +631,9 @@ "en": "Made by contributor {search}", "de": "Erstellt von Mitwirkendem {search}", "es": "Hecho por el colaborador {search}", - "cs": "Vytvořeno přispěvatelem {search}" + "cs": "Vytvořeno přispěvatelem {search}", + "fr": "Fait par le·a contributeur·trice {search}", + "nl": "Toegevoegd door {search}" } } ] @@ -620,7 +652,9 @@ "en": "Not made by contributor {search}", "de": "Nicht erstellt von Mitwirkendem {search}", "es": "No hecho por el colaborador {search}", - "cs": "Nevytvořeno přispěvatelem {search}" + "cs": "Nevytvořeno přispěvatelem {search}", + "fr": "Pas fait par le·a contributeur·trice {search}", + "nl": "Niet toegevoegd door {search}" } } ] @@ -640,7 +674,9 @@ "en": "Made before {search}", "de": "Erstellt vor {search}", "es": "Hecho antes de {search}", - "cs": "Vytvořeno před {search}" + "cs": "Vytvořeno před {search}", + "fr": "Fait avant {search}", + "nl": "Toegevoegd vóór {search}" } } ] @@ -660,7 +696,9 @@ "en": "Made after {search}", "de": "Erstellt nach {search}", "es": "Hecho después de {search}", - "cs": "Vytvořeno po {search}" + "cs": "Vytvořeno po {search}", + "fr": "Fait après {search}", + "nl": "Toegevoegd na {search}" } } ] @@ -679,7 +717,9 @@ "en": "User language (iso-code) {search}", "de": "Benutzersprache (ISO-Code) {search}", "es": "Idioma del usuario (código ISO) {search}", - "cs": "Jazyk uživatele (iso-kód) {search}" + "cs": "Jazyk uživatele (iso-kód) {search}", + "fr": "Langage utilisateur (code iso) {search}", + "nl": "Gebruikerstaal (iso-code) {search}" } } ] @@ -698,7 +738,8 @@ "en": "Made with host {search}", "de": "Erstellt mit Host {search}", "cs": "Vytvořeno pomocí hostitele {search}", - "es": "Hecho con el anfitrión {search}" + "es": "Hecho con el anfitrión {search}", + "nl": "Gemaakt met {search}" } } ] @@ -712,7 +753,8 @@ "en": "Changeset added at least one image", "de": "Changeset hat mindestens ein Bild hinzugefügt", "cs": "Sada změn přidala alespoň jeden obrázek", - "es": "El conjunto de cambios agregó al menos una imagen" + "es": "El conjunto de cambios agregó al menos una imagen", + "nl": "Changeset voegde minstens één afbeelding toe" } } ] @@ -726,7 +768,8 @@ "en": "Exclude GRB theme", "de": "GRB-Thema ausschließen", "cs": "Vyloučit motiv GRB", - "es": "Excluir el tema GRB" + "es": "Excluir el tema GRB", + "nl": "GRB-thema uitsluiten" } } ] @@ -740,7 +783,8 @@ "en": "Exclude etymology theme", "de": "Etymologie-Thema ausschließen", "es": "Excluir el tema de etimología", - "cs": "Vyloučit etymologii tématu" + "cs": "Vyloučit etymologii tématu", + "nl": "Thema etymologie uitsluiten" } } ] @@ -758,7 +802,9 @@ "en": "More statistics can be found here", "de": "Weitere Statistiken findest du hier", "cs": "Další statistiky najdete zde", - "es": "Puedes encontrar más estadísticas aquí" + "es": "Puedes encontrar más estadísticas aquí", + "fr": "Plus de statistiques peuvent être trouvées ici", + "nl": "Meer statistieken vind je hier" } }, { diff --git a/package.json b/package.json index ab048e407..805e57a9b 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "generate": "npm run generate:licenses && npm run generate:images && npm run generate:charging-stations && npm run generate:translations && npm run refresh:layeroverview && npm run generate:service-worker", "generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -", "clean:tests": "find . -type f -name \"*.doctest.ts\" | xargs -r rm", - "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|privacy\\|test\\|studio\\|theme\\|style_test\\|statistics\\|status\\|leaderboard\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm)", + "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|privacy\\|test\\|studio\\|theme\\|style_test\\|statistics\\|status\\|leaderboard\\|inspector\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm)", "generate:dependency-graph": "node_modules/.bin/depcruise --exclude \"^node_modules\" --output-type dot Logic/State/MapState.ts > dependencies.dot && dot dependencies.dot -T svg -o dependencies.svg && rm dependencies.dot", "scrapeWebsites": "vite-node scripts/importscripts/compareWebsiteData.ts -- ~/Downloads/ShopsWithWebsiteNodes.csv ~/data/scraped_websites/", "### 0": "VELOPARK", diff --git a/src/Logic/State/UserSettingsMetaTagging.ts b/src/Logic/State/UserSettingsMetaTagging.ts index 6e568c5c3..33a5ae85b 100644 --- a/src/Logic/State/UserSettingsMetaTagging.ts +++ b/src/Logic/State/UserSettingsMetaTagging.ts @@ -1,42 +1,14 @@ import { Utils } from "../../Utils" /** This code is autogenerated - do not edit. Edit ./assets/layers/usersettings/usersettings.json instead */ export class ThemeMetaTagging { - public static readonly themeName = "usersettings" + public static readonly themeName = "usersettings" - public metaTaggging_for_usersettings(feat: { properties: Record }) { - Utils.AddLazyProperty(feat.properties, "_mastodon_candidate_md", () => - feat.properties._description - .match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/) - ?.at(1) - ) - Utils.AddLazyProperty( - feat.properties, - "_d", - () => feat.properties._description?.replace(/</g, "<")?.replace(/>/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" - } -} + public metaTaggging_for_usersettings(feat: {properties: Record}) { + Utils.AddLazyProperty(feat.properties, '_mastodon_candidate_md', () => feat.properties._description.match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/)?.at(1) ) + Utils.AddLazyProperty(feat.properties, '_d', () => feat.properties._description?.replace(/</g,'<')?.replace(/>/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' + } +} \ No newline at end of file diff --git a/src/Models/Constants.ts b/src/Models/Constants.ts index 916a1836c..4d9a33c95 100644 --- a/src/Models/Constants.ts +++ b/src/Models/Constants.ts @@ -40,8 +40,7 @@ export default class Constants { "import_candidate", "usersettings", "icons", - "filters", - "usertouched" + "filters" ] as const /** * Layer IDs of layers which have special properties through built-in hooks diff --git a/src/UI/InspectorGUI.svelte b/src/UI/InspectorGUI.svelte index ea4457688..8d2c99afc 100644 --- a/src/UI/InspectorGUI.svelte +++ b/src/UI/InspectorGUI.svelte @@ -8,14 +8,12 @@ import { MapLibreAdaptor } from "./Map/MapLibreAdaptor" import { Map as MlMap } from "maplibre-gl" import ShowDataLayer from "./Map/ShowDataLayer" - import * as inspector_theme from "../assets/generated/themes/inspector.json" import StaticFeatureSource from "../Logic/FeatureSource/Sources/StaticFeatureSource" import type { Feature } from "geojson" import Loading from "./Base/Loading.svelte" import { linear } from "svelte/easing" import { Drawer } from "flowbite-svelte" - import ThemeConfig from "../Models/ThemeConfig/ThemeConfig" import History from "./History/History.svelte" import TitledPanel from "./Base/TitledPanel.svelte" import { XCircleIcon } from "@babeard/svelte-heroicons/solid" @@ -36,12 +34,6 @@ let zoom = UIEventSource.asFloat(QueryParameters.GetQueryParameter("z", "0")) let lat = UIEventSource.asFloat(QueryParameters.GetQueryParameter("lat", "0")) let lon = UIEventSource.asFloat(QueryParameters.GetQueryParameter("lon", "0")) - let theme = new ThemeConfig(inspector_theme, true) - let layer = theme.layers.find(l => l.id === "usertouched") - // Is this a dirty hack? Yes it is! - theme.getMatchingLayer = () => { - return layer - } let loadingData = false let selectedElement = new UIEventSource(undefined)