From 68c8e1e23714e718807b350d91e63932f58516d8 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 29 Mar 2025 16:41:16 +0100 Subject: [PATCH 1/5] Scripts: make deploy script robust against slashes in branch names --- .forgejo/workflows/deploy_hosted.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/deploy_hosted.yml b/.forgejo/workflows/deploy_hosted.yml index f945a6b3f..0c09c50f2 100644 --- a/.forgejo/workflows/deploy_hosted.yml +++ b/.forgejo/workflows/deploy_hosted.yml @@ -52,27 +52,35 @@ jobs: - name: Zipping dist file run: | - mv dist /tmp/${{ github.ref_name }} + BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g') + mv dist /tmp/${{ BRANCH }} cd /tmp - zip ${{ github.ref_name }}.zip -r ${{ github.ref_name }}/* + zip ${{ BRANCH }}.zip -r ${{ BRANCH }}/* cd - - name: uploading file - run: scp /tmp/${{ github.ref_name }}.zip hetzner:/root/staging/ + run: | + BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g') + scp /tmp/${BRANCH}.zip hetzner:/root/staging/ - name: cleanup files - run: rm /tmp/${{ github.ref_name }}.zip && rm -rf /tmp/${{ github.ref_name }}/ + run: | + BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g') + rm /tmp/${BRANCH}.zip && r${GITHUB_REF_NAME}m -rf /tmp/${BRANCH}/ - name: unzipping remote file - run: ssh hetzner "cd /root/staging && rm -rf ${{ github.ref_name }} && unzip ${{ github.ref_name }}.zip && rm -rf /root/public/${{ github.ref_name }} && mv /root/staging/${{ github.ref_name }}/ /root/public/ && rm ${{ github.ref_name }}.zip" + run: | + BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g') + ssh hetzner "cd /root/staging && rm -rf ${BRANCH} && unzip ${BRANCH}.zip && rm -rf /root/public/${BRANCH} && mv /root/staging/${BRANCH}/ /root/public/ && rm ${BRANCH}.zip" - name: Comment on the PR run: | + BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g') PR_NUMBER=$(echo ${{ github.event.pull_request.number || github.event.issue.number }}) if [[ -n "$PR_NUMBER" ]] then echo "Found a pull request or issue number, will post to $PR_NUMBER ..." - MSG=$(echo "Congratulations! This PR been successfully built and has been deployed. It is (temporarily) available on https://builds.mapcomplete.org/${PR_NUMBER}") + MSG=$(echo "Congratulations! This PR been successfully built and has been deployed. It is (temporarily) available on https://builds.mapcomplete.org/${BRANCH}") BODY="{\"body\": \"$MSG\"}" # Token must have following permissions: issue > read and write curl -X POST "https://source.mapcomplete.org/api/v1/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" \ From 413e25ff421e4154c0dce46da754eb6ce3db9acf Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 29 Mar 2025 16:41:53 +0100 Subject: [PATCH 2/5] Scripts: allow to manually run 'deploy_hosted' --- .forgejo/workflows/deploy_hosted.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/deploy_hosted.yml b/.forgejo/workflows/deploy_hosted.yml index 0c09c50f2..dbf219bdf 100644 --- a/.forgejo/workflows/deploy_hosted.yml +++ b/.forgejo/workflows/deploy_hosted.yml @@ -1,4 +1,5 @@ on: + workflow_dispatch: push: branches-ignore: - build/* From 7ba991f0f39fc80becb1bc1aa5782d176ebe016c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 30 Mar 2025 13:10:01 +0200 Subject: [PATCH 3/5] Scripts: fix deploy script --- .forgejo/workflows/deploy_hosted.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/deploy_hosted.yml b/.forgejo/workflows/deploy_hosted.yml index dbf219bdf..80347594c 100644 --- a/.forgejo/workflows/deploy_hosted.yml +++ b/.forgejo/workflows/deploy_hosted.yml @@ -54,9 +54,9 @@ jobs: - name: Zipping dist file run: | BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g') - mv dist /tmp/${{ BRANCH }} + mv dist /tmp/${BRANCH} cd /tmp - zip ${{ BRANCH }}.zip -r ${{ BRANCH }}/* + zip ${BRANCH}.zip -r ${BRANCH}/* cd - - name: uploading file @@ -67,7 +67,7 @@ jobs: - name: cleanup files run: | BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g') - rm /tmp/${BRANCH}.zip && r${GITHUB_REF_NAME}m -rf /tmp/${BRANCH}/ + rm /tmp/${BRANCH}.zip && rm -rf /tmp/${BRANCH}/ - name: unzipping remote file run: | From 68087384253d2216e914f1534ac919f89c4938cd Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Sun, 30 Mar 2025 13:51:35 +0200 Subject: [PATCH 4/5] Feature: Clickable links in AllTagsPanel --- package-lock.json | 12 +++++ package.json | 1 + .../{ => AllTagsPanel}/AllTagsPanel.svelte | 20 ++++---- src/UI/Popup/AllTagsPanel/TagLink.svelte | 46 +++++++++++++++++++ .../SettingsVisualisations.ts | 2 +- src/UI/SpecialVisualizations.ts | 2 +- src/UI/Studio/EditLayer.svelte | 2 +- 7 files changed, 73 insertions(+), 12 deletions(-) rename src/UI/Popup/{ => AllTagsPanel}/AllTagsPanel.svelte (86%) create mode 100644 src/UI/Popup/AllTagsPanel/TagLink.svelte diff --git a/package-lock.json b/package-lock.json index 5a58d8d00..ffaf6cd84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,6 +82,7 @@ "showdown": "^2.1.0", "svelte": "^3.59.2", "svg-path-parser": "^1.1.0", + "tag2link": "^2025.3.21", "tailwind-merge": "^1.14.0", "tailwindcss": "^3.4.17", "ts-node": "^10.9.2", @@ -26392,6 +26393,12 @@ "version": "3.2.4", "license": "MIT" }, + "node_modules/tag2link": { + "version": "2025.3.21", + "resolved": "https://registry.npmjs.org/tag2link/-/tag2link-2025.3.21.tgz", + "integrity": "sha512-JvRTQdY/z0vAEFUzL7rhLndNiDnStlurW+1jgXL5FW+GppR2T/dq2lXMEppbFNxJ9C4h5b+ykjcMPH791YeLdA==", + "license": "ISC" + }, "node_modules/tailwind-merge": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-1.14.0.tgz", @@ -48535,6 +48542,11 @@ "symbol-tree": { "version": "3.2.4" }, + "tag2link": { + "version": "2025.3.21", + "resolved": "https://registry.npmjs.org/tag2link/-/tag2link-2025.3.21.tgz", + "integrity": "sha512-JvRTQdY/z0vAEFUzL7rhLndNiDnStlurW+1jgXL5FW+GppR2T/dq2lXMEppbFNxJ9C4h5b+ykjcMPH791YeLdA==" + }, "tailwind-merge": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-1.14.0.tgz", diff --git a/package.json b/package.json index 6f9397d5d..a88a9112d 100644 --- a/package.json +++ b/package.json @@ -244,6 +244,7 @@ "showdown": "^2.1.0", "svelte": "^3.59.2", "svg-path-parser": "^1.1.0", + "tag2link": "^2025.3.21", "tailwind-merge": "^1.14.0", "tailwindcss": "^3.4.17", "ts-node": "^10.9.2", diff --git a/src/UI/Popup/AllTagsPanel.svelte b/src/UI/Popup/AllTagsPanel/AllTagsPanel.svelte similarity index 86% rename from src/UI/Popup/AllTagsPanel.svelte rename to src/UI/Popup/AllTagsPanel/AllTagsPanel.svelte index 39a66f335..33b710ad0 100644 --- a/src/UI/Popup/AllTagsPanel.svelte +++ b/src/UI/Popup/AllTagsPanel/AllTagsPanel.svelte @@ -1,10 +1,12 @@ + +{#if url} + + {$tags[key]} + +{:else} + {$tags[key]} +{/if} diff --git a/src/UI/SpecialVisualisations/SettingsVisualisations.ts b/src/UI/SpecialVisualisations/SettingsVisualisations.ts index ea52ea627..d22cf6888 100644 --- a/src/UI/SpecialVisualisations/SettingsVisualisations.ts +++ b/src/UI/SpecialVisualisations/SettingsVisualisations.ts @@ -6,7 +6,7 @@ import LogoutButton from "../Base/LogoutButton.svelte" import LoginButton from "../Base/LoginButton.svelte" import ThemeViewState from "../../Models/ThemeViewState" import OrientationDebugPanel from "../Debug/OrientationDebugPanel.svelte" -import AllTagsPanel from "../Popup/AllTagsPanel.svelte" +import AllTagsPanel from "../Popup/AllTagsPanel/AllTagsPanel.svelte" import { ImmutableStore, UIEventSource } from "../../Logic/UIEventSource" import ClearCaches from "../Popup/ClearCaches.svelte" import Locale from "../i18n/Locale" diff --git a/src/UI/SpecialVisualizations.ts b/src/UI/SpecialVisualizations.ts index a212ae011..0fdee9e98 100644 --- a/src/UI/SpecialVisualizations.ts +++ b/src/UI/SpecialVisualizations.ts @@ -10,7 +10,7 @@ import { HistogramViz } from "./Popup/HistogramViz" import { UploadToOsmViz } from "./Popup/UploadToOsmViz" import { MultiApplyViz } from "./Popup/MultiApplyViz" import { UIEventSource } from "../Logic/UIEventSource" -import AllTagsPanel from "./Popup/AllTagsPanel.svelte" +import AllTagsPanel from "./Popup/AllTagsPanel/AllTagsPanel.svelte" import { VariableUiElement } from "./Base/VariableUIElement" import { Translation } from "./i18n/Translation" import Translations from "./i18n/Translations" diff --git a/src/UI/Studio/EditLayer.svelte b/src/UI/Studio/EditLayer.svelte index 79ef7776e..c561edfe1 100644 --- a/src/UI/Studio/EditLayer.svelte +++ b/src/UI/Studio/EditLayer.svelte @@ -13,7 +13,7 @@ import SchemaBasedInput from "./SchemaBasedInput.svelte" import FloatOver from "../Base/FloatOver.svelte" import TagRenderingInput from "./TagRenderingInput.svelte" - import AllTagsPanel from "../Popup/AllTagsPanel.svelte" + import AllTagsPanel from "../Popup/AllTagsPanel/AllTagsPanel.svelte" import QuestionPreview from "./QuestionPreview.svelte" import ShowConversionMessages from "./ShowConversionMessages.svelte" import RawEditor from "./RawEditor.svelte" From 94412c996bb627a9d7af94506dba16e6ac6989af Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 30 Mar 2025 19:40:32 +0200 Subject: [PATCH 5/5] Scripts: attempt to have proper icon propagation in develop --- scripts/prepare-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/prepare-build.sh b/scripts/prepare-build.sh index 0e0fc6c58..d5fdd5431 100755 --- a/scripts/prepare-build.sh +++ b/scripts/prepare-build.sh @@ -20,8 +20,8 @@ npm run download:editor-layer-index && 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:mapcomplete-changes-theme && -npm run refresh:layeroverview && # run refresh:layeroverview a second time to propagate all calls -npm run generate:layeroverview && # run refresh:layeroverview a third time to fix some issues with the favourite layer all calls +npm run refresh:layeroverview && # a second time to propagate all calls +npm run refresh:layeroverview && # a third time to fix some issues with the favourite layer all calls npm run generate:layouts