Merge branch 'develop' into Robin-patch-2

This commit is contained in:
Robin van der Linde 2025-03-30 20:12:30 +02:00
commit c919695745
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D
9 changed files with 90 additions and 20 deletions

View file

@ -1,4 +1,5 @@
on:
workflow_dispatch:
push:
branches-ignore:
- build/*
@ -52,27 +53,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 && rm -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" \

12
package-lock.json generated
View file

@ -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",

View file

@ -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",

View file

@ -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

View file

@ -1,10 +1,12 @@
<script lang="ts">
import { Store, UIEventSource } from "../../Logic/UIEventSource"
import SimpleMetaTaggers from "../../Logic/SimpleMetaTagger"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import Searchbar from "../Base/Searchbar.svelte"
import Translations from "../i18n/Translations"
import { Utils } from "../../Utils"
import { Store, UIEventSource } from "../../../Logic/UIEventSource"
import SimpleMetaTaggers from "../../../Logic/SimpleMetaTagger"
import LayerConfig from "../../../Models/ThemeConfig/LayerConfig"
import Searchbar from "../../Base/Searchbar.svelte"
import Translations from "../../i18n/Translations"
import { Utils } from "../../../Utils"
import TagLink from "./TagLink.svelte"
import Tag from "@rgossiaux/svelte-heroicons/solid/Tag"
export let tags: UIEventSource<Record<string, any>>
export let tagKeys = tags.map((tgs) => (tgs === undefined ? [] : Object.keys(tgs)))
@ -69,7 +71,7 @@
{:else if typeof $tags[key] === "object"}
<div class="literal-code">{JSON.stringify($tags[key])}</div>
{:else}
{$tags[key]}
<TagLink {tags} {key} />
{/if}
</td>
</tr>
@ -95,7 +97,7 @@
<span class="literal-code">{JSON.stringify($tags[key])}</span>
<i>{typeof $tags[key]}</i>
{:else}
{$tags[key]}
<TagLink {tags} {key} />
{/if}
</td>
</tr>
@ -123,7 +125,7 @@
{:else if $tags[key] === ""}
<i>Empty string</i>
{:else}
{$tags[key]}
<TagLink {tags} {key} />
{/if}
</td>
</tr>

View file

@ -0,0 +1,46 @@
<script lang="ts">
import { UIEventSource } from "../../../Logic/UIEventSource"
import tag2link from "tag2link/index.json"
export let tags: UIEventSource<Record<string, any>>
export let key: string
const tag2linkData = tag2link as Tag2LinkElement[]
interface Tag2LinkElement {
/**
* OSM tag key
*/
key: string
/**
* URL template or formatter URL: replace `$1` with the tag value
*/
url: string
/**
* Source of this formatter URL
*/
source?: string
/**
* Rank or relative importance of this formatter URL.
*/
rank?: "preferred" | "normal" | "deprecated"
}
const url = tag2linkData.find((item) => item.key === `Key:${key}`)?.url
</script>
{#if url}
<a
href={url.replace("$1", $tags[key])}
target="_blank"
rel="noopener noreferrer"
class="tag-link"
>
{$tags[key]}
</a>
{:else}
{$tags[key]}
{/if}

View file

@ -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"

View file

@ -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"

View file

@ -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"