Skip to content

Commit

Permalink
Show the version of the app
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Sep 14, 2023
1 parent 0ec189c commit 53a0176
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/lib/browse/AppVersion.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script lang="ts">
import { HelpButton } from "lib/common";
let version = "unknown";
if (window.location.hostname == "localhost") {
version = "Local development";
} else if (window.location.hostname == "acteng.github.io") {
if (window.location.pathname == "/atip/browse.html") {
version = "Current development (public)";
} else {
let parts = window.location.pathname.split("/");
if (parts.length == 4 && parts[1] == "atip") {
version = `Development branch: ${parts[2]}`;
}
}
} else if (window.location.hostname.endsWith(".appspot.com")) {
// TODO Include a git commit, build timestamp, or similar
version = "Test (on GCP)";
}
</script>

<p>
App version: {version}
<HelpButton>
{#if version == "Test (on GCP)"}
<p>
The scheme data shown is fake. Load the real data from a file below.
We're working to put real scheme data here.
</p>
{/if}
<p>Note the ATF scheme data has not been validated.</p>
<p>
Please contact <a href="mailto:dcarlino@turing.ac.uk">Dustin</a>
and
<a href="mailto:Peter.York@activetravelengland.gov.uk">Pete</a>
about any problems, ideas, or feedback for this site.
</p>
</HelpButton>
</p>
2 changes: 2 additions & 0 deletions src/pages/BrowseSchemes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// @ts-ignore no declarations
import { initAll } from "govuk-frontend";
import "../style/main.css";
import AppVersion from "lib/browse/AppVersion.svelte";
import { processInput, type Scheme } from "lib/browse/data";
import Filters from "lib/browse/Filters.svelte";
import LayerControls from "lib/browse/LayerControls.svelte";
Expand Down Expand Up @@ -93,6 +94,7 @@
<h1>Browse schemes</h1>
<ZoomOutMap boundaryGeojson={$gjScheme} />
</div>
<AppVersion />
{#if import.meta.env.VITE_ON_GCP === "true"}
<LoadRemoteSchemeData {loadFile} />
{/if}
Expand Down

0 comments on commit 53a0176

Please sign in to comment.