Skip to content

Commit

Permalink
feat(ui): display app version in report navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibaut-gauvin committed Jun 24, 2024
1 parent 2bb9475 commit f094c2e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: 'client/.nvmrc'
- run: sed -i 's/unreleased/${{ github.ref_name }}/' client/package.json
- run: NODE_ENV=CI npm -C client install
- run: NODE_ENV=production npm -C client run build

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ fmt: ## Run `go fmt` on all files

client.artifact: ## Build client artifact (Svelte static site)
rm -rf client/build
# sed -i 's/unreleased/$(shell git describe --tags --abbrev=0)-next/' client/package.json
NODE_ENV=CI npm -C client install
NODE_ENV=production npm -C client run build

Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dib-client",
"version": "0.0.1",
"version": "unreleased",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down
17 changes: 17 additions & 0 deletions client/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { version } from '$app/environment';
import { page } from '$app/stores';
import { onMount } from 'svelte';
import { imagesStore, reportDataStore } from '$stores/report.ts';
Expand Down Expand Up @@ -60,6 +61,14 @@
<a href="/scan" class:current={$page.url.pathname.startsWith('/scan')}>Scan logs</a>
</li>
</ul>

<div class="footer">
Made with ♥ by Radio France
<br />
<a href="https://github.com/radiofrance/dib/releases" target="_blank">
<span>{version}</span>
</a>
</div>
</div>

<div class="content">
Expand Down Expand Up @@ -106,6 +115,14 @@
color: grey;
}
.navbar .footer {
position: fixed;
bottom: 0.5em;
width: auto;
text-align: center;
color: #eeeeee;
}
.content {
width: 100%;
padding: 1rem 2rem;
Expand Down
4 changes: 4 additions & 0 deletions client/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import packageJson from './package.json' assert { type: 'json' };

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand All @@ -22,6 +23,9 @@ const config = {
'$lib/*': 'src/lib/*',
'$models/*': 'src/models/*',
'$stores/*': 'src/stores/*'
},
version: {
name: packageJson.version
}
}
};
Expand Down

0 comments on commit f094c2e

Please sign in to comment.