Skip to content

Commit

Permalink
rework wording of file management (#90)
Browse files Browse the repository at this point in the history
* rework wording of file management

* File management pr changes

---------

Co-authored-by: Peter York <[email protected]>
  • Loading branch information
Pete-Y-CS and Peter York authored Oct 14, 2024
1 parent b6dc6fe commit 3fa8380
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
20 changes: 10 additions & 10 deletions src/lib/files/FileManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// eslint-disable-next-line no-undef
export let state: Writable<StateType>;
export let service: string;
// A singular noun like "scheme". The plural noun is assumed to just need an "s" appended
export let fileObjectType: string;
// If provided, adds an option to import from an XLSX file. Runs the callback
// with the ArrayBuffer to produce State. This should throw exceptions if
Expand Down Expand Up @@ -125,16 +127,16 @@
<div class="govuk-width-container">
<AlphaBanner />

<h1 style="margin-top: 30px">Manage my schemes</h1>
<h1 style="margin-top: 30px">Manage my {fileObjectType}s</h1>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<slot name="description" />

<p>
All files are auto-saved in your browser's local storage. You can close
your browser and resume later. You can export the file to your computer
to share with someone else, and import from a file below.
On this page you can manage your {fileObjectType} files. All files are auto-saved
in your browser's local storage. You can close your browser and continue
later.
</p>

{#if $currentFile}
Expand Down Expand Up @@ -187,12 +189,10 @@
</div>

<div class="govuk-grid-column-one-third">
<h2 class="green-bar">Create or import a file</h2>
<SecondaryButton on:click={newFile}>
New blank scheme file
</SecondaryButton>
<hr />
<FileInput label="Import from a .json file" onLoad={importJsonFile} />
<h2 class="green-bar">Create a new {fileObjectType}</h2>
<SecondaryButton on:click={newFile}>Create new file</SecondaryButton>
<h2>Import a saved {fileObjectType}</h2>
<FileInput label={`Select a .json file`} onLoad={importJsonFile} />

{#if xlsxImporter != null}
<hr />
Expand Down
8 changes: 7 additions & 1 deletion src/routes/area_check/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
import { files, currentFile, state } from "./data";
</script>

<FileManager {files} {currentFile} {state} service="Area Check Tool" />
<FileManager
{files}
{currentFile}
{state}
service="Area Check Tool"
fileObjectType="scheme"
/>
8 changes: 7 additions & 1 deletion src/routes/area_check/files/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
import { files, currentFile, state } from "../data";
</script>

<FileManager {files} {currentFile} {state} service="Area Check Tool" />
<FileManager
{files}
{currentFile}
{state}
service="Area Check Tool"
fileObjectType="scheme"
/>
8 changes: 7 additions & 1 deletion src/routes/cross_section/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
import { files, currentFile, state } from "./data";
</script>

<FileManager {files} {currentFile} {state} service="Cross Section Check Tool" />
<FileManager
{files}
{currentFile}
{state}
service="Cross Section Check Tool"
fileObjectType="cross section"
/>
1 change: 1 addition & 0 deletions src/routes/planning/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
{currentFile}
{state}
service="Planning Application Assessment Toolkit"
fileObjectType="assessment"
/>
1 change: 1 addition & 0 deletions src/routes/route_check/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{state}
{xlsxImporter}
service="Route Check Tool"
fileObjectType="scheme"
>
<p slot="description">
The Route Check Tool is used by ATE for assessing the design quality of
Expand Down

0 comments on commit 3fa8380

Please sign in to comment.