From 4def08d93f2f16ced940e2c07b713f9025fb7429 Mon Sep 17 00:00:00 2001 From: Maciej Bodek Date: Thu, 5 Oct 2023 12:43:20 +0200 Subject: [PATCH] Revert "Create table - make it a side modal" This reverts commit da4e9a3c261c5a99aa3935e636d854050f88df88. --- .../src/components/TableSchemaDialog/dialog.tsx | 12 ------------ packages/web-console/src/scenes/Layout/index.tsx | 10 ++++------ packages/web-console/src/store/Console/types.ts | 2 +- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/packages/web-console/src/components/TableSchemaDialog/dialog.tsx b/packages/web-console/src/components/TableSchemaDialog/dialog.tsx index 94ca5206a..beb62fa02 100644 --- a/packages/web-console/src/components/TableSchemaDialog/dialog.tsx +++ b/packages/web-console/src/components/TableSchemaDialog/dialog.tsx @@ -14,8 +14,6 @@ import { Action, SchemaColumn, SchemaFormValues } from "./types" import Joi from "joi" import { isValidTableName } from "./isValidTableName" import * as QuestDB from "../../utils/questdb" -import { useDispatch } from "react-redux" -import { actions } from "../../store" const StyledTableIcon = styled(TableIcon)` color: ${({ theme }) => theme.color.foreground}; @@ -79,8 +77,6 @@ export const Dialog = ({ tables, ctaText, }: Props) => { - const dispatch = useDispatch() - const formDefaults = { name, schemaColumns: schema, @@ -163,7 +159,6 @@ export const Dialog = ({ return ( @@ -188,13 +183,6 @@ export const Dialog = ({ ) } - onOpenChange={(isOpen) => { - if (isOpen && action === "add") { - dispatch( - actions.console.setActivePanel(isOpen ? "create" : "console"), - ) - } - }} onDismiss={() => { resetToDefaults() onOpenChange(undefined) diff --git a/packages/web-console/src/scenes/Layout/index.tsx b/packages/web-console/src/scenes/Layout/index.tsx index 95e2f90b9..2d4e9a542 100644 --- a/packages/web-console/src/scenes/Layout/index.tsx +++ b/packages/web-console/src/scenes/Layout/index.tsx @@ -71,18 +71,16 @@ const Layout = () => { window.bus.trigger(BusEvent.REACT_READY) }, []) - const isSideOpened = () => { - return ["create", "news"].includes(activePanel) - } - return ( -
+
diff --git a/packages/web-console/src/store/Console/types.ts b/packages/web-console/src/store/Console/types.ts index 44c0ae671..9527e2d63 100644 --- a/packages/web-console/src/store/Console/types.ts +++ b/packages/web-console/src/store/Console/types.ts @@ -33,7 +33,7 @@ export type QueryGroup = { queries: Query[] } -export type Panel = "console" | "settings" | "news" | "import" | "create" +export type Panel = "console" | "settings" | "news" | "import" export type ConsoleConfigShape = Readonly<{ githubBanner: boolean