forked from MapComplete/MapComplete
		
	Merge branch 'master' into develop
This commit is contained in:
		
						commit
						319f758d32
					
				
					 13 changed files with 71 additions and 16 deletions
				
			
		|  | @ -2,10 +2,10 @@ | |||
|   import { twMerge } from "tailwind-merge" | ||||
|   import Loading from "../../assets/svg/Loading.svelte" | ||||
| 
 | ||||
|   export let cls: string = undefined | ||||
|   export let cls: string = "flex p-1 pl-2" | ||||
| </script> | ||||
| 
 | ||||
| <div class={twMerge("flex p-1 pl-2", cls)}> | ||||
| <div class={cls}> | ||||
|   <div class="min-w-6 h-6 w-6 shrink-0 animate-spin self-center"> | ||||
|     <Loading /> | ||||
|   </div> | ||||
|  |  | |||
|  | @ -1,15 +1,19 @@ | |||
| <script lang="ts"> | ||||
|   /** | ||||
|    * A mapcontrol button which allows the user to select a different background. | ||||
|    * Even though the component is very small, it gets it's own class as it is often reused | ||||
|    * Even though the component is very small, it gets its own class as it is often reused | ||||
|    */ | ||||
|   import { Square3Stack3dIcon } from "@babeard/svelte-heroicons/solid" | ||||
|   import type { SpecialVisualizationState } from "../SpecialVisualization" | ||||
|   import Translations from "../i18n/Translations" | ||||
|   import MapControlButton from "../Base/MapControlButton.svelte" | ||||
|   import Tr from "../Base/Tr.svelte" | ||||
|   import StyleLoadingIndicator from "../Map/StyleLoadingIndicator.svelte" | ||||
|   import { UIEventSource } from "../../Logic/UIEventSource" | ||||
|   import { Map as MlMap } from "maplibre-gl" | ||||
|   import ThemeViewState from "../../Models/ThemeViewState" | ||||
| 
 | ||||
|   export let state: SpecialVisualizationState | ||||
|   export let state: ThemeViewState | ||||
|   export let hideTooltip = false | ||||
| </script> | ||||
| 
 | ||||
|  | @ -17,7 +21,10 @@ | |||
|   arialabel={Translations.t.general.labels.background} | ||||
|   on:click={() => state.guistate.backgroundLayerSelectionIsOpened.setData(true)} | ||||
| > | ||||
|   <Square3Stack3dIcon class="h-6 w-6" /> | ||||
|    | ||||
|   <StyleLoadingIndicator map={state.map} rasterLayer={state.mapProperties.rasterLayer} > | ||||
|     <Square3Stack3dIcon class="h-6 w-6" /> | ||||
|   </StyleLoadingIndicator> | ||||
|   {#if !hideTooltip} | ||||
|     <Tr cls="mx-2" t={Translations.t.general.backgroundSwitch} /> | ||||
|   {/if} | ||||
|  |  | |||
|  | @ -41,13 +41,17 @@ | |||
|   {:else if $failed === 1} | ||||
|     <UploadFailedMessage failed={$failed} on:click={() => dismissed = $failed}/> | ||||
|   {:else if $retried === 1} | ||||
|     <Loading cls="alert"> | ||||
|     <div class="alert"> | ||||
|     <Loading> | ||||
|       <Tr t={t.upload.one.retrying} /> | ||||
|     </Loading> | ||||
|     </div> | ||||
|   {:else} | ||||
|     <Loading cls="alert"> | ||||
|     <div class="alert"> | ||||
|     <Loading> | ||||
|       <Tr t={t.upload.one.uploading} /> | ||||
|     </Loading> | ||||
|     </div> | ||||
|   {/if} | ||||
| {:else if $uploadStarted > 1} | ||||
|   {#if $uploadFinished + $failed === $uploadStarted} | ||||
|  |  | |||
|  | @ -6,14 +6,26 @@ | |||
| 
 | ||||
|   let isLoading = false | ||||
|   export let map: UIEventSource<MlMap> | ||||
|   export let rasterLayer: UIEventSource<any> = undefined | ||||
|    | ||||
|   let didChange = undefined | ||||
|   onDestroy(rasterLayer?.addCallback(() => { | ||||
|     didChange = true | ||||
|   }) ??( () => {})) | ||||
|    | ||||
|   onDestroy(Stores.Chronic(250).addCallback( | ||||
|     () => { | ||||
|       isLoading = !map.data?.isStyleLoaded() | ||||
|       isLoading = !map.data?.isStyleLoaded() && (didChange === undefined || didChange) | ||||
|       if(didChange){ | ||||
|         didChange = false | ||||
|       } | ||||
|     }, | ||||
|   )) | ||||
| </script> | ||||
| 
 | ||||
| 
 | ||||
| {#if isLoading} | ||||
|   <Loading /> | ||||
|   <Loading cls="h-6 w-6" /> | ||||
| {:else} | ||||
|   <slot /> | ||||
| {/if} | ||||
|  |  | |||
|  | @ -364,7 +364,7 @@ | |||
|         </div> | ||||
|       </div> | ||||
|     {:else} | ||||
|       <Loading>Creating point...</Loading> | ||||
|       <Loading><Tr t={Translations.t.general.add.creating}/> </Loading> | ||||
|     {/if} | ||||
|   </div> | ||||
| </LoginToggle> | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|    * The questions can either be shown all at once or one at a time (in which case they can be skipped) | ||||
|    */ | ||||
|   import TagRenderingConfig from "../../../Models/ThemeConfig/TagRenderingConfig" | ||||
|   import { UIEventSource } from "../../../Logic/UIEventSource" | ||||
|   import { Store, UIEventSource } from "../../../Logic/UIEventSource" | ||||
|   import type { Feature } from "geojson" | ||||
|   import type { SpecialVisualizationState } from "../../SpecialVisualization" | ||||
|   import LayerConfig from "../../../Models/ThemeConfig/LayerConfig" | ||||
|  | @ -12,6 +12,7 @@ | |||
|   import Tr from "../../Base/Tr.svelte" | ||||
|   import Translations from "../../i18n/Translations.js" | ||||
|   import { Utils } from "../../../Utils" | ||||
|   import { onDestroy } from "svelte" | ||||
| 
 | ||||
|   export let layer: LayerConfig | ||||
|   export let tags: UIEventSource<Record<string, string>> | ||||
|  | @ -67,8 +68,13 @@ | |||
|     }, | ||||
|     [skippedQuestions] | ||||
|   ) | ||||
|   let firstQuestion = questionsToAsk.map((qta) => qta[0]) | ||||
| 
 | ||||
|   let firstQuestion: UIEventSource<TagRenderingConfig> = new UIEventSource<TagRenderingConfig>() | ||||
|    | ||||
|   onDestroy(questionsToAsk.addCallback(qta => { | ||||
|     firstQuestion.setData(undefined) | ||||
|     firstQuestion.setData(qta[0]) | ||||
|   })) | ||||
|    | ||||
|   let answered: number = 0 | ||||
|   let skipped: number = 0 | ||||
| 
 | ||||
|  | @ -144,7 +150,7 @@ | |||
|             <TagRenderingQuestion config={question} {tags} {selectedElement} {state} {layer} /> | ||||
|           {/each} | ||||
|         </div> | ||||
|       {:else} | ||||
|       {:else if $firstQuestion !== undefined} | ||||
|         <TagRenderingQuestion | ||||
|           config={$firstQuestion} | ||||
|           {layer} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue