forked from MapComplete/MapComplete
		
	Favourites: tweaking overview; fix upload of properties
This commit is contained in:
		
							parent
							
								
									59090fdb39
								
							
						
					
					
						commit
						a350410520
					
				
					 6 changed files with 49 additions and 25 deletions
				
			
		| 
						 | 
				
			
			@ -1,29 +1,30 @@
 | 
			
		|||
<script lang="ts">
 | 
			
		||||
  import { UIEventSource } from "../../Logic/UIEventSource"
 | 
			
		||||
  import { OsmConnection } from "../../Logic/Osm/OsmConnection"
 | 
			
		||||
  import Marker from "../Map/Marker.svelte"
 | 
			
		||||
  import NextButton from "../Base/NextButton.svelte"
 | 
			
		||||
  import { AllKnownLayouts } from "../../Customizations/AllKnownLayouts"
 | 
			
		||||
  import { AllSharedLayers } from "../../Customizations/AllSharedLayers"
 | 
			
		||||
  import { createEventDispatcher } from "svelte"
 | 
			
		||||
  import { UIEventSource } from "../../Logic/UIEventSource";
 | 
			
		||||
  import { OsmConnection } from "../../Logic/Osm/OsmConnection";
 | 
			
		||||
  import Marker from "../Map/Marker.svelte";
 | 
			
		||||
  import NextButton from "../Base/NextButton.svelte";
 | 
			
		||||
  import { AllKnownLayouts } from "../../Customizations/AllKnownLayouts";
 | 
			
		||||
  import { AllSharedLayers } from "../../Customizations/AllSharedLayers";
 | 
			
		||||
  import { createEventDispatcher } from "svelte";
 | 
			
		||||
 | 
			
		||||
  export let info: { id: string; owner: number }
 | 
			
		||||
  export let category: "layers" | "themes"
 | 
			
		||||
  export let osmConnection: OsmConnection
 | 
			
		||||
  export let info: { id: string; owner: number };
 | 
			
		||||
  export let category: "layers" | "themes";
 | 
			
		||||
  export let osmConnection: OsmConnection;
 | 
			
		||||
 | 
			
		||||
  let displayName = UIEventSource.FromPromise(
 | 
			
		||||
    osmConnection.getInformationAboutUser(info.owner)
 | 
			
		||||
  ).mapD((response) => response.display_name)
 | 
			
		||||
  ).mapD((response) => response.display_name);
 | 
			
		||||
 | 
			
		||||
  let selfId = osmConnection.userDetails.mapD((ud) => ud.uid);
 | 
			
		||||
 | 
			
		||||
  let selfId = osmConnection.userDetails.mapD((ud) => ud.uid)
 | 
			
		||||
  function fetchIconDescription(layerId): any {
 | 
			
		||||
    if (category === "themes") {
 | 
			
		||||
      return AllKnownLayouts.allKnownLayouts.get(layerId).icon
 | 
			
		||||
      return AllKnownLayouts.allKnownLayouts.get(layerId).icon;
 | 
			
		||||
    }
 | 
			
		||||
    return AllSharedLayers.getSharedLayersConfigs().get(layerId)?._layerIcon
 | 
			
		||||
    return AllSharedLayers.getSharedLayersConfigs().get(layerId)?._layerIcon;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const dispatch = createEventDispatcher<{ layerSelected: string }>()
 | 
			
		||||
  const dispatch = createEventDispatcher<{ layerSelected: string }>();
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<NextButton clss="small" on:click={() => dispatch("layerSelected", info)}>
 | 
			
		||||
| 
						 | 
				
			
			@ -32,6 +33,12 @@
 | 
			
		|||
  </div>
 | 
			
		||||
  <b class="px-1">{info.id}</b>
 | 
			
		||||
  {#if info.owner && info.owner !== $selfId}
 | 
			
		||||
    (made by {$displayName ?? info.owner})
 | 
			
		||||
    {#if displayName}
 | 
			
		||||
      (made by {$displayName}
 | 
			
		||||
      {#if window.location.host.startsWith("127.0.0.1")}
 | 
			
		||||
        - {info.owner}
 | 
			
		||||
      {/if}
 | 
			
		||||
      )
 | 
			
		||||
    {/if}
 | 
			
		||||
  {/if}
 | 
			
		||||
</NextButton>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue