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 feature: Feature
|
||||||
export let readonly = false
|
export let readonly = false
|
||||||
export let sourceUrl: Store<string>
|
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
|
export let collapsed: boolean
|
||||||
const t = Translations.t.external
|
const t = Translations.t.external
|
||||||
|
|
||||||
|
@ -49,8 +53,14 @@
|
||||||
<LoginToggle {state} silentFail>
|
<LoginToggle {state} silentFail>
|
||||||
{#if !$sourceUrl || !$enableLogin}
|
{#if !$sourceUrl || !$enableLogin}
|
||||||
<!-- empty block -->
|
<!-- empty block -->
|
||||||
|
{:else if !$downloadInformation}
|
||||||
|
<button on:click={() => downloadInformation.set(true)}>
|
||||||
|
Attempt to download information from the website {$sourceUrl}
|
||||||
|
</button>
|
||||||
{:else if $externalData === undefined}
|
{:else if $externalData === undefined}
|
||||||
<Loading />
|
<div class="flex justify-center">
|
||||||
|
<Loading />
|
||||||
|
</div>
|
||||||
{:else if $externalData["error"] !== undefined}
|
{:else if $externalData["error"] !== undefined}
|
||||||
<div class="subtle low-interaction rounded p-2 px-4 italic">
|
<div class="subtle low-interaction rounded p-2 px-4 italic">
|
||||||
<Tr t={Translations.t.external.error} />
|
<Tr t={Translations.t.external.error} />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue