From 2c877dd52532b24066907a5ae9676e26371e48f0 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 11 Dec 2024 17:21:00 +0100 Subject: [PATCH 01/26] Fix: server config (CORS) --- Docs/ServerConfig/hetzner/Caddyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/ServerConfig/hetzner/Caddyfile b/Docs/ServerConfig/hetzner/Caddyfile index 8641124fc..d084313c2 100644 --- a/Docs/ServerConfig/hetzner/Caddyfile +++ b/Docs/ServerConfig/hetzner/Caddyfile @@ -19,7 +19,7 @@ countrycoder.mapcomplete.org { file_server header { +Permissions-Policy "interest-cohort=()" - +Access-Control-Allow-Origin https://hosted.mapcomplete.org https://dev.mapcomplete.org https://mapcomplete.org + +Access-Control-Allow-Origin * } } From bb8e6b7313270365748b763390e479519ba927a4 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 12 Dec 2024 17:27:25 +0100 Subject: [PATCH 02/26] Actions: add single build deploy --- .github/workflows/deploy_single_theme.yml | 57 +++++++++++++++++++++++ scripts/single_build.sh | 51 +++++--------------- 2 files changed, 68 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/deploy_single_theme.yml diff --git a/.github/workflows/deploy_single_theme.yml b/.github/workflows/deploy_single_theme.yml new file mode 100644 index 000000000..18c807ae5 --- /dev/null +++ b/.github/workflows/deploy_single_theme.yml @@ -0,0 +1,57 @@ +name: Deploy develop on dev.mapcomplete.org +on: + push: + branches: + - build/* + +jobs: + deploy_on_hosted: + runs-on: [ hetzner-access ] + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + cache: "npm" + cache-dependency-path: package-lock.json + + - name: install deps + run: npm ci + shell: bash + + - name: create generated dir + run: mkdir ./assets/generated + shell: bash + + - name: create dependencies + run: npm run generate:licenses; npm run generate:images; npm run generate:charging-stations; npm run generate:service-worker; npm run download:editor-layer-index + shell: bash + + - name: sync translations + run: npm run generate:translations + shell: bash + + - name: Prepare build + run: | + BRANCH=${{ github.ref_name }} + THEME=${BRANCH:6} + npm run generate:service-worker && ./scripts/single_build.sh $THEME + shell: bash + + - name: Zipping dist file + run: | + BRANCH=${{ github.ref_name }} + THEME=${BRANCH:6} + mv "dist_$THEME" ${{ github.ref_name }} + zip ${{ github.ref_name }}.zip -r ${{ github.ref_name }}/* + + - name: uploading file + run: scp ${{ github.ref_name }}.zip hetzner:/root/staging/ + + - name: unzipping remote file + run: ssh hetzner "cd /root/staging && unzip ${{ github.ref_name }}.zip && rm -rf /root/single_theme_builds/${{ github.ref_name }} && mv /root/staging/${{ github.ref_name }}/ /root/single_theme_builds/ && rm ${{ github.ref_name }}.zip" + + + diff --git a/scripts/single_build.sh b/scripts/single_build.sh index 49677134b..216d95407 100755 --- a/scripts/single_build.sh +++ b/scripts/single_build.sh @@ -1,16 +1,20 @@ +#! /bin/bash + +# Creates the build for just a single theme +export NODE_OPTIONS="--max-old-space-size=12000" THEME=$1 -npm run generate:layouts if [ $# -eq 0 ] then echo "No arguments given. Expected a themename" fi pwd +npm run generate:layouts if [ -f "$THEME.html" ] then echo "$THEME.html found." else - echo "Theme '$THEME' not found. Did you run 'npm run generate:layouts'?" + echo "Theme '$THEME' not found. Did you run 'npm run generate:layouts'? Is the theme name correct?" exit 1 fi @@ -33,14 +37,10 @@ sed -i "s/input,/input: {index:\".\/index.html\", land: \".\/land.html\"}/" vite sed -i "s/\/\/ LAYOUT.ADD_CONFIG/layout.enableMoreQuests = false/" index_"$THEME".ts - - export NODE_OPTIONS=--max-old-space-size=20000 vite build --sourcemap --config vite_single.config.js || { echo 'Vite build failed' ; exit 1; } - - cp -r assets/layers/ dist/assets/layers/ cp -r assets/themes/ dist/assets/themes/ cp -r assets/svg/ dist/assets/svg/ @@ -92,37 +92,8 @@ fi npm run clean echo "BUILD COMPLETED" - -if [ $# -eq 2 ] -then - echo "DEPLOY TO $2" - - if [ -f "$2"/CNAME ] - then - CNAME=$(cat "$2"/CNAME) - echo "Found a CNAME" - fi - echo "Assuming github pages, add \".nojekyll\"" - touch $2/.nojekyll - echo $CNAME > $2/CNAME - rm -r "$2/assets/*" - echo " ! Don't forget to add `https://$CNAME/land.html` to the Redirect URIs on https://www.openstreetmap.org/oauth2/applications/" - cp -r "dist_$THEME/"* "$2"/ - - if [ -d "$2"/.git ] - then - cd $2 - git add * - git commit -m "Add new version of MapComplete with single-page build of $THEME" - git push - cd - - fi - rm -r "dist_$THEME" -else - echo "BUILD COMPLETED" - echo "On what domain will you deploy?" - echo " ! Don't forget to add `https://yourdomain.tld/land.html` to the Redirect URIs on https://www.openstreetmap.org/oauth2/applications/" - echo "Deploying on github pages?" - echo " 1. Don't forget to add a CNAME file (containing your domain name verbatim, without protocol)" - echo " 2 .nojekyll file (which is empty)" -fi +echo "On what domain will you deploy?" +echo " ! Don't forget to add `https://yourdomain.tld/land.html` to the Redirect URIs on https://www.openstreetmap.org/oauth2/applications/" +echo "Deploying on github pages?" +echo " 1. Don't forget to add a CNAME file (containing your domain name verbatim, without protocol)" +echo " 2 .nojekyll file (which is empty)" From 0fc92d8f6df4ce9c832af9ff885c6bbd0281ec65 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 12 Dec 2024 17:29:09 +0100 Subject: [PATCH 03/26] Config: hetzner --- Docs/ServerConfig/hetzner/Caddyfile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Docs/ServerConfig/hetzner/Caddyfile b/Docs/ServerConfig/hetzner/Caddyfile index d084313c2..71f0fd162 100644 --- a/Docs/ServerConfig/hetzner/Caddyfile +++ b/Docs/ServerConfig/hetzner/Caddyfile @@ -1,4 +1,4 @@ -hosted.mapcomplete.org { +builds.mapcomplete.org { root * public/ file_server header { @@ -14,6 +14,23 @@ dev.mapcomplete.org { } } +single.mapcomplete.org { + root * single_theme_builds/ + file_server + header { + +Permissions-Policy "interest-cohort=()" + } +} + + +velopark.mapcomplete.org { + root * single_theme_builds/velopark/ + file_server + header { + +Permissions-Policy "interest-cohort=()" + } +} + countrycoder.mapcomplete.org { root * tiles/ file_server From 5e4affe1b8412af7103201423a230d7a72c08303 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 12 Dec 2024 17:32:28 +0100 Subject: [PATCH 04/26] Actions: attempt to get actions running --- .github/workflows/deploy_single_theme.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_single_theme.yml b/.github/workflows/deploy_single_theme.yml index 18c807ae5..311a4335e 100644 --- a/.github/workflows/deploy_single_theme.yml +++ b/.github/workflows/deploy_single_theme.yml @@ -1,12 +1,12 @@ -name: Deploy develop on dev.mapcomplete.org +name: Deploy develop on theme.mapcomplete.org on: push: branches: - - build/* + - build/.* jobs: - deploy_on_hosted: - runs-on: [ hetzner-access ] + deploy_on_hetzner_single: + runs-on: [ ubuntu-latest, hetzner-access ] steps: - uses: actions/checkout@v3 From 5aa997e0830502a23271eac857c28a1e4af76672 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 12 Dec 2024 17:52:44 +0100 Subject: [PATCH 05/26] Chore: move workflow to correct file structure --- {.github => .forgejo}/workflows/deploy_hosted.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.github => .forgejo}/workflows/deploy_hosted.yml (100%) diff --git a/.github/workflows/deploy_hosted.yml b/.forgejo/workflows/deploy_hosted.yml similarity index 100% rename from .github/workflows/deploy_hosted.yml rename to .forgejo/workflows/deploy_hosted.yml From f029b8eea25650d9172a07ccfb1e549a7737269c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 12 Dec 2024 17:53:17 +0100 Subject: [PATCH 06/26] Actions: attempt to get action working --- {.github => .forgejo}/workflows/deploy_single_theme.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {.github => .forgejo}/workflows/deploy_single_theme.yml (99%) diff --git a/.github/workflows/deploy_single_theme.yml b/.forgejo/workflows/deploy_single_theme.yml similarity index 99% rename from .github/workflows/deploy_single_theme.yml rename to .forgejo/workflows/deploy_single_theme.yml index 311a4335e..2d7d662fb 100644 --- a/.github/workflows/deploy_single_theme.yml +++ b/.forgejo/workflows/deploy_single_theme.yml @@ -2,7 +2,7 @@ name: Deploy develop on theme.mapcomplete.org on: push: branches: - - build/.* + - build/* jobs: deploy_on_hetzner_single: From f39e884bf3a3683530fa1f3b4462eceadb375bd4 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 12 Dec 2024 17:53:58 +0100 Subject: [PATCH 07/26] Actions: attempt to get action working --- .forgejo/workflows/deploy_single_theme.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/deploy_single_theme.yml b/.forgejo/workflows/deploy_single_theme.yml index 2d7d662fb..da5e4d17d 100644 --- a/.forgejo/workflows/deploy_single_theme.yml +++ b/.forgejo/workflows/deploy_single_theme.yml @@ -2,7 +2,7 @@ name: Deploy develop on theme.mapcomplete.org on: push: branches: - - build/* + - build/velopark jobs: deploy_on_hetzner_single: From 87198ca3235f639d896df90e31de4f3cf307010e Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 12 Dec 2024 17:54:28 +0100 Subject: [PATCH 08/26] Actions: attempt to get action working --- .forgejo/workflows/deploy_single_theme.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/deploy_single_theme.yml b/.forgejo/workflows/deploy_single_theme.yml index da5e4d17d..2d7d662fb 100644 --- a/.forgejo/workflows/deploy_single_theme.yml +++ b/.forgejo/workflows/deploy_single_theme.yml @@ -2,7 +2,7 @@ name: Deploy develop on theme.mapcomplete.org on: push: branches: - - build/velopark + - build/* jobs: deploy_on_hetzner_single: From de782d73561c6ba17b0368b541f33f985fa760da Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 13 Dec 2024 14:13:28 +0100 Subject: [PATCH 09/26] Chore: use strict on two classes --- src/Logic/Actors/GeoLocationHandler.ts | 26 ++++++++-------- .../Sources/StaticFeatureSource.ts | 30 +++++++++++++++++-- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/Logic/Actors/GeoLocationHandler.ts b/src/Logic/Actors/GeoLocationHandler.ts index 1909daa52..c97a75c8e 100644 --- a/src/Logic/Actors/GeoLocationHandler.ts +++ b/src/Logic/Actors/GeoLocationHandler.ts @@ -8,10 +8,11 @@ import { FeatureSource, WritableFeatureSource } from "../FeatureSource/FeatureSo import { LocalStorageSource } from "../Web/LocalStorageSource" import { GeoOperations } from "../GeoOperations" import { OsmTags } from "../../Models/OsmFeature" -import StaticFeatureSource from "../FeatureSource/Sources/StaticFeatureSource" +import StaticFeatureSource, { WritableStaticFeatureSource } from "../FeatureSource/Sources/StaticFeatureSource" import { MapProperties } from "../../Models/MapProperties" import { Orientation } from "../../Sensors/Orientation" +"use strict" /** * The geolocation-handler takes a map-location and a geolocation state. * It'll move the map as appropriate given the state of the geolocation-API @@ -43,13 +44,13 @@ export default class GeoLocationHandler { public readonly mapHasMoved: UIEventSource = new UIEventSource< Date | undefined >(undefined) - private readonly selectedElement: UIEventSource + private readonly selectedElement: UIEventSource private readonly mapProperties?: MapProperties private readonly gpsLocationHistoryRetentionTime?: UIEventSource constructor( geolocationState: GeoLocationState, - selectedElement: UIEventSource, + selectedElement: UIEventSource, mapProperties?: MapProperties, gpsLocationHistoryRetentionTime?: UIEventSource ) { @@ -59,13 +60,12 @@ export default class GeoLocationHandler { this.mapProperties = mapProperties this.gpsLocationHistoryRetentionTime = gpsLocationHistoryRetentionTime // Did an interaction move the map? - let self = this - let initTime = new Date() - mapLocation.addCallbackD((_) => { + const initTime = new Date() + mapLocation.addCallbackD(() => { if (new Date().getTime() - initTime.getTime() < 250) { return } - self.mapHasMoved.setData(new Date()) + this.mapHasMoved.setData(new Date()) return true // Unsubscribe }) @@ -76,12 +76,12 @@ export default class GeoLocationHandler { this.mapHasMoved.setData(new Date()) } - this.geolocationState.currentGPSLocation.addCallbackAndRunD((_) => { + this.geolocationState.currentGPSLocation.addCallbackAndRunD(() => { const timeSinceLastRequest = (new Date().getTime() - geolocationState.requestMoment.data?.getTime() ?? 0) / 1000 if (!this.mapHasMoved.data) { // The map hasn't moved yet; we received our first coordinates, so let's move there! - self.MoveMapToCurrentLocation() + this.MoveMapToCurrentLocation() } if ( timeSinceLastRequest < Constants.zoomToLocationTimeout && @@ -90,12 +90,12 @@ export default class GeoLocationHandler { geolocationState.requestMoment.data?.getTime()) ) { // still within request time and the map hasn't moved since requesting to jump to the current location - self.MoveMapToCurrentLocation() + this.MoveMapToCurrentLocation() } if (!this.geolocationState.allowMoving.data) { // Jup, the map is locked to the bound location: move automatically - self.MoveMapToCurrentLocation(0) + this.MoveMapToCurrentLocation(0) return } }) @@ -183,7 +183,7 @@ export default class GeoLocationHandler { } private initUserLocationTrail() { - const features = LocalStorageSource.getParsed("gps_location_history", []) + const features = LocalStorageSource.getParsed[]>("gps_location_history", []) const now = new Date().getTime() features.data = features.data.filter((ff) => { if (ff.properties === undefined) { @@ -230,7 +230,7 @@ export default class GeoLocationHandler { features.ping() }) - this.historicalUserLocations = new StaticFeatureSource(features) + this.historicalUserLocations = new WritableStaticFeatureSource>(features) const asLine = features.map((allPoints) => { if (allPoints === undefined || allPoints.length < 2) { diff --git a/src/Logic/FeatureSource/Sources/StaticFeatureSource.ts b/src/Logic/FeatureSource/Sources/StaticFeatureSource.ts index df1fe8f49..dcfeada40 100644 --- a/src/Logic/FeatureSource/Sources/StaticFeatureSource.ts +++ b/src/Logic/FeatureSource/Sources/StaticFeatureSource.ts @@ -1,7 +1,8 @@ -import { FeatureSource } from "../FeatureSource" -import { ImmutableStore, Store } from "../../UIEventSource" +import { FeatureSource, WritableFeatureSource } from "../FeatureSource" +import { ImmutableStore, Store, UIEventSource } from "../../UIEventSource" import { Feature } from "geojson" +"use strict" /** * A simple, read only feature store. */ @@ -30,3 +31,28 @@ export default class StaticFeatureSource implements return new StaticFeatureSource(geojson) } } + +export class WritableStaticFeatureSource implements WritableFeatureSource { + public readonly features: UIEventSource = undefined + + constructor(features: UIEventSource | T[] | { features: T[] } | { features: Store }) { + if (features === undefined) { + throw "Static feature source received undefined as source" + } + + let feats: T[] | UIEventSource + + if (features["features"]) { + feats = features["features"] + } else { + feats = >features + } + + if (Array.isArray(feats)) { + this.features = new UIEventSource(feats) + } else { + this.features = feats + } + + } +} From cc289325345ffcfea08dca083135789dc1c87394 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 13 Dec 2024 14:41:28 +0100 Subject: [PATCH 10/26] Docs: update docs and status page for pg_tile_server --- Docs/SettingUpPSQL.md | 18 ++++++++++++++++-- src/UI/Status/StatusGUI.svelte | 25 ++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Docs/SettingUpPSQL.md b/Docs/SettingUpPSQL.md index 485c73197..3c9cb19b7 100644 --- a/Docs/SettingUpPSQL.md +++ b/Docs/SettingUpPSQL.md @@ -67,8 +67,10 @@ pg_tileserv can be downloaded here: https://github.com/CrunchyData/pg_tileserv In the directory where it is downloaded (e.g. `~/data`), run +First, look up the latest suitable database on https://mapcomplete.org/status + ```` -export DATABASE_URL=postgresql://user:password@localhost:5444/osm-poi +export DATABASE_URL=postgresql://user:password@localhost:5444/osm-poi.{date-of-suitable-database} nohup ./pg_tileserv >> pg_tileserv.log & ```` @@ -84,7 +86,19 @@ map.addSource("drinking_water", { `npm run summary-server` in the git repo +# Connecting to the database + +Setup the SSH-tunnel: + +`ssh folky.me +ssh -L 5444:127.0.0.1:5444 lain` + +Open a second terminal: + +`ssh -L 5444:127.0.0.1:5444 folky.me` ` + +Connect pgAdmin + # Rebooting: -> Restart the docker container --> diff --git a/src/UI/Status/StatusGUI.svelte b/src/UI/Status/StatusGUI.svelte index 079b641fe..50c80792f 100644 --- a/src/UI/Status/StatusGUI.svelte +++ b/src/UI/Status/StatusGUI.svelte @@ -1,5 +1,5 @@
From b272c1cda7352a4a78e4f61dbd39fe2f80ae204d Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 04:06:03 +0100 Subject: [PATCH 23/26] Fix: attributed image doesn't open fullscreen if no ID given --- src/UI/Image/AttributedImage.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/Image/AttributedImage.svelte b/src/UI/Image/AttributedImage.svelte index a0f3a0363..e2c677386 100644 --- a/src/UI/Image/AttributedImage.svelte +++ b/src/UI/Image/AttributedImage.svelte @@ -42,7 +42,7 @@ if (previewedImage) { onDestroy( previewedImage.addCallbackAndRun((previewedImage) => { - showBigPreview.set(previewedImage?.id === image.id) + showBigPreview.set(previewedImage !== undefined && previewedImage?.id === image.id) }) ) } From b2915bdc4d2b1b1655568dd36887b25e491d7e79 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 04:12:31 +0100 Subject: [PATCH 24/26] UX: change styling of dotmenu to make it more visible --- public/css/index-tailwind-output.css | 64 ++++++++++++------------ src/UI/Base/DotMenu.svelte | 74 ++++++++++++++-------------- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/public/css/index-tailwind-output.css b/public/css/index-tailwind-output.css index 1ced5b6da..3da0d51cf 100644 --- a/public/css/index-tailwind-output.css +++ b/public/css/index-tailwind-output.css @@ -1324,20 +1324,20 @@ input[type="range"].range-lg::-moz-range-thumb { margin: 0px; } -.m-8 { - margin: 2rem; +.m-1 { + margin: 0.25rem; } .m-2 { margin: 0.5rem; } -.m-0\.5 { - margin: 0.125rem; +.m-8 { + margin: 2rem; } -.m-1 { - margin: 0.25rem; +.m-0\.5 { + margin: 0.125rem; } .m-11 { @@ -1698,14 +1698,14 @@ input[type="range"].range-lg::-moz-range-thumb { height: 6rem; } -.h-screen { - height: 100vh; -} - .h-full { height: 100%; } +.h-screen { + height: 100vh; +} + .h-fit { height: -webkit-fit-content; height: -moz-fit-content; @@ -2028,6 +2028,10 @@ input[type="range"].range-lg::-moz-range-thumb { width: max-content; } +.w-48 { + width: 12rem; +} + .w-auto { width: auto; } @@ -2121,10 +2125,6 @@ input[type="range"].range-lg::-moz-range-thumb { width: 0.25rem; } -.w-48 { - width: 12rem; -} - .w-9\/12 { width: 75%; } @@ -2244,14 +2244,14 @@ input[type="range"].range-lg::-moz-range-thumb { flex: 1 1 0%; } -.flex-shrink { - flex-shrink: 1; -} - .flex-shrink-0 { flex-shrink: 0; } +.flex-shrink { + flex-shrink: 1; +} + .shrink-0 { flex-shrink: 0; } @@ -2509,6 +2509,10 @@ input[type="range"].range-lg::-moz-range-thumb { row-gap: 0.25rem; } +.gap-x-2 { + column-gap: 0.5rem; +} + .gap-y-2 { row-gap: 0.5rem; } @@ -2517,10 +2521,6 @@ input[type="range"].range-lg::-moz-range-thumb { row-gap: 1rem; } -.gap-x-2 { - column-gap: 0.5rem; -} - .gap-x-1 { column-gap: 0.25rem; } @@ -3045,11 +3045,6 @@ input[type="range"].range-lg::-moz-range-thumb { border-color: rgb(107 114 128 / var(--tw-border-opacity)); } -.border-subtle { - --tw-border-opacity: 1; - border-color: rgb(219 234 254 / var(--tw-border-opacity)); -} - .border-black { --tw-border-opacity: 1; border-color: rgb(0 0 0 / var(--tw-border-opacity)); @@ -3065,6 +3060,11 @@ input[type="range"].range-lg::-moz-range-thumb { border-color: rgb(209 213 219 / var(--tw-border-opacity)); } +.border-gray-600 { + --tw-border-opacity: 1; + border-color: rgb(75 85 99 / var(--tw-border-opacity)); +} + .border-gray-800 { --tw-border-opacity: 1; border-color: rgb(31 41 55 / var(--tw-border-opacity)); @@ -4045,18 +4045,14 @@ input[type="range"].range-lg::-moz-range-thumb { padding-bottom: 0.75rem; } -.pl-4 { - padding-left: 1rem; +.pt-2 { + padding-top: 0.5rem; } .pr-4 { padding-right: 1rem; } -.pt-2 { - padding-top: 0.5rem; -} - .pl-1 { padding-left: 0.25rem; } @@ -5067,6 +5063,8 @@ input[type="range"].range-lg::-moz-range-thumb { @font-face { font-family: "Source Sans Pro"; + /*This path might seem incorrect. However, 'index.css' will be compiled and placed in 'public/css', from where this path _is_ correct*/ + src: url("../assets/fonts/source-sans-pro.regular.ttf") format("woff"); } diff --git a/src/UI/Base/DotMenu.svelte b/src/UI/Base/DotMenu.svelte index 74344067c..e14ee59a1 100644 --- a/src/UI/Base/DotMenu.svelte +++ b/src/UI/Base/DotMenu.svelte @@ -45,46 +45,48 @@
From 74618c22826ef6576236835a6308256f2d908bcc Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 04:12:50 +0100 Subject: [PATCH 25/26] UX: fix image carousel in comparisonTable --- src/UI/Comparison/ComparisonTable.svelte | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/UI/Comparison/ComparisonTable.svelte b/src/UI/Comparison/ComparisonTable.svelte index 32757ff62..5174c8eb6 100644 --- a/src/UI/Comparison/ComparisonTable.svelte +++ b/src/UI/Comparison/ComparisonTable.svelte @@ -128,17 +128,18 @@ {#if $unknownImages.length > 0} {#if readonly} -
-
- {#each $unknownImages as image (image)} - - {/each} -
+
+ {#each $unknownImages as image (image)} +
+ +
+ {/each}
{:else} {#each $unknownImages as image (image)} From 926ea0b6e46f9966d1b1b9a4157c6ca6708b82fa Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 04:13:05 +0100 Subject: [PATCH 26/26] Fix: remove 'id' attribute --- src/Logic/Web/LinkedDataLoader.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Logic/Web/LinkedDataLoader.ts b/src/Logic/Web/LinkedDataLoader.ts index 21a8ab650..16b3b0ee3 100644 --- a/src/Logic/Web/LinkedDataLoader.ts +++ b/src/Logic/Web/LinkedDataLoader.ts @@ -421,6 +421,7 @@ export default class LinkedDataLoader { delete output["chargeEnd"] delete output["chargeStart"] delete output["timeUnit"] + delete output["id"] asBoolean("covered") asBoolean("fee", true) @@ -800,14 +801,19 @@ export default class LinkedDataLoader { for (const unpatchedKey in unpatched) { // Dirty hack const rawData = await Utils.downloadJsonCached(url, 1000*60*60) - const images = rawData["photos"].map(ph => ph.image) - unpatched[unpatchedKey].images = new Set(images) + const images = rawData["photos"]?.map(ph => ph.image) + if(images){ + unpatched[unpatchedKey].images = new Set(images) + } } console.log("Got unpatched:", unpatched) const patched: Feature[] = [] - for (const section in unpatched) { + for (let section in unpatched) { const p = LinkedDataLoader.patchVeloparkProperties(unpatched[section]) + if(Object.keys(unpatched).length === 1 && section.endsWith("#section1")){ + section = section.split("#")[0] + } p["ref:velopark"] = [section] patched.push(LinkedDataLoader.asGeojson(p)) }