UI: add sync history settings to privacy policy, fix https://github.com/pietervdvn/MapComplete/issues/2289

This commit is contained in:
Pieter Vander Vennet 2025-02-28 13:37:58 +01:00
parent 5f5960e909
commit 3319c516c9
2 changed files with 48 additions and 0 deletions
langs
src/UI/BigComponents

View file

@ -723,6 +723,10 @@
"typeTitle": "This is <b>{title}</b>"
},
"privacy": {
"browsingHistoryIntro": "MapComplete will save which themes and locations you've previously visited in order to help you quickly go back to those. If you are not logged in, this will be kept on your device. If you are logged in, this can be synced to OpenStreetMap so you can your history on other devices too.",
"browsingHistoryLoggedIn": "Your current settings are:",
"browsingHistoryNotLoggedIn": "Login to change your settings",
"browsingHistoryTitle": "Browsing history",
"editingIntro": "When you make a change to the map, this change is recorded on OpenStreetMap and is publicly available to anyone. A changeset made with MapComplete includes the following data:",
"editingOutro": "Please refer to <a href='https://wiki.osmfoundation.org/wiki/Privacy_Policy' target='_blank'>the privacy policy on OpenStreetMap.org</a> for detailed information. We'd like to remind you that you can use a fictional name when signing up.",
"editingTitle": "When making changes",

View file

@ -9,6 +9,10 @@
export let state: SpecialVisualizationState
const usersettings = UserRelatedState.usersettingsConfig
const editPrivacy = usersettings.tagRenderings.find((tr) => tr.id === "more_privacy")
const editThemeHistory = usersettings.tagRenderings.find((tr) => tr.id === "sync-visited-themes")
const editLocationHistory = usersettings.tagRenderings.find((tr) => tr.id === "sync-visited-locations")
const isLoggedIn = state.osmConnection.isLoggedIn
</script>
@ -65,6 +69,46 @@
<Tr t={t.editingOutro} />
<h3>
<Tr t={t.browsingHistoryTitle} />
</h3>
<Tr t={t.browsingHistoryIntro} />
{#if $isLoggedIn}
<Tr t={t.browsingHistoryLoggedIn} />
<ul>
<li>
<TagRenderingEditable
config={editLocationHistory}
selectedElement={{
type: "Feature",
properties: { id: "settings" },
geometry: { type: "Point", coordinates: [0, 0] },
}}
{state}
tags={state.userRelatedState.preferencesAsTags}
/>
</li>
<li>
<TagRenderingEditable
config={editThemeHistory}
selectedElement={{
type: "Feature",
properties: { id: "settings" },
geometry: { type: "Point", coordinates: [0, 0] },
}}
{state}
tags={state.userRelatedState.preferencesAsTags}
/>
</li>
</ul>
{:else }
<button class="as-link" on:click={() => state.osmConnection.AttemptLogin()}>
<Tr t={t.browsingHistoryNotLoggedIn} />
</button>
{/if}
<h3>
<Tr t={t.miscCookiesTitle} />
</h3>