From f2de8bfad2da75d4b3c2ca653d4137fa982497e1 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 7 Feb 2023 02:58:55 +0100 Subject: [PATCH 1/3] Remove unneeded part of 'clean'-script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a5e4b6ca26..d4143bf046 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh", "format": "npx prettier --write '**/*.ts'", "clean:tests": "(find . -type f -name \"*.doctest.ts\" | xargs rm)", - "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|test\\|preferences\\|customGenerator\\|professional\\|automaton\\|import_helper\\|import_viewer\\|theme\\).html\" | xargs rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs rm) && (ls | grep \".*.webmanifest$\" | grep -v \"manifest.webmanifest\" | xargs rm)", + "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|test\\|preferences\\|customGenerator\\|professional\\|automaton\\|import_helper\\|import_viewer\\|theme\\).html\" | xargs rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs 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", "weblate-add-upstream": "git remote add weblate-github git@github.com:weblate/MapComplete.git", "weblate-merge": "git remote update weblate-github; git merge weblate-github/weblate-mapcomplete-core weblate-github/weblate-mapcomplete-layers weblate-github/weblate-mapcomplete-layer-translations", From ca2c446b2c0621b6babd376413bac8b3c79f4744 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 12 Feb 2023 18:32:10 +0100 Subject: [PATCH 2/3] Fix image path of webmanifests --- scripts/generateLayouts.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/generateLayouts.ts b/scripts/generateLayouts.ts index 3d4bf282e1..a456078d33 100644 --- a/scripts/generateLayouts.ts +++ b/scripts/generateLayouts.ts @@ -23,8 +23,8 @@ async function createIcon(iconPath: string, size: number, alreadyWritten: string name = name.substr(2) } - const newname = `public/assets/generated/images/${name.replace(/\//g, "_")}${size}.png` - + const newname = `assets/generated/images/${name.replace(/\//g, "_")}${size}.png` + const targetpath = `public/${newname}` if (alreadyWritten.indexOf(newname) >= 0) { return newname } @@ -41,7 +41,7 @@ async function createIcon(iconPath: string, size: number, alreadyWritten: string // We already read to file, in order to crash here if the file is not found let img = await sharp(iconPath) let resized = await img.resize(size) - await resized.toFile(newname) + await resized.toFile(targetpath) console.log("Created png version at ", newname) } catch (e) { console.error("Could not read icon", iconPath, " to create a PNG due to", e) @@ -273,7 +273,7 @@ async function createLandingPage(layout: LayoutConfig, manifest, whiteIcons, alr '', `` ) - 0 + try { output = output .replace( From 9e487c9b060afa7e0914454ee719d33035753cc8 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 12 Feb 2023 18:51:21 +0100 Subject: [PATCH 3/3] Include 'clinics' in hospital theme; add question to distinguish them, fix #1311 --- assets/layers/hospital/hospital.json | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/assets/layers/hospital/hospital.json b/assets/layers/hospital/hospital.json index 144490447b..d488fccfd0 100644 --- a/assets/layers/hospital/hospital.json +++ b/assets/layers/hospital/hospital.json @@ -22,7 +22,7 @@ }, "minzoom": 12, "source": { - "osmTags": "amenity=hospital" + "osmTags": {"or": ["amenity=hospital","amenity=clinic"]} }, "tagRenderings": [ { @@ -43,6 +43,26 @@ "key": "name" } }, + { + "id": "inpatient", + "question": { + "en": "Does this facility admit inpatients?
An inpatient is a patient which stays for multiple days in the facility" + }, + "mappings": [ + { + "if": "amenity=clinic", + "then": { + "en": "This is a clinic - patients can not stay overnight" + } + }, + { + "if": "amenity=hospital", + "then": { + "en": "This is a hospital - patients can be admitted here for multiple days" + } + } + ] + }, "phone", "email", "website" @@ -63,4 +83,4 @@ "width": 1 } ] -} \ No newline at end of file +}