From 904fefeeac3fb9d164019fe3b13d3604cc13359c Mon Sep 17 00:00:00 2001 From: Maksim Chervonnyi Date: Mon, 4 Nov 2024 15:31:37 +0100 Subject: [PATCH] revert ErrorBoundary and GQL changes; use config for getting stackVersion --- catalog/app/components/Footer/Footer.tsx | 10 ++---- catalog/app/components/Layout/Layout.tsx | 34 ++---------------- catalog/app/model/graphql/schema.generated.ts | 31 ---------------- catalog/app/model/graphql/types.generated.ts | 6 ---- catalog/app/utils/Config.ts | 1 + catalog/app/utils/Stack.generated.ts | 35 ------------------- catalog/app/utils/Stack.graphql | 5 --- catalog/config-schema.json | 4 +++ shared/graphql/schema.graphql | 5 --- 9 files changed, 10 insertions(+), 121 deletions(-) delete mode 100644 catalog/app/utils/Stack.generated.ts delete mode 100644 catalog/app/utils/Stack.graphql diff --git a/catalog/app/components/Footer/Footer.tsx b/catalog/app/components/Footer/Footer.tsx index c5252462d8f..918d099f29f 100644 --- a/catalog/app/components/Footer/Footer.tsx +++ b/catalog/app/components/Footer/Footer.tsx @@ -10,12 +10,9 @@ import * as style from 'constants/style' import * as URLS from 'constants/urls' import * as Notifications from 'containers/Notifications' import * as CatalogSettings from 'utils/CatalogSettings' -import * as GQL from 'utils/GraphQL' import * as NamedRoutes from 'utils/NamedRoutes' import copyToClipboard from 'utils/clipboard' -import STACK_QUERY from 'utils/Stack.generated' - import bg from './bg.png' import iconFacebook from './icon-facebook.svg' import iconGithub from './icon-github.svg' @@ -36,13 +33,12 @@ const useVersionStyles = M.makeStyles((t) => ({ })) function Version() { - const { stack } = GQL.useQueryS(STACK_QUERY) const classes = useVersionStyles() const { push } = Notifications.use() const handleCopy = React.useCallback(() => { - copyToClipboard(stack.version || '') + copyToClipboard(cfg.stackVersion || '') push('Web catalog container hash has been copied to clipboard') - }, [push, stack.version]) + }, [push]) return ( - Version: {stack.version} + Version: {cfg.stackVersion} ) } diff --git a/catalog/app/components/Layout/Layout.tsx b/catalog/app/components/Layout/Layout.tsx index 8335222c4ae..f9c3c4d2435 100644 --- a/catalog/app/components/Layout/Layout.tsx +++ b/catalog/app/components/Layout/Layout.tsx @@ -3,40 +3,10 @@ import { useRouteMatch } from 'react-router-dom' import * as M from '@material-ui/core' import Footer from 'components/Footer' -import * as style from 'constants/style' import * as Bookmarks from 'containers/Bookmarks' import * as NavBar from 'containers/NavBar' -import { createBoundary } from 'utils/ErrorBoundary' import * as NamedRoutes from 'utils/NamedRoutes' -const useComponentErrorStyles = M.makeStyles((t) => ({ - root: { - background: t.palette.secondary.dark, - position: 'relative', - }, - container: { - color: t.palette.error.light, - padding: t.spacing(2), - }, -})) - -function ComponentError() { - const classes = useComponentErrorStyles() - return ( -
- - Failed to render component - -
- ) -} - -const ErrorBoundary = createBoundary(() => () => ( - - - -)) - const useRootStyles = M.makeStyles({ root: { overflowX: 'hidden', @@ -79,11 +49,11 @@ export function Layout({ bare = false, dark = false, children, pre }: LayoutProp return ( - {bare ? : } + {bare ? : } {!!pre && pre} {!!children && {children}} - {!!isHomepage && isHomepage.isExact &&