-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- get rid of the enormous list of scheme cards, and move the buttons into the intervention map popup - group all of the schemes stuff and treat as a layer - move the layers to the left
- Loading branch information
1 parent
5f5cb06
commit 7a486bc
Showing
7 changed files
with
130 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script lang="ts"> | ||
import { | ||
CollapsibleCard, | ||
ErrorMessage, | ||
FileInput, | ||
SecondaryButton, | ||
} from "govuk-svelte"; | ||
import { appVersion, Modal } from "lib/common"; | ||
import LoadRemoteSchemeData from "./LoadRemoteSchemeData.svelte"; | ||
import { processInput } from "./data"; | ||
import Filters from "./Filters.svelte"; | ||
import { schemes, schemesGj } from "./stores"; | ||
import InterventionLayer from "./InterventionLayer.svelte"; | ||
let schemesToBeShown: Set<string> = new Set(); | ||
let showSchemes = true; | ||
let showSchemeNotes = false; | ||
let errorMessage = ""; | ||
function loadFile(filename: string, text: string) { | ||
try { | ||
schemesGj.set(JSON.parse(text)); | ||
schemes.set(processInput($schemesGj)); | ||
errorMessage = ""; | ||
} catch (err) { | ||
errorMessage = `The file you loaded is broken: ${err}`; | ||
} | ||
} | ||
</script> | ||
|
||
<CollapsibleCard label="Schemes"> | ||
{#if appVersion() == "Private (development)"} | ||
<LoadRemoteSchemeData {loadFile} /> | ||
{/if} | ||
{#if $schemesGj.notes} | ||
<SecondaryButton on:click={() => (showSchemeNotes = true)}> | ||
About the scheme data | ||
</SecondaryButton> | ||
<Modal title="About this scheme data" bind:open={showSchemeNotes}> | ||
<div class="govuk-prose"> | ||
<p>Please note there are data quality caveats for all scheme data:</p> | ||
<ul> | ||
{#each $schemesGj.notes as note} | ||
<li><p>{note}</p></li> | ||
{/each} | ||
</ul> | ||
</div> | ||
</Modal> | ||
{/if} | ||
<FileInput label="Load schemes from GeoJSON" onLoad={loadFile} /> | ||
<ErrorMessage {errorMessage} /> | ||
|
||
{#if $schemes.size > 0} | ||
<Filters bind:schemesToBeShown bind:show={showSchemes} /> | ||
{/if} | ||
</CollapsibleCard> | ||
|
||
<InterventionLayer {showSchemes} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters