diff --git a/assets/layers/icons/icons.json b/assets/layers/icons/icons.json index 54ebd45d5..93e9e91ec 100644 --- a/assets/layers/icons/icons.json +++ b/assets/layers/icons/icons.json @@ -430,10 +430,10 @@ } }, { - "id": "favourite_icon", + "condition": "_favourite=yes", "description": "Only for rendering", "icon": "circle:white;heart:red", - "condition": "_favourite=yes", + "id": "favourite_icon", "metacondition": "__showTimeSensitiveIcons!=no" }, { diff --git a/langs/en.json b/langs/en.json index f9fbf3379..0f25afbfe 100644 --- a/langs/en.json +++ b/langs/en.json @@ -18,7 +18,7 @@ "allFilteredAway": "No feature in view meets all filters", "loadingData": "Loading data…", "noData": "There are no relevant features in the current view", - "noDataOffline": "No data is loaded and you are offline", + "noDataOffline": "No data is loaded and you are offline", "ready": "Done!", "retrying": "Loading data failed. Trying again in {count} seconds…", "zoomIn": "Zoom in to view or edit the data" @@ -639,6 +639,7 @@ "uploading": "{count} images are being uploaded…" }, "noBlur": "Images will not be blurred. Do not photograph people", + "offline": "You are currently offline. Uploading images be attempted when your internet is back", "one": { "done": "Your image was successfully uploaded. Thank you!", "failed": "Sorry, we could not upload your image", @@ -653,7 +654,7 @@ "confirmDeleteTitle": "Delete this image?", "delete": "Delete this image", "intro": "The following images are queued for upload", - "menu": "Image upload queue ({count})", + "menu": "Pending changes and image uploads ({count})", "noFailedImages": "There are currently no images in the upload queue", "retryAll": "Retry uploading all images" }, diff --git a/src/Logic/Osm/Changes.ts b/src/Logic/Osm/Changes.ts index 14dae7e0c..bd2b942df 100644 --- a/src/Logic/Osm/Changes.ts +++ b/src/Logic/Osm/Changes.ts @@ -19,6 +19,7 @@ import MarkdownUtils from "../../Utils/MarkdownUtils" import FeaturePropertiesStore from "../FeatureSource/Actors/FeaturePropertiesStore" import { Feature, Point } from "geojson" import { Lists } from "../../Utils/Lists" +import { IsOnline } from "../Web/IsOnline" /** * Handles all changes made to OSM. @@ -287,6 +288,10 @@ export class Changes { if (this.pendingChanges.data.length === 0) { return } + if(!IsOnline.isOnline.data){ + // No use to upload, we aren't connected anyway + return + } if (this.isUploading.data) { console.log("Is already uploading... Abort") return diff --git a/src/UI/BigComponents/MenuDrawerIndex.svelte b/src/UI/BigComponents/MenuDrawerIndex.svelte index 3093909aa..a8952cfdc 100644 --- a/src/UI/BigComponents/MenuDrawerIndex.svelte +++ b/src/UI/BigComponents/MenuDrawerIndex.svelte @@ -64,6 +64,10 @@ import { GlobeEuropeAfrica } from "@babeard/svelte-heroicons/solid/GlobeEuropeAfrica" import { onDestroy } from "svelte" import Avatar from "../Base/Avatar.svelte" + import { SpecialVisualizationSvelte } from "../SpecialVisualization" + import ThemeViewState from "../../Models/ThemeViewState" + import { Changes } from "../../Logic/Osm/Changes" + import PendingChangesView from "./PendingChangesView.svelte" export let state: { favourites: FavouritesFeatureSource @@ -73,6 +77,7 @@ featureSwitches: Partial mapProperties?: MapProperties userRelatedState?: UserRelatedState + changes?: Changes } let userdetails = state.osmConnection.userDetails @@ -81,6 +86,7 @@ let featureSwitches = state.featureSwitches let showHome = featureSwitches?.featureSwitchBackToThemeOverview let pg = state.guistate.pageStates + let pendingChanges = state?.changes?.pendingChanges export let onlyLink: boolean const t = Translations.t.general.menu let shown = new UIEventSource(state.guistate.pageStates.menu.data || !onlyLink) @@ -164,12 +170,14 @@ /> - {#if $nrOfFailedImages.length > 0 || $failedImagesOpen} + {#if $nrOfFailedImages.length > 0 || $failedImagesOpen || $pendingChanges?.length > 0 } - + + {/if} diff --git a/src/UI/BigComponents/PendingChangesView.svelte b/src/UI/BigComponents/PendingChangesView.svelte new file mode 100644 index 000000000..3aa888c9e --- /dev/null +++ b/src/UI/BigComponents/PendingChangesView.svelte @@ -0,0 +1,58 @@ + +{#if $pending?.length > 0} +
+ +

Pending changes

+ + There are currently {$pending.length} pending changes: + + + + + + + + {#each $pending as change} + + + + + + + {/each} +
+ Theme + + Type + + Object +
{change.meta.theme}{change.meta.changeType} + + {change.type}/{change.id} + +
+ + {#if $debug} + {#each $pending as change} + {JSON.stringify(change)} + {/each} + {/if} +
+ +{/if} + + + diff --git a/src/UI/Image/QueuedImagesView.svelte b/src/UI/Image/QueuedImagesView.svelte index 3c813ffa5..ab2e98847 100644 --- a/src/UI/Image/QueuedImagesView.svelte +++ b/src/UI/Image/QueuedImagesView.svelte @@ -8,9 +8,11 @@ import type { ImageUploadArguments } from "../../Logic/ImageProviders/ImageUploadQueue" import { Store } from "../../Logic/UIEventSource" import UploadingImageCounter from "./UploadingImageCounter.svelte" + import { IsOnline } from "../../Logic/Web/IsOnline" export let state: WithImageState let queued: Store = state.imageUploadManager.queuedArgs let isUploading = state.imageUploadManager.isUploading + let online = IsOnline.isOnline const t = Translations.t const q = t.imageQueue @@ -27,7 +29,7 @@ {#if $isUploading} - {:else} + {:else if $online}