From e6c7d007686faf66fdfc5c552b82c003af218adc Mon Sep 17 00:00:00 2001 From: "Adolfo R. Brandes" Date: Wed, 29 Apr 2026 08:48:16 -0300 Subject: [PATCH] fix: set document title via Helmet on the not-found route NotFoundPage was the only authn route child without a block, so /authn/notfound kept whatever title the previous page set. Add the title following the per-page pattern from frontend-base ADR 0015. Refs openedx/frontend-base#250. Co-Authored-By: Claude --- src/common-components/NotFoundPage.jsx | 37 +++++++++++++++++--------- src/common-components/messages.jsx | 6 +++++ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/common-components/NotFoundPage.jsx b/src/common-components/NotFoundPage.jsx index b4a98640af..ee1338c105 100644 --- a/src/common-components/NotFoundPage.jsx +++ b/src/common-components/NotFoundPage.jsx @@ -1,15 +1,28 @@ -import { FormattedMessage } from '@openedx/frontend-base'; +import { FormattedMessage, getSiteConfig, useIntl } from '@openedx/frontend-base'; +import { Helmet } from 'react-helmet'; -const NotFoundPage = () => ( -
-

- -

-
-); +import messages from './messages'; + +const NotFoundPage = () => { + const { formatMessage } = useIntl(); + return ( +
+ + + {formatMessage(messages['error.notfound.page.title'], { + siteName: getSiteConfig().siteName, + })} + + +

+ +

+
+ ); +}; export default NotFoundPage; diff --git a/src/common-components/messages.jsx b/src/common-components/messages.jsx index 077964b08a..2459902e82 100644 --- a/src/common-components/messages.jsx +++ b/src/common-components/messages.jsx @@ -1,6 +1,12 @@ import { defineMessages } from '@openedx/frontend-base'; const messages = defineMessages({ + // not found page + 'error.notfound.page.title': { + id: 'error.notfound.page.title', + defaultMessage: 'Page Not Found | {siteName}', + description: 'Document title for the page-not-found page', + }, // institution login strings 'institution.login.page.sub.heading': { id: 'institution.login.page.sub.heading',