From 75e40350fa94672baad0aa37a053dacce25a6583 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Wed, 17 Feb 2021 09:16:24 +0100 Subject: [PATCH] scaffolder: Use default ErrorPage --- .../components/TaskNotFound/TaskNotFound.tsx | 59 ------------------- .../src/components/TaskPage/TaskPage.tsx | 9 ++- 2 files changed, 6 insertions(+), 62 deletions(-) delete mode 100644 plugins/scaffolder/src/components/TaskNotFound/TaskNotFound.tsx diff --git a/plugins/scaffolder/src/components/TaskNotFound/TaskNotFound.tsx b/plugins/scaffolder/src/components/TaskNotFound/TaskNotFound.tsx deleted file mode 100644 index 24ac8c357d..0000000000 --- a/plugins/scaffolder/src/components/TaskNotFound/TaskNotFound.tsx +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import { Grid, Typography } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; -import { BackstageTheme } from '@backstage/theme'; - -const useStyles = makeStyles(theme => ({ - container: { - paddingTop: theme.spacing(24), - paddingLeft: theme.spacing(8), - [theme.breakpoints.down('xs')]: { - padding: theme.spacing(2), - }, - }, - title: { - paddingBottom: theme.spacing(2), - [theme.breakpoints.down('xs')]: { - fontSize: 32, - }, - }, - body: { - paddingBottom: theme.spacing(6), - [theme.breakpoints.down('xs')]: { - paddingBottom: theme.spacing(5), - }, - }, -})); - -export const TaskNotFound = () => { - const classes = useStyles(); - - return ( - - - - Task not found - - - No task found with this ID - - - - ); -}; diff --git a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx index fbf2a09a21..b2f1773d0b 100644 --- a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx +++ b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Page, Header, Lifecycle, Content } from '@backstage/core'; +import { Page, Header, Lifecycle, Content, ErrorPage } from '@backstage/core'; import React, { useState, useEffect, memo, useMemo } from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; import Stepper from '@material-ui/core/Stepper'; @@ -43,7 +43,6 @@ import Cancel from '@material-ui/icons/Cancel'; import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord'; import { entityRoute } from '@backstage/plugin-catalog-react'; import { parseEntityName } from '@backstage/catalog-model'; -import { TaskNotFound } from '../TaskNotFound/TaskNotFound'; // typings are wrong for this library, so fallback to not parsing types. const humanizeDuration = require('humanize-duration'); @@ -278,7 +277,11 @@ export const TaskPage = () => { /> {taskNotFound ? ( - + ) : (