(version) convey version information to the /config endpoint and footer

We add the machinery to get version information and display it discreetly.
This commit is contained in:
Laurent Bossavit
2024-11-15 15:54:30 +01:00
committed by Laurent Bossavit
parent bbe8f32b96
commit 43c18cb4e6
9 changed files with 42 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ describe('Page', () => {
useConfigStore.setState({
config: {
RELEASE: '1.0.0',
COMMIT: 'NA',
FEATURES: { TEAMS_DISPLAY: true },
LANGUAGES: [],
},
@@ -37,6 +38,7 @@ describe('Page', () => {
useConfigStore.setState({
config: {
RELEASE: '1.0.0',
COMMIT: 'NA',
FEATURES: { TEAMS_DISPLAY: false },
LANGUAGES: [],
},

View File

@@ -20,6 +20,7 @@ describe('MainLayout', () => {
useConfigStore.setState({
config: {
RELEASE: '1.0.0',
COMMIT: 'NA',
FEATURES: { TEAMS_DISPLAY: true },
LANGUAGES: [],
},
@@ -57,6 +58,7 @@ describe('MainLayout', () => {
useConfigStore.setState({
config: {
RELEASE: '1.0.0',
COMMIT: 'NA',
FEATURES: { TEAMS_DISPLAY: true },
LANGUAGES: [],
},
@@ -95,6 +97,7 @@ describe('MainLayout', () => {
useConfigStore.setState({
config: {
RELEASE: '1.0.0',
COMMIT: 'NA',
FEATURES: { TEAMS_DISPLAY: false },
LANGUAGES: [],
},

View File

@@ -1,6 +1,7 @@
export interface Config {
LANGUAGES: [string, string][];
RELEASE: string;
COMMIT: string;
FEATURES: {
TEAMS_DISPLAY: boolean;
};

View File

@@ -5,6 +5,8 @@ import styled from 'styled-components';
import { Box, LogoGouv, StyledLink, Text } from '@/components';
import { useConfigStore } from '@/core';
import frontVersion from '../../../version.json';
import IconLink from './assets/external-link.svg';
const BlueStripe = styled.div`
@@ -141,6 +143,11 @@ export const Footer = () => {
))}
</Box>
<Text as="p" aria-hidden="true" $css="display: none">
You have found the hidden app version information ! Well done ! back
commit is: {config?.COMMIT}; front commit is: {frontVersion?.commit}
</Text>
<Text
as="p"
$size="m"

View File

@@ -0,0 +1,6 @@
{
"source":"people",
"version":"version",
"commit":"commit",
"build": "NA"
}

View File

@@ -20,6 +20,7 @@ test.describe('Config', () => {
['en-us', 'English'],
['fr-fr', 'French'],
],
COMMIT: 'NA',
FEATURES: {
CONTACTS_CREATE: true,
CONTACTS_DISPLAY: true,