forked from MapComplete/MapComplete
Feature: ask permission before loading structured data
This commit is contained in:
parent
a72f5c0010
commit
1e69accbd9
1 changed files with 12 additions and 2 deletions
|
@ -29,7 +29,11 @@
|
|||
export let feature: Feature
|
||||
export let readonly = false
|
||||
export let sourceUrl: Store<string>
|
||||
|
||||
/**
|
||||
* A switch that signals that the information should be downloaded.
|
||||
* The actual 'download' code is _not_ implemented here
|
||||
*/
|
||||
export let downloadInformation : UIEventSource<boolean>
|
||||
export let collapsed: boolean
|
||||
const t = Translations.t.external
|
||||
|
||||
|
@ -49,8 +53,14 @@
|
|||
<LoginToggle {state} silentFail>
|
||||
{#if !$sourceUrl || !$enableLogin}
|
||||
<!-- empty block -->
|
||||
{:else if !$downloadInformation}
|
||||
<button on:click={() => downloadInformation.set(true)}>
|
||||
Attempt to download information from the website {$sourceUrl}
|
||||
</button>
|
||||
{:else if $externalData === undefined}
|
||||
<Loading />
|
||||
<div class="flex justify-center">
|
||||
<Loading />
|
||||
</div>
|
||||
{:else if $externalData["error"] !== undefined}
|
||||
<div class="subtle low-interaction rounded p-2 px-4 italic">
|
||||
<Tr t={Translations.t.external.error} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue