From f081f7826a68f43136c80f1be8ddf0beaf7dec44 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 24 Sep 2024 16:59:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5(frontend)=20remove=20footer=20and?= =?UTF-8?q?=20legal=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the new ui, the footer and legal pages are no longer needed. This commit removes them. --- .../e2e/__tests__/app-impress/footer.spec.ts | 69 -------- .../impress/src/features/footer/Footer.tsx | 166 ------------------ .../features/footer/assets/external-link.svg | 5 - .../features/service-worker/service-worker.ts | 3 - .../apps/impress/src/layouts/MainLayout.tsx | 2 - .../apps/impress/src/layouts/PageLayout.tsx | 17 -- .../apps/impress/src/layouts/index.ts | 1 - .../impress/src/pages/accessibility/index.tsx | 133 -------------- .../impress/src/pages/legal-notice/index.tsx | 72 -------- .../src/pages/personal-data-cookies/index.tsx | 66 ------- 10 files changed, 534 deletions(-) delete mode 100644 src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts delete mode 100644 src/frontend/apps/impress/src/features/footer/Footer.tsx delete mode 100644 src/frontend/apps/impress/src/features/footer/assets/external-link.svg delete mode 100644 src/frontend/apps/impress/src/layouts/PageLayout.tsx delete mode 100644 src/frontend/apps/impress/src/pages/accessibility/index.tsx delete mode 100644 src/frontend/apps/impress/src/pages/legal-notice/index.tsx delete mode 100644 src/frontend/apps/impress/src/pages/personal-data-cookies/index.tsx diff --git a/src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts deleted file mode 100644 index cd8763f3..00000000 --- a/src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { expect, test } from '@playwright/test'; - -test.beforeEach(async ({ page }) => { - await page.goto('/'); -}); - -test.describe('Footer', () => { - test('checks all the elements are visible', async ({ page }) => { - const footer = page.locator('footer').first(); - - await expect(footer.getByAltText('Gouvernement Logo')).toBeVisible(); - - await expect( - footer.getByRole('link', { name: 'legifrance.gouv.fr' }), - ).toBeVisible(); - - await expect( - footer.getByRole('link', { name: 'info.gouv.fr' }), - ).toBeVisible(); - - await expect( - footer.getByRole('link', { name: 'service-public.fr' }), - ).toBeVisible(); - - await expect( - footer.getByRole('link', { name: 'data.gouv.fr' }), - ).toBeVisible(); - - await expect( - footer.getByRole('link', { name: 'Legal Notice' }), - ).toBeVisible(); - - await expect( - footer.getByRole('link', { name: 'Personal data and cookies' }), - ).toBeVisible(); - - await expect( - footer.getByRole('link', { name: 'Accessibility' }), - ).toBeVisible(); - - await expect( - footer.getByText( - 'Unless otherwise stated, all content on this site is under licence', - ), - ).toBeVisible(); - }); - - const legalPages = [ - { name: 'Legal Notice', url: '/legal-notice/' }, - { name: 'Personal data and cookies', url: '/personal-data-cookies/' }, - { name: 'Accessibility', url: '/accessibility/' }, - ]; - for (const { name, url } of legalPages) { - test(`checks ${name} page`, async ({ page }) => { - const footer = page.locator('footer').first(); - await footer.getByRole('link', { name }).click(); - - await expect( - page - .getByRole('heading', { - name, - }) - .first(), - ).toBeVisible(); - - await expect(page).toHaveURL(url); - }); - } -}); diff --git a/src/frontend/apps/impress/src/features/footer/Footer.tsx b/src/frontend/apps/impress/src/features/footer/Footer.tsx deleted file mode 100644 index acc9c970..00000000 --- a/src/frontend/apps/impress/src/features/footer/Footer.tsx +++ /dev/null @@ -1,166 +0,0 @@ -import Image from 'next/image'; -import React from 'react'; -import { useTranslation } from 'react-i18next'; -import styled from 'styled-components'; - -import { Box, StyledLink, Text } from '@/components/'; -import { useCunninghamTheme } from '@/cunningham'; - -import IconLink from './assets/external-link.svg'; - -const BlueStripe = styled.div` - position: absolute; - height: 2px; - width: 100%; - background: var(--c--theme--colors--primary-600); - top: 0; -`; - -export const Footer = () => { - const { t } = useTranslation(); - const { themeTokens } = useCunninghamTheme(); - const logo = themeTokens().logo; - - return ( - - - - - - - {logo && ( - {logo.alt} - )} - - - - {[ - { - label: 'legifrance.gouv.fr', - href: 'https://legifrance.gouv.fr/', - }, - { - label: 'info.gouv.fr', - href: 'https://info.gouv.fr/', - }, - { - label: 'service-public.fr', - href: 'https://service-public.fr/', - }, - { - label: 'data.gouv.fr', - href: 'https://data.gouv.fr/', - }, - ].map(({ label, href }) => ( - - {label} - - - ))} - - - - {[ - { - label: t('Legal Notice'), - href: '/legal-notice', - }, - { - label: t('Personal data and cookies'), - href: '/personal-data-cookies', - }, - { - label: t('Accessibility'), - href: '/accessibility', - }, - ].map(({ label, href }) => ( - - - {label} - - - ))} - - - {t('Unless otherwise stated, all content on this site is under')}{' '} - - licence etalab-2.0 - - - - - - ); -}; diff --git a/src/frontend/apps/impress/src/features/footer/assets/external-link.svg b/src/frontend/apps/impress/src/features/footer/assets/external-link.svg deleted file mode 100644 index 25093d13..00000000 --- a/src/frontend/apps/impress/src/features/footer/assets/external-link.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/src/frontend/apps/impress/src/features/service-worker/service-worker.ts b/src/frontend/apps/impress/src/features/service-worker/service-worker.ts index 94b9c37c..7d42d62c 100644 --- a/src/frontend/apps/impress/src/features/service-worker/service-worker.ts +++ b/src/frontend/apps/impress/src/features/service-worker/service-worker.ts @@ -94,9 +94,6 @@ const precacheResources = [ '/', '/index.html', '/404/', - '/accessibility/', - '/legal-notice/', - '/personal-data-cookies/', FALLBACK.offline, FALLBACK.images, FALLBACK.docs, diff --git a/src/frontend/apps/impress/src/layouts/MainLayout.tsx b/src/frontend/apps/impress/src/layouts/MainLayout.tsx index 008a8cbe..db050df1 100644 --- a/src/frontend/apps/impress/src/layouts/MainLayout.tsx +++ b/src/frontend/apps/impress/src/layouts/MainLayout.tsx @@ -1,6 +1,5 @@ import { Box } from '@/components'; import { useCunninghamTheme } from '@/cunningham'; -import { Footer } from '@/features/footer/Footer'; import { HEADER_HEIGHT, Header } from '@/features/header'; export function MainLayout({ children }: { children: React.ReactNode }) { @@ -21,7 +20,6 @@ export function MainLayout({ children }: { children: React.ReactNode }) { -