✨(frontend) show version number in footer (#461)
In order to see the version number pushed into production
This commit is contained in:
@@ -16,6 +16,7 @@ and this project adheres to
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- ✨(backend) manage roles on domain admin view
|
- ✨(backend) manage roles on domain admin view
|
||||||
|
- ✨(frontend) show version number in footer #369
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe('Page', () => {
|
|||||||
|
|
||||||
it('checks Page rendering with team feature', () => {
|
it('checks Page rendering with team feature', () => {
|
||||||
useConfigStore.setState({
|
useConfigStore.setState({
|
||||||
config: { FEATURES: { TEAMS: true }, LANGUAGES: [] },
|
config: { RELEASE: '1.0.0', FEATURES: { TEAMS: true }, LANGUAGES: [] },
|
||||||
});
|
});
|
||||||
|
|
||||||
render(<Page />, { wrapper: AppWrapper });
|
render(<Page />, { wrapper: AppWrapper });
|
||||||
@@ -31,7 +31,7 @@ describe('Page', () => {
|
|||||||
|
|
||||||
it('checks Page rendering without team feature', () => {
|
it('checks Page rendering without team feature', () => {
|
||||||
useConfigStore.setState({
|
useConfigStore.setState({
|
||||||
config: { FEATURES: { TEAMS: false }, LANGUAGES: [] },
|
config: { RELEASE: '1.0.0', FEATURES: { TEAMS: false }, LANGUAGES: [] },
|
||||||
});
|
});
|
||||||
|
|
||||||
render(<Page />, { wrapper: AppWrapper });
|
render(<Page />, { wrapper: AppWrapper });
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jest.mock('next/navigation', () => ({
|
|||||||
describe('MainLayout', () => {
|
describe('MainLayout', () => {
|
||||||
it('checks menu rendering with team feature', () => {
|
it('checks menu rendering with team feature', () => {
|
||||||
useConfigStore.setState({
|
useConfigStore.setState({
|
||||||
config: { FEATURES: { TEAMS: true }, LANGUAGES: [] },
|
config: { RELEASE: '1.0.0', FEATURES: { TEAMS: true }, LANGUAGES: [] },
|
||||||
});
|
});
|
||||||
|
|
||||||
render(<MainLayout />, { wrapper: AppWrapper });
|
render(<MainLayout />, { wrapper: AppWrapper });
|
||||||
@@ -37,7 +37,7 @@ describe('MainLayout', () => {
|
|||||||
|
|
||||||
it('checks menu rendering without team feature', () => {
|
it('checks menu rendering without team feature', () => {
|
||||||
useConfigStore.setState({
|
useConfigStore.setState({
|
||||||
config: { FEATURES: { TEAMS: false }, LANGUAGES: [] },
|
config: { RELEASE: '1.0.0', FEATURES: { TEAMS: false }, LANGUAGES: [] },
|
||||||
});
|
});
|
||||||
|
|
||||||
render(<MainLayout />, { wrapper: AppWrapper });
|
render(<MainLayout />, { wrapper: AppWrapper });
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
export interface Config {
|
export interface Config {
|
||||||
LANGUAGES: [string, string][];
|
LANGUAGES: [string, string][];
|
||||||
|
RELEASE: string;
|
||||||
FEATURES: {
|
FEATURES: {
|
||||||
TEAMS: boolean;
|
TEAMS: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { Box, LogoGouv, StyledLink, Text } from '@/components';
|
import { Box, LogoGouv, StyledLink, Text } from '@/components';
|
||||||
|
import { useConfigStore } from '@/core';
|
||||||
|
|
||||||
import IconLink from './assets/external-link.svg';
|
import IconLink from './assets/external-link.svg';
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ const BlueStripe = styled.div`
|
|||||||
|
|
||||||
export const Footer = () => {
|
export const Footer = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { config } = useConfigStore();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box $position="relative" as="footer">
|
<Box $position="relative" as="footer">
|
||||||
@@ -138,6 +140,7 @@ export const Footer = () => {
|
|||||||
</StyledLink>
|
</StyledLink>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
as="p"
|
as="p"
|
||||||
$size="m"
|
$size="m"
|
||||||
@@ -145,6 +148,12 @@ export const Footer = () => {
|
|||||||
$variation="600"
|
$variation="600"
|
||||||
$display="inline"
|
$display="inline"
|
||||||
>
|
>
|
||||||
|
{config?.RELEASE && (
|
||||||
|
<>
|
||||||
|
{t(`Version: {{release}}`, { release: config?.RELEASE })} •
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<Trans>
|
<Trans>
|
||||||
Unless otherwise stated, all content on this site is under
|
Unless otherwise stated, all content on this site is under
|
||||||
<StyledLink
|
<StyledLink
|
||||||
|
|||||||
@@ -87,4 +87,13 @@ test.describe('Footer', () => {
|
|||||||
await expect(page).toHaveURL(url);
|
await expect(page).toHaveURL(url);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test('check if the app version is visible', async ({ page }) => {
|
||||||
|
const footer = page.locator('footer').first();
|
||||||
|
await expect(
|
||||||
|
footer.getByText(
|
||||||
|
'Version: NA • Unless otherwise stated, all content on this site is under',
|
||||||
|
),
|
||||||
|
).toBeVisible();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user