diff --git a/packages/core-components/src/layout/ErrorPage/ErrorPage.test.tsx b/packages/core-components/src/layout/ErrorPage/ErrorPage.test.tsx
index 12ac0927ed..d6ef392f76 100644
--- a/packages/core-components/src/layout/ErrorPage/ErrorPage.test.tsx
+++ b/packages/core-components/src/layout/ErrorPage/ErrorPage.test.tsx
@@ -42,4 +42,26 @@ describe('', () => {
expect(getByText(/a link/i)).toBeInTheDocument();
expect(getByText(/a link/i)).toHaveAttribute('href', '/test');
});
+
+ it('should render with default support url if supportUrl is not provided', async () => {
+ const { getByText } = await renderInTestApp(
+ ,
+ );
+ expect(
+ getByText(/looks like someone dropped the mic!/i),
+ ).toBeInTheDocument();
+ expect(getByText(/contact support/i)).toBeInTheDocument();
+ expect(getByText(/contact support/i)).toHaveAttribute('href', 'https://github.com/backstage/backstage/issues');
+ });
+
+ it('should override support url if supportUrl property is provided', async () => {
+ const { getByText } = await renderInTestApp(
+ ,
+ );
+ expect(
+ getByText(/looks like someone dropped the mic!/i),
+ ).toBeInTheDocument();
+ expect(getByText(/contact support/i)).toBeInTheDocument();
+ expect(getByText(/contact support/i)).toHaveAttribute('href', 'https://error-page-test-support-url.com');
+ });
});
diff --git a/packages/core-components/src/layout/ErrorPage/ErrorPage.tsx b/packages/core-components/src/layout/ErrorPage/ErrorPage.tsx
index b8e0193bcf..cae8f95ec8 100644
--- a/packages/core-components/src/layout/ErrorPage/ErrorPage.tsx
+++ b/packages/core-components/src/layout/ErrorPage/ErrorPage.tsx
@@ -28,6 +28,7 @@ interface IErrorPageProps {
status: string;
statusMessage: string;
additionalInfo?: string | JSX.Element;
+ supportUrl?: string;
}
/** @public */
@@ -62,7 +63,7 @@ const useStyles = makeStyles(
*
*/
export function ErrorPage(props: IErrorPageProps) {
- const { status, statusMessage, additionalInfo } = props;
+ const { status, statusMessage, additionalInfo, supportUrl } = props;
const classes = useStyles();
const navigate = useNavigate();
const support = useSupportConfig();
@@ -88,7 +89,7 @@ export function ErrorPage(props: IErrorPageProps) {
navigate(-1)}>
Go back
- ... or please contact support if you
+ ... or please contact support if you
think this is a bug.