Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EES-5916 api notification banner #5660

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { ReactNode } from 'react';

interface Props {
children?: ReactNode;
className?: string;
fullWidthContent?: boolean;
heading?: string;
role?: 'region' | 'alert';
Expand All @@ -13,6 +14,7 @@ interface Props {

const NotificationBanner = ({
children,
className,
fullWidthContent = false,
heading,
role = 'region',
Expand All @@ -24,6 +26,7 @@ const NotificationBanner = ({
aria-labelledby="govuk-notification-banner-title"
className={classNames(
'govuk-notification-banner govuk-!-margin-bottom-6',
className,
{
[styles.fullWidthContent]: fullWidthContent,
[styles.error]: variant === 'error',
Expand Down
28 changes: 28 additions & 0 deletions src/explore-education-statistics-frontend/src/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import PhaseBanner from '@common/components/PhaseBanner';
import NotificationBanner from '@common/components/NotificationBanner';
import CookieBanner from '@frontend/components/CookieBanner';
import UserTestingBanner from '@frontend/components/UserTestingBanner';
import classNames from 'classnames';
Expand All @@ -9,6 +10,7 @@ import PageHeader from './PageHeader';
import PageMeta, { PageMetaProps } from './PageMeta';
import PageTitle from './PageTitle';
import Feedback from './Feedback';
import Link from './Link';

type Props = {
includeDefaultMetaTitle?: boolean;
Expand All @@ -22,6 +24,7 @@ type Props = {
children?: ReactNode;
wide?: boolean;
isHomepage?: boolean;
showApiBanner?: boolean;
} & BreadcrumbsProps;

const Page = ({
Expand All @@ -37,6 +40,7 @@ const Page = ({
wide = false,
isHomepage = false,
breadcrumbs = [],
showApiBanner = true,
}: Props) => {
return (
<>
Expand All @@ -57,6 +61,30 @@ const Page = ({
})}
>
<PhaseBanner url="https://forms.office.com/Pages/ResponsePage.aspx?id=yXfS-grGoU2187O4s0qC-XMiKzsnr8xJoWM_DeGwIu9UNDJHOEJDRklTNVA1SDdLOFJITEwyWU1OQS4u" />

{showApiBanner && (
<NotificationBanner
className="govuk-!-margin-top-6"
fullWidthContent
title="Important update"
>
<p>
The first data sets are now available in our new API,{' '}
<Link to="/data-catalogue?dataSetType=api">
view them in the data catalogue
</Link>{' '}
or read our{' '}
<Link to="https://api.education.gov.uk/statistics/docs/ ">
API documentation
</Link>
. If you have any questions or feedback, contact us at{' '}
<a href="mailto:explore.statistics@education.gov.uk">
explore.statistics@education.gov.uk
</a>
</p>
</NotificationBanner>
)}

<Breadcrumbs
breadcrumbs={
isHomepage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const PermalinkPage: NextPage<Props> = ({ data }) => {
title={`'${dataSetTitle}' from '${publicationTitle}'`}
caption="Permanent data table"
className={styles.permalinkPage}
showApiBanner={false}
wide
breadcrumbs={[
{ name: 'Data tables', link: '/data-tables' },
Expand Down