diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c01a70c57..7eb16a3e6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.46.9](https://github.com/USERNAME/REPOSITORY_NAME/compare/v0.46.8...v0.46.9) (2024-09-14) + + +### Bug Fixes + +* fix [#2142](https://github.com/pietervdvn/MapComplete/issues/2142) ([f2fca2d](https://github.com/USERNAME/REPOSITORY_NAME/commitsf2fca2dad8576a18629591e886e511912c1d99e9)) +* nobrand= is actually applied when using the Name suggestion index ([c3bb0cb](https://github.com/USERNAME/REPOSITORY_NAME/commitsc3bb0cb83787c299ee4a92e8df6046aa448d77c8)) +* scroll horizontal images into view ([0397863](https://github.com/USERNAME/REPOSITORY_NAME/commits03978631ebd1e61abd13dd7a53bdb400c3d0f059)) +* some fixes to make studio useable again, probably fixes [#2139](https://github.com/pietervdvn/MapComplete/issues/2139) ([6672fc8](https://github.com/USERNAME/REPOSITORY_NAME/commits6672fc87b4326db65289dfa31599ec0583d6c0f4)) + + +### Theme improvements + +* **disaster_respone:** add a police station layer, add this and more layers to disaster_response theme ([418a4a7](https://github.com/USERNAME/REPOSITORY_NAME/commits418a4a71af5824487e4aa6754701e5d14371beae)) +* **disaster_response:** add defibrillators and logical zoom levels ([65fceb9](https://github.com/USERNAME/REPOSITORY_NAME/commits65fceb9434294051c8f565d89f42443c6afe3fb8)) + ### [0.46.8](https://github.com/USERNAME/REPOSITORY_NAME/compare/v0.46.7...v0.46.8) (2024-09-13) diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 7873f6b663..67501aaefb 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -1,13 +1,18 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete" + "en": "Changes made with MapComplete", + "de": "Änderungen mit MapComplete" }, "shortDescription": { - "en": "Shows changes made by MapComplete" + "en": "Shows changes made by MapComplete", + "de": "Zeigt die von MapComplete vorgenommenen Änderungen an" }, "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", + "es": "Este mapa muestra todos los cambios realizados con MapComplete", + "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete" }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -18,7 +23,8 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers" + "en": "Changeset centers", + "de": "Changeset-Zentren" }, "minzoom": 0, "source": { @@ -28,41 +34,49 @@ }, "title": { "render": { - "en": "Changeset for {theme}" + "en": "Changeset for {theme}", + "de": "Änderungssatz für {theme}" } }, "description": { - "en": "Shows all MapComplete changes" + "en": "Shows all MapComplete changes", + "de": "Zeigt alle MapComplete-Änderungen", + "es": "Muestra todos los cambios de MapComplete" }, "tagRenderings": [ { "id": "show_changeset_id", "render": { - "en": "Changeset {id}" + "en": "Changeset {id}", + "de": "Änderungssatz {id}" } }, { "id": "contributor", "question": { - "en": "What contributor did make this change?" + "en": "What contributor did make this change?", + "de": "Wer hat zu dieser Änderung beigetragen?" }, "freeform": { "key": "user" }, "render": { - "en": "Change made by {user}" + "en": "Change made by {user}", + "de": "Änderung vorgenommen von {user}" } }, { "id": "theme-id", "question": { - "en": "What theme was used to make this change?" + "en": "What theme was used to make this change?", + "de": "Welches Thema wurde für diese Änderung verwendet?" }, "freeform": { "key": "theme" }, "render": { - "en": "Change with theme {theme}" + "en": "Change with theme {theme}", + "de": "Änderung mit Thema {theme}" } }, { @@ -71,19 +85,23 @@ "key": "locale" }, "question": { - "en": "What locale (language) was this change made in?" + "en": "What locale (language) was this change made in?", + "de": "In welcher Sprache (Locale) wurde diese Änderung vorgenommen?" }, "render": { - "en": "User locale is {locale}" + "en": "User locale is {locale}", + "de": "Die Benutzersprache ist {locale}" } }, { "id": "host", "render": { - "en": "Change with with {host}" + "en": "Change with with {host}", + "de": "Änderung mit {host}" }, "question": { - "en": "What host (website) was this change made with?" + "en": "What host (website) was this change made with?", + "de": "Bei welchem Host (Website) wurde diese Änderung vorgenommen?" }, "freeform": { "key": "host" @@ -104,10 +122,12 @@ { "id": "version", "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": { - "en": "Made with {editor}" + "en": "Made with {editor}", + "de": "Erstellt mit {editor}" }, "freeform": { "key": "editor" @@ -505,7 +525,10 @@ } ], "question": { - "en": "Themename contains {search}" + "en": "Themename contains {search}", + "de": "Themenname enthält {search}", + "es": "El nombre contiene {search}", + "pl": "Nazwa tematu zawiera {search}" } } ] @@ -521,7 +544,9 @@ } ], "question": { - "en": "Themename does not contain {search}" + "en": "Themename does not contain {search}", + "de": "Themename enthält nicht {search}", + "es": "El nombre del tema no contiene {search}" } } ] @@ -537,7 +562,9 @@ } ], "question": { - "en": "Made by contributor {search}" + "en": "Made by contributor {search}", + "de": "Erstellt von Mitwirkendem {search}", + "es": "Hecho por el colaborador {search}" } } ] @@ -553,7 +580,9 @@ } ], "question": { - "en": "Not made by contributor {search}" + "en": "Not made by contributor {search}", + "de": "Nicht erstellt von Mitwirkendem {search}", + "es": "No realizado por el colaborador {search}" } } ] @@ -570,7 +599,9 @@ } ], "question": { - "en": "Made before {search}" + "en": "Made before {search}", + "de": "Erstellt vor {search}", + "es": "Realizado antes de {search}" } } ] @@ -587,7 +618,9 @@ } ], "question": { - "en": "Made after {search}" + "en": "Made after {search}", + "de": "Erstellt nach {search}", + "es": "Realizado después de {search}" } } ] @@ -603,7 +636,9 @@ } ], "question": { - "en": "User language (iso-code) {search}" + "en": "User language (iso-code) {search}", + "de": "Benutzersprache (ISO-Code) {search}", + "es": "Idioma del usuario (código iso) {search}" } } ] @@ -619,7 +654,8 @@ } ], "question": { - "en": "Made with host {search}" + "en": "Made with host {search}", + "de": "Erstellt mit Host {search}" } } ] @@ -630,7 +666,8 @@ { "osmTags": "add-image>0", "question": { - "en": "Changeset added at least one image" + "en": "Changeset added at least one image", + "de": "Changeset hat mindestens ein Bild hinzugefügt" } } ] @@ -641,7 +678,8 @@ { "osmTags": "theme!=grb", "question": { - "en": "Exclude GRB theme" + "en": "Exclude GRB theme", + "de": "GRB-Thema ausschließen" } } ] @@ -652,7 +690,9 @@ { "osmTags": "theme!=etymology", "question": { - "en": "Exclude etymology theme" + "en": "Exclude etymology theme", + "de": "Etymologie-Thema ausschließen", + "es": "Excluir el tema de la etimología" } } ] @@ -667,7 +707,8 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here" + "en": "More statistics can be found here", + "de": "Weitere Statistiken findest du hier" } }, { diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json index 4a55a1cf13..cde6afad78 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json @@ -1,13 +1,18 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete" + "en": "Changes made with MapComplete", + "de": "Änderungen mit MapComplete" }, "shortDescription": { - "en": "Shows changes made by MapComplete" + "en": "Shows changes made by MapComplete", + "de": "Zeigt die von MapComplete vorgenommenen Änderungen an" }, "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", + "es": "Este mapa muestra todos los cambios realizados con MapComplete", + "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete" }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -18,7 +23,8 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers" + "en": "Changeset centers", + "de": "Changeset-Zentren" }, "minzoom": 0, "source": { @@ -28,41 +34,49 @@ }, "title": { "render": { - "en": "Changeset for {theme}" + "en": "Changeset for {theme}", + "de": "Änderungssatz für {theme}" } }, "description": { - "en": "Shows all MapComplete changes" + "en": "Shows all MapComplete changes", + "de": "Zeigt alle MapComplete-Änderungen", + "es": "Muestra todos los cambios de MapComplete" }, "tagRenderings": [ { "id": "show_changeset_id", "render": { - "en": "Changeset {id}" + "en": "Changeset {id}", + "de": "Änderungssatz {id}" } }, { "id": "contributor", "question": { - "en": "What contributor did make this change?" + "en": "What contributor did make this change?", + "de": "Wer hat zu dieser Änderung beigetragen?" }, "freeform": { "key": "user" }, "render": { - "en": "Change made by {user}" + "en": "Change made by {user}", + "de": "Änderung vorgenommen von {user}" } }, { "id": "theme-id", "question": { - "en": "What theme was used to make this change?" + "en": "What theme was used to make this change?", + "de": "Welches Thema wurde für diese Änderung verwendet?" }, "freeform": { "key": "theme" }, "render": { - "en": "Change with theme {theme}" + "en": "Change with theme {theme}", + "de": "Änderung mit Thema {theme}" } }, { @@ -71,19 +85,23 @@ "key": "locale" }, "question": { - "en": "What locale (language) was this change made in?" + "en": "What locale (language) was this change made in?", + "de": "In welcher Sprache (Locale) wurde diese Änderung vorgenommen?" }, "render": { - "en": "User locale is {locale}" + "en": "User locale is {locale}", + "de": "Die Benutzersprache ist {locale}" } }, { "id": "host", "render": { - "en": "Change with with {host}" + "en": "Change with with {host}", + "de": "Änderung mit {host}" }, "question": { - "en": "What host (website) was this change made with?" + "en": "What host (website) was this change made with?", + "de": "Bei welchem Host (Website) wurde diese Änderung vorgenommen?" }, "freeform": { "key": "host" @@ -104,10 +122,12 @@ { "id": "version", "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": { - "en": "Made with {editor}" + "en": "Made with {editor}", + "de": "Erstellt mit {editor}" }, "freeform": { "key": "editor" @@ -143,7 +163,10 @@ } ], "question": { - "en": "Themename contains {search}" + "en": "Themename contains {search}", + "de": "Themenname enthält {search}", + "es": "El nombre contiene {search}", + "pl": "Nazwa tematu zawiera {search}" } } ] @@ -159,7 +182,9 @@ } ], "question": { - "en": "Themename does not contain {search}" + "en": "Themename does not contain {search}", + "de": "Themename enthält nicht {search}", + "es": "El nombre del tema no contiene {search}" } } ] @@ -175,7 +200,9 @@ } ], "question": { - "en": "Made by contributor {search}" + "en": "Made by contributor {search}", + "de": "Erstellt von Mitwirkendem {search}", + "es": "Hecho por el colaborador {search}" } } ] @@ -191,7 +218,9 @@ } ], "question": { - "en": "Not made by contributor {search}" + "en": "Not made by contributor {search}", + "de": "Nicht erstellt von Mitwirkendem {search}", + "es": "No realizado por el colaborador {search}" } } ] @@ -208,7 +237,9 @@ } ], "question": { - "en": "Made before {search}" + "en": "Made before {search}", + "de": "Erstellt vor {search}", + "es": "Realizado antes de {search}" } } ] @@ -225,7 +256,9 @@ } ], "question": { - "en": "Made after {search}" + "en": "Made after {search}", + "de": "Erstellt nach {search}", + "es": "Realizado después de {search}" } } ] @@ -241,7 +274,9 @@ } ], "question": { - "en": "User language (iso-code) {search}" + "en": "User language (iso-code) {search}", + "de": "Benutzersprache (ISO-Code) {search}", + "es": "Idioma del usuario (código iso) {search}" } } ] @@ -257,7 +292,8 @@ } ], "question": { - "en": "Made with host {search}" + "en": "Made with host {search}", + "de": "Erstellt mit Host {search}" } } ] @@ -268,7 +304,8 @@ { "osmTags": "add-image>0", "question": { - "en": "Changeset added at least one image" + "en": "Changeset added at least one image", + "de": "Changeset hat mindestens ein Bild hinzugefügt" } } ] @@ -279,7 +316,8 @@ { "osmTags": "theme!=grb", "question": { - "en": "Exclude GRB theme" + "en": "Exclude GRB theme", + "de": "GRB-Thema ausschließen" } } ] @@ -290,7 +328,9 @@ { "osmTags": "theme!=etymology", "question": { - "en": "Exclude etymology theme" + "en": "Exclude etymology theme", + "de": "Etymologie-Thema ausschließen", + "es": "Excluir el tema de la etimología" } } ] @@ -305,7 +345,8 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here" + "en": "More statistics can be found here", + "de": "Weitere Statistiken findest du hier" } }, { diff --git a/langs/de.json b/langs/de.json index 984be656ca..3d4932ead6 100644 --- a/langs/de.json +++ b/langs/de.json @@ -194,7 +194,7 @@ "josmNotOpened": "JOSM konnte nicht erreicht werden. Bitte sicherstellen, dass das Programm geöffnet und Remote Control aktiviert ist", "josmOpened": "JOSM ist geöffnet", "madeBy": "Erstellt von {author}", - "mapContributionsBy": "Die angezeigten Daten wurden bearbeitet durch {contributors}", + "mapContributionsBy": "Angezeigte Daten wurden bearbeitet durch {contributors}", "mapContributionsByAndHidden": "Die angezeigten Daten wurden bearbeitet von {contributors} und {hiddenCount} weiteren Beitragenden", "mapDataByOsm": "Kartendaten: OpenStreetMap", "mapillaryHelp": "Mapillary ist ein Online-Dienst, der Straßenbilder sammelt und sie unter einer freien Lizenz anbietet. Mitwirkende dürfen diese Bilder verwenden, um OpenStreetMap zu verbessern", @@ -873,4 +873,4 @@ "startsWithQ": "Ein Wikidata-Identifikator beginnt mit Q und wird von einer Zahl gefolgt" } } -} +} \ No newline at end of file diff --git a/langs/en.json b/langs/en.json index 7f468f8e3c..e4e1cbda72 100644 --- a/langs/en.json +++ b/langs/en.json @@ -618,7 +618,7 @@ "#": "These texts are shown above the theme buttons when no theme is loaded", "about": "About MapComplete", "featuredThemeTitle": "Featured this week", - "intro": "Maps about various topics which you contribute to", + "intro": "Maps about various topics which you can contribute to", "learnMore": "Learn more", "logIn": "Log in to see other themes you previously visited", "pickTheme": "Pick a theme below to get started.", diff --git a/langs/es.json b/langs/es.json index a749a08a71..07f6f6e7d3 100644 --- a/langs/es.json +++ b/langs/es.json @@ -420,7 +420,8 @@ "index": { "#": "Estos textos son mostrados sobre los botones del tema cuando no hay un tema cargado", "featuredThemeTitle": "Esta semana destacamos", - "intro": "Mapas sobre diversos temas a los que contribuye", + "intro": "Mapas sobre diversos temas a los que puedes contribuir", + "learnMore": "Más información", "logIn": "Inicia sesión para ver otros temas que visitaste anteriormente", "pickTheme": "Elige un tema de abajo para empezar.", "title": "MapComplete" diff --git a/langs/layers/de.json b/langs/layers/de.json index 3884c53d4d..378413c6b2 100644 --- a/langs/layers/de.json +++ b/langs/layers/de.json @@ -5176,6 +5176,9 @@ "4": { "then": "Sandwichladen" }, + "5": { + "then": "Burgerrestaurant" + }, "6": { "then": "Hier wird Sushi serviert" }, @@ -12228,4 +12231,4 @@ "render": "Windrad" } } -} \ No newline at end of file +} diff --git a/langs/layers/en.json b/langs/layers/en.json index 1115d81bf4..5dc29a970e 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -7697,6 +7697,50 @@ "render": "Playground device" } }, + "police": { + "description": "Many types of police facilities ", + "name": "Police stations", + "presets": { + "0": { + "description": "A police office where the general public can enter for inquiries", + "title": "a police office" + }, + "1": { + "description": "A place where police performs checks on travelling people", + "title": "a police checkpoint" + }, + "2": { + "description": "An administrative police office without services for the general public.", + "title": "an administrative, police backoffice" + }, + "3": { + "description": "A jail run by the police without public services. People are detained here for a short time (at most a few days), e.g. for small misdemeanors, disturbance of the public order or awaiting a trial" + }, + "4": { + "description": "A naval or maritime base for the maritime police; often with a pier and police boats nearby" + } + }, + "tagRenderings": { + "4_z2nrdhy6tyyh4fd": { + "mappings": { + "0": { + "then": "This police office has some cells to detain people" + }, + "1": { + "then": "This police office does not have cells to detain people" + } + }, + "question": "Does this police office have detention facilities?" + }, + "police_name": { + "question": "What is the name of this police facility?", + "render": "{name}" + } + }, + "title": { + "render": "{name}" + } + }, "postboxes": { "description": "The layer showing postboxes.", "name": "Postboxes", diff --git a/langs/themes/de.json b/langs/themes/de.json index d7e258cc74..afd7a11144 100644 --- a/langs/themes/de.json +++ b/langs/themes/de.json @@ -1474,4 +1474,4 @@ "shortDescription": "Eine Karte mit Abfalleimern", "title": "Abfalleimer" } -} +} \ No newline at end of file diff --git a/langs/themes/es.json b/langs/themes/es.json index ef19ec679a..ae9284db15 100644 --- a/langs/themes/es.json +++ b/langs/themes/es.json @@ -808,6 +808,72 @@ "description": "Los faros son edificios altos con una luz en la parte superior para guiar el tráfico marítimo.", "title": "Faros" }, + "mapcomplete-changes": { + "description": "Este mapa muestra todos los cambios realizados con MapComplete", + "layers": { + "0": { + "description": "Muestra todos los cambios de MapComplete", + "filter": { + "0": { + "options": { + "0": { + "question": "El nombre contiene {search}" + } + } + }, + "1": { + "options": { + "0": { + "question": "El nombre del tema no contiene {search}" + } + } + }, + "10": { + "options": { + "0": { + "question": "Excluir el tema de la etimología" + } + } + }, + "2": { + "options": { + "0": { + "question": "Hecho por el colaborador {search}" + } + } + }, + "3": { + "options": { + "0": { + "question": "No realizado por el colaborador {search}" + } + } + }, + "4": { + "options": { + "0": { + "question": "Realizado antes de {search}" + } + } + }, + "5": { + "options": { + "0": { + "question": "Realizado después de {search}" + } + } + }, + "6": { + "options": { + "0": { + "question": "Idioma del usuario (código iso) {search}" + } + } + } + } + } + } + }, "maproulette": { "description": "Tema que muestra las tareas de MapRoulette, permitiendo buscarlas, filtrarlas y arreglarlas.", "title": "Tareas de MapRoulette" diff --git a/langs/themes/pl.json b/langs/themes/pl.json index e3be5755f4..347bf3fdd9 100644 --- a/langs/themes/pl.json +++ b/langs/themes/pl.json @@ -644,6 +644,22 @@ }, "title": "Krawężniki i przejścia" }, + "mapcomplete-changes": { + "description": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete", + "layers": { + "0": { + "filter": { + "0": { + "options": { + "0": { + "question": "Nazwa tematu zawiera {search}" + } + } + } + } + } + } + }, "maproulette": { "description": "Temat pokazujący zadania MapRoulette, umożliwiający ich wyszukiwanie, filtrowanie i naprawianie.", "title": "Zadania MapRoulette" diff --git a/package-lock.json b/package-lock.json index a42d04cf48..be13f6370c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mapcomplete", - "version": "0.46.8", + "version": "0.46.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mapcomplete", - "version": "0.46.8", + "version": "0.46.9", "license": "GPL-3.0-or-later", "dependencies": { "@comunica/core": "^3.0.1", diff --git a/package.json b/package.json index c8ca8d9c93..0bdfe22db0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mapcomplete", - "version": "0.46.8", + "version": "0.46.9", "repository": "https://github.com/pietervdvn/MapComplete", "description": "A small website to edit OSM easily", "bugs": "https://github.com/pietervdvn/MapComplete/issues", @@ -121,7 +121,7 @@ "reuse-compliance": "reuse lint", "housekeeping": "git pull && npx update-browserslist-db@latest && npm run weblate:merge-heavy && npm run generate && npm run generate:docs && npm run generate:schemas && npm run generate:contributor-list && vite-node scripts/fetchLanguages.ts && vite-node scripts/generateSunnyUnlabeled.ts && npm run format && git add assets/ langs/ Docs/ **/*.ts Docs/* src/* && git commit -m 'chore: automated housekeeping...'", "###": "MICROSERVICES AND SERVER MAINTAINENCE", - "release": "standard-version", + "release": "standard-version && git push --follow-tags", "release:minor": "standard-version --release-as minor", "release:patch": "standard-version --release-as patch", "release:major": "standard-version --release-as major", diff --git a/scripts/ScriptUtils.ts b/scripts/ScriptUtils.ts index d006e8740f..7eb369a3a0 100644 --- a/scripts/ScriptUtils.ts +++ b/scripts/ScriptUtils.ts @@ -94,14 +94,28 @@ export default class ScriptUtils { }) } - public static getThemePaths(): string[] { - return ScriptUtils.readDirRecSync("./assets/themes") + public static getThemePaths(useTranslationPaths = false): string[] { + const normalFiles = ScriptUtils.readDirRecSync("./assets/themes") .filter((path) => path.endsWith(".json") && !path.endsWith(".proto.json")) .filter((path) => path.indexOf("license_info.json") < 0) + + if (!useTranslationPaths) { + return normalFiles + } + const specialfiles = ["./assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json"] + const blacklist = ["assets/themes/mapcomplete-changes/mapcomplete-changes.json"] + + const filtered = normalFiles.filter(path => !blacklist.some(black => path.endsWith(black))) + return filtered.concat(specialfiles) + } - public static getThemeFiles(): { parsed: LayoutConfigJson; path: string; raw: string }[] { - return this.getThemePaths().map((path) => { + public static getThemeFiles(useTranslationPaths = false): { + parsed: LayoutConfigJson; + path: string; + raw: string + }[] { + return this.getThemePaths(useTranslationPaths).map((path) => { try { const contents = readFileSync(path, { encoding: "utf8" }) if (contents === "") { @@ -148,6 +162,7 @@ export default class ScriptUtils { const data = await ScriptUtils.Download(url, headers) return JSON.parse(data["content"]) } + public static async DownloadFetch( url: string, headers?: any @@ -158,6 +173,7 @@ export default class ScriptUtils { console.log("Fetched", url, data) return { content: data } } + public static Download( url: string, headers?: any @@ -193,17 +209,17 @@ export default class ScriptUtils { path: urlObj.pathname + urlObj.search, port: urlObj.port, - headers: headers, + headers: headers }, (res) => { const parts: string[] = [] res.setEncoding("utf8") - res.on("data", function (chunk) { + res.on("data", function(chunk) { // @ts-ignore parts.push(chunk) }) - res.addListener("end", function () { + res.addListener("end", function() { if (res.statusCode === 301 || res.statusCode === 302) { console.log("Got a redirect:", res.headers.location) resolve({ redirect: res.headers.location }) @@ -221,7 +237,7 @@ export default class ScriptUtils { }) } ) - request.on("error", function (e) { + request.on("error", function(e) { reject(e) }) } catch (e) { diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index 30cd921164..81fade8070 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -426,7 +426,8 @@ class LayerOverviewUtils extends Script { priviliged.delete("summary") priviliged.delete("last_click") - if (priviliged.size > 0) { + const isBoostrapping = AllSharedLayers.getSharedLayersConfigs().size == 0 + if (!isBoostrapping && priviliged.size > 0) { throw ( "Priviliged layer " + Array.from(priviliged).join(", ") + diff --git a/scripts/generateTranslations.ts b/scripts/generateTranslations.ts index 8521188c93..0bde6e9eea 100644 --- a/scripts/generateTranslations.ts +++ b/scripts/generateTranslations.ts @@ -670,7 +670,7 @@ function removeNonEnglishTranslations(object: any) { * Load the translations into the theme files */ function mergeThemeTranslations(englishOnly: boolean = false) { - const themeFiles = ScriptUtils.getThemeFiles() + const themeFiles = ScriptUtils.getThemeFiles(true) for (const themeFile of themeFiles) { let config = themeFile.parsed mergeLayerTranslation(config, themeFile.path, loadTranslationFilesFrom("themes")) @@ -723,7 +723,7 @@ class GenerateTranslations extends Script { { const l1 = generateTranslationsObjectFrom(ScriptUtils.getLayerFiles(), "layers") const l2 = generateTranslationsObjectFrom( - ScriptUtils.getThemeFiles().filter( + ScriptUtils.getThemeFiles(true).filter( (th) => th.parsed.mustHaveLanguage === undefined ), "themes" diff --git a/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte b/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte index a95f1d3832..9d845dafe2 100644 --- a/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte +++ b/src/UI/InputElement/Helpers/OpeningHours/OHTable.svelte @@ -220,8 +220,8 @@ {/if} {#each range(7) as wd} - startSelection(wd, h)} on:end={() => endSelection(wd, h)} - on:move={() => moved(wd, h)} on:clear={() => clearSelection()} /> + startSelection(wd, h + 0.5)} on:end={() => endSelection(wd, h + 0.5)} + on:move={() => moved(wd, h + 0.5)} on:clear={() => clearSelection()} /> {/each} diff --git a/src/UI/Studio/CollapsedTagRenderingPreview.svelte b/src/UI/Studio/CollapsedTagRenderingPreview.svelte index 9c21d82aeb..2552f66997 100644 --- a/src/UI/Studio/CollapsedTagRenderingPreview.svelte +++ b/src/UI/Studio/CollapsedTagRenderingPreview.svelte @@ -30,7 +30,7 @@ .getSchemaStartingWith(schema.path) .filter((part) => part.path.length - 1 === schema.path.length) - let usesOverride = value["builtin"] !== undefined + let usesOverride = value?.["builtin"] !== undefined function schemaForMultitype() { const sch = { ...schema } @@ -138,7 +138,7 @@ {:else if typeof value === "string"} Builtin: {value} - {:else if value["builtin"]} + {:else if value?.["builtin"]} reused tagrendering {JSON.stringify(value["builtin"])} {:else} diff --git a/src/UI/Studio/EditLayerState.ts b/src/UI/Studio/EditLayerState.ts index 3fb627a4e7..871b75f173 100644 --- a/src/UI/Studio/EditLayerState.ts +++ b/src/UI/Studio/EditLayerState.ts @@ -159,6 +159,9 @@ export abstract class EditJsonState { } public getSchemaStartingWith(path: string[]) { + if(path === undefined){ + return undefined + } return this.schema.filter( (sch) => !path.some((part, i) => !(sch.path.length > path.length && sch.path[i] === part)) diff --git a/src/UI/Studio/SchemaBasedArray.svelte b/src/UI/Studio/SchemaBasedArray.svelte index 21bd1259f6..ca874a262b 100644 --- a/src/UI/Studio/SchemaBasedArray.svelte +++ b/src/UI/Studio/SchemaBasedArray.svelte @@ -5,18 +5,23 @@ import { TrashIcon } from "@babeard/svelte-heroicons/mini" import ShowConversionMessage from "./ShowConversionMessage.svelte" import Markdown from "../Base/Markdown.svelte" - import type { QuestionableTagRenderingConfigJson } from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" + import type { + QuestionableTagRenderingConfigJson + } from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" import CollapsedTagRenderingPreview from "./CollapsedTagRenderingPreview.svelte" import { Accordion } from "flowbite-svelte" + import { Utils } from "../../Utils" export let state: EditJsonState export let path: (string | number)[] = [] let schema: ConfigMeta = state.getSchema(path)[0] + console.log("SBA got schema", schema, "for path", path) - let title = schema.path.at(-1) + + let title = schema?.path?.at(-1) let singular = title if (title?.endsWith("s")) { - singular = title.slice(0, title.length - 1) + singular = title?.slice(0, title.length - 1) } let article = "a" if (singular?.match(/^[aeoui]/)) { @@ -25,18 +30,20 @@ const isTagRenderingBlock = path.length === 1 && path[0] === "tagRenderings" - if (isTagRenderingBlock) { + if (isTagRenderingBlock && schema !== undefined) { schema = { ...schema } schema.description = undefined } const subparts: ConfigMeta[] = state - .getSchemaStartingWith(schema.path) - .filter((part) => part.path.length - 1 === schema.path.length) + .getSchemaStartingWith(schema?.path) + ?.filter((part) => part.path.length - 1 === schema?.path?.length) let messages = state.messagesFor(path) let datapath = path const currentValue = state.getStoreFor<(string | QuestionableTagRenderingConfigJson)[]>(datapath) + currentValue.set(Utils.DedupT(currentValue.data)) + console.log("Current value is", currentValue.data) if (currentValue.data === undefined) { currentValue.setData([]) } @@ -62,68 +69,69 @@ currentValue.ping() } +{#if schema !== undefined} +
+

{schema.path.at(-1)}

-
-

{schema.path.at(-1)}

- - {#if subparts.length > 0} - - {/if} - {#if $currentValue === undefined} - No array defined - {:else if !Array.isArray($currentValue)} - Not an array: {typeof $currentValue} - {JSON.stringify(path)} - {JSON.stringify($currentValue).slice(0, 120)} - {:else if $currentValue?.length === 0} - No values are defined - {#if $messages.length > 0} - {#each $messages as message} - - {/each} + {#if subparts.length > 0} + {/if} - {:else if subparts.length === 0} - - {#each $currentValue as value, i} -
- - -
- {/each} - {:else} - - {#each $currentValue as value, i (value)} - + > + + +
{/each} - - {/if} -
- - {#if path.length === 1 && path[0] === "tagRenderings"} - + {#if path.length === 1 && path[0] === "tagRenderings"} + - {/if} - + > + Add a builtin tagRendering + + {/if} + +
- +{/if} diff --git a/src/Utils.ts b/src/Utils.ts index 8203014a75..2a23d76fda 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -401,6 +401,19 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be return newArr } + public static DedupT(arr: T[]): T[]{ + if(!arr){ + return arr + } + const items = [] + for (const item of arr) { + if(items.indexOf(item) < 0){ + items.push(item) + } + } + return items + } + /** * Finds all duplicates in a list of strings *