💄(app-desk) integrate design 404 page
Introduce a first draft of 404 page based on Johann's design. Please refer to the Figma file for more info. This page is tested through tests e2e. It closes the issue #112
This commit is contained in:
committed by
aleb_the_flash
parent
4af4c4de50
commit
a54bcbcb1e
20
src/frontend/apps/desk/src/assets/icons/icon-404.svg
Normal file
20
src/frontend/apps/desk/src/assets/icons/icon-404.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 24 KiB |
@@ -19,6 +19,7 @@
|
|||||||
"Add team icon": "Icône ajout de groupe",
|
"Add team icon": "Icône ajout de groupe",
|
||||||
"Admin": "Admin",
|
"Admin": "Admin",
|
||||||
"Are you sure you want to delete {{teamName}} team?": "Êtes-vous sûr de vouloir supprimer le groupe {{teamName}}?",
|
"Are you sure you want to delete {{teamName}} team?": "Êtes-vous sûr de vouloir supprimer le groupe {{teamName}}?",
|
||||||
|
"Back to home page": "Retour à la page d'accueil",
|
||||||
"Cancel": "Annuler",
|
"Cancel": "Annuler",
|
||||||
"Cells icon": "Icône Cellules",
|
"Cells icon": "Icône Cellules",
|
||||||
"Choose a role": "Choisissez un rôle",
|
"Choose a role": "Choisissez un rôle",
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
"Groups": "Groupes",
|
"Groups": "Groupes",
|
||||||
"Invitation sent to {{email}}": "Invitation envoyée à {{email}}",
|
"Invitation sent to {{email}}": "Invitation envoyée à {{email}}",
|
||||||
"Invite new members to {{teamName}}": "Invitez de nouveaux membres à rejoindre {{teamName}}",
|
"Invite new members to {{teamName}}": "Invitez de nouveaux membres à rejoindre {{teamName}}",
|
||||||
|
"It seems that the page you are looking for does not exist or cannot be displayed correctly.": "Il semble que la page que vous cherchez n'existe pas ou ne puisse pas être affichée correctement.",
|
||||||
"Language": "Langue",
|
"Language": "Langue",
|
||||||
"Language Icon": "Icône de langue",
|
"Language Icon": "Icône de langue",
|
||||||
"Last update at": "Dernière modification le",
|
"Last update at": "Dernière modification le",
|
||||||
@@ -61,6 +63,7 @@
|
|||||||
"New name...": "Nouveau nom...",
|
"New name...": "Nouveau nom...",
|
||||||
"Open the member options modal": "Ouvrir les options de membre dans la fenêtre modale",
|
"Open the member options modal": "Ouvrir les options de membre dans la fenêtre modale",
|
||||||
"Open the team options": "Ouvrir les options de groupe",
|
"Open the team options": "Ouvrir les options de groupe",
|
||||||
|
"Ouch !": "Ooops !",
|
||||||
"Owner": "Propriétaire",
|
"Owner": "Propriétaire",
|
||||||
"People": "People",
|
"People": "People",
|
||||||
"People Description": "Description de People",
|
"People Description": "Description de People",
|
||||||
|
|||||||
@@ -1,25 +1,43 @@
|
|||||||
|
import { Button } from '@openfun/cunningham-react';
|
||||||
import { ReactElement } from 'react';
|
import { ReactElement } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { Text } from '@/components';
|
import Icon404 from '@/assets/icons/icon-404.svg';
|
||||||
|
import { Box, StyledLink, Text } from '@/components';
|
||||||
import { NextPageWithLayout } from '@/types/next';
|
import { NextPageWithLayout } from '@/types/next';
|
||||||
|
|
||||||
import MainLayout from './MainLayout';
|
import MainLayout from './MainLayout';
|
||||||
|
|
||||||
|
const StyledButton = styled(Button)`
|
||||||
|
width: fit-content;
|
||||||
|
padding-left: 2rem;
|
||||||
|
padding-right: 2rem;
|
||||||
|
`;
|
||||||
|
|
||||||
const Page: NextPageWithLayout = () => {
|
const Page: NextPageWithLayout = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Text
|
<Box $align="center" className="m-auto" $height="70vh" $gap="2rem">
|
||||||
className="mt-xl"
|
<Icon404 aria-label="Image 404" role="img" />
|
||||||
as="h1"
|
|
||||||
$justify="center"
|
<Text $size="h2" $weight="700" $theme="greyscale" $variation="900">
|
||||||
$align="center"
|
{t('Ouch !')}
|
||||||
$theme="danger"
|
</Text>
|
||||||
$textAlign="center"
|
|
||||||
>
|
<Text as="p" $textAlign="center" $maxWidth="400px" $size="m">
|
||||||
{t('404 - Page not found')}
|
{t(
|
||||||
</Text>
|
'It seems that the page you are looking for does not exist or cannot be displayed correctly.',
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Box className="mt-l">
|
||||||
|
<StyledLink href="/">
|
||||||
|
<StyledButton>{t('Back to home page')}</StyledButton>
|
||||||
|
</StyledLink>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
29
src/frontend/apps/e2e/__tests__/app-desk/404.spec.ts
Normal file
29
src/frontend/apps/e2e/__tests__/app-desk/404.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { expect, test } from '@playwright/test';
|
||||||
|
|
||||||
|
import { keyCloakSignIn } from './common';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page, browserName }) => {
|
||||||
|
await page.goto('/');
|
||||||
|
await keyCloakSignIn(page, browserName);
|
||||||
|
await page.goto('unknown-page404');
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('404', () => {
|
||||||
|
test('Checks all the elements are visible', async ({ page }) => {
|
||||||
|
await expect(page.getByLabel('Image 404')).toBeVisible();
|
||||||
|
await expect(page.getByText('Ouch')).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.getByText(
|
||||||
|
'It seems that the page you are looking for does not exist or cannot be displayed correctly.',
|
||||||
|
),
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(page.getByText('Back to home page')).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('checks go back to home page redirects to home page', async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
await page.getByText('Back to home page').click();
|
||||||
|
await expect(page).toHaveURL('/');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -116,7 +116,11 @@ test.describe('Teams Create', () => {
|
|||||||
|
|
||||||
test('checks 404 on teams/[id] page', async ({ page }) => {
|
test('checks 404 on teams/[id] page', async ({ page }) => {
|
||||||
await page.goto('/teams/some-unknown-team');
|
await page.goto('/teams/some-unknown-team');
|
||||||
await expect(page.getByText('404 - Page not found')).toBeVisible({
|
await expect(
|
||||||
|
page.getByText(
|
||||||
|
'It seems that the page you are looking for does not exist or cannot be displayed correctly.',
|
||||||
|
),
|
||||||
|
).toBeVisible({
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user