From 58853e9756f0ef975e2f6de588ed239d590e6e2a Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Thu, 20 Feb 2025 17:39:59 +0530 Subject: [PATCH 1/5] creating a common file for static layout styled components --- .../src/IDE/Components/LayoutComponents.tsx | 12 ++++++++++++ app/client/src/pages/AppIDE/AppIDE.tsx | 2 +- .../{layout => layouts}/AnimatedLayout.tsx | 0 .../AppIDE/{layout => layouts}/StaticLayout.tsx | 16 ++++------------ .../{layout => layouts}/components/Editor.tsx | 0 .../components/EditorPane.tsx | 0 .../components/EditorTabs/AddTab.tsx | 0 .../components/EditorTabs/EditableTab.tsx | 0 .../components/EditorTabs/Editortabs.test.tsx | 0 .../components/EditorTabs/List.tsx | 0 .../components/EditorTabs/ScreenModeToggle.tsx | 0 .../components/EditorTabs/constants.ts | 0 .../components/EditorTabs/hooks.ts | 0 .../components/EditorTabs/index.tsx | 0 .../{layout => layouts}/components/Explorer.tsx | 0 .../components/Header/DeployButton.tsx | 0 .../components/Header/EditorTitle.tsx | 0 .../components/Header/index.tsx | 0 .../SegmentSwitcher/SegmentSwitcher.tsx | 0 .../SegmentSwitcher/useSegmentNavigation.ts | 0 .../AppIDE/{layout => layouts}/constants.ts | 0 .../hooks/useEditorStateLeftPaneWidth.ts | 0 .../hooks/useGridLayoutTemplate.ts | 0 .../hooks/useWidgetSelectionBlockListener.ts | 0 .../pages/AppIDE/{layout => layouts}/index.tsx | 0 .../routers/JSEditor/JSEditor.tsx | 0 .../routers/JSEditor/JSRender.test.tsx | 0 .../routers/JSEditor/index.ts | 0 .../{layout => layouts}/routers/LeftPane.tsx | 0 .../routers/MainPane/MainPane.tsx | 0 .../routers/MainPane/index.ts | 0 .../routers/QueryEditor/Editor.tsx | 0 .../routers/QueryEditor/QueryRender.test.tsx | 0 .../routers/QueryEditor/index.ts | 0 .../{layout => layouts}/routers/RightPane.tsx | 0 .../{layout => layouts}/routers/Sidebar.tsx | 0 .../routers/UISegmentLeftPane/UIRender.test.tsx | 0 .../UISegmentLeftPane/UISegmentLeftPane.tsx | 0 38 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 app/client/src/IDE/Components/LayoutComponents.tsx rename app/client/src/pages/AppIDE/{layout => layouts}/AnimatedLayout.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/StaticLayout.tsx (89%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/Editor.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorPane.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/AddTab.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/EditableTab.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/Editortabs.test.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/List.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/ScreenModeToggle.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/constants.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/hooks.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/EditorTabs/index.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/Explorer.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/Header/DeployButton.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/Header/EditorTitle.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/Header/index.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/SegmentSwitcher/SegmentSwitcher.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/components/SegmentSwitcher/useSegmentNavigation.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/constants.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/hooks/useEditorStateLeftPaneWidth.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/hooks/useGridLayoutTemplate.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/hooks/useWidgetSelectionBlockListener.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/index.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/JSEditor/JSEditor.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/JSEditor/JSRender.test.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/JSEditor/index.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/LeftPane.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/MainPane/MainPane.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/MainPane/index.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/QueryEditor/Editor.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/QueryEditor/QueryRender.test.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/QueryEditor/index.ts (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/RightPane.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/Sidebar.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/UISegmentLeftPane/UIRender.test.tsx (100%) rename app/client/src/pages/AppIDE/{layout => layouts}/routers/UISegmentLeftPane/UISegmentLeftPane.tsx (100%) diff --git a/app/client/src/IDE/Components/LayoutComponents.tsx b/app/client/src/IDE/Components/LayoutComponents.tsx new file mode 100644 index 000000000000..61076cdf47ee --- /dev/null +++ b/app/client/src/IDE/Components/LayoutComponents.tsx @@ -0,0 +1,12 @@ +import styled from "styled-components"; + +export const GridContainer = styled.div` + display: grid; + width: 100vw; + height: 100%; +`; + +export const LayoutContainer = styled.div<{ name: string }>` + position: relative; + grid-area: ${(props) => props.name}; +`; diff --git a/app/client/src/pages/AppIDE/AppIDE.tsx b/app/client/src/pages/AppIDE/AppIDE.tsx index 480184aa45f0..6dd21b0cb0f5 100644 --- a/app/client/src/pages/AppIDE/AppIDE.tsx +++ b/app/client/src/pages/AppIDE/AppIDE.tsx @@ -5,7 +5,7 @@ import type { RouteComponentProps } from "react-router-dom"; import { withRouter } from "react-router-dom"; import type { BuilderRouteParams } from "constants/routes"; import type { AppState } from "ee/reducers"; -import IDE from "./layout"; +import IDE from "./layouts"; import { getCurrentApplicationId, getIsEditorInitialized, diff --git a/app/client/src/pages/AppIDE/layout/AnimatedLayout.tsx b/app/client/src/pages/AppIDE/layouts/AnimatedLayout.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/AnimatedLayout.tsx rename to app/client/src/pages/AppIDE/layouts/AnimatedLayout.tsx diff --git a/app/client/src/pages/AppIDE/layout/StaticLayout.tsx b/app/client/src/pages/AppIDE/layouts/StaticLayout.tsx similarity index 89% rename from app/client/src/pages/AppIDE/layout/StaticLayout.tsx rename to app/client/src/pages/AppIDE/layouts/StaticLayout.tsx index 38dfb21e9db6..b30d56595853 100644 --- a/app/client/src/pages/AppIDE/layout/StaticLayout.tsx +++ b/app/client/src/pages/AppIDE/layouts/StaticLayout.tsx @@ -1,5 +1,4 @@ import React from "react"; -import styled from "styled-components"; import { useGitModEnabled, @@ -16,6 +15,10 @@ import RightPane from "./routers/RightPane"; import { ProtectedCallout } from "../components/ProtectedCallout"; import { useGridLayoutTemplate } from "./hooks/useGridLayoutTemplate"; import { Areas } from "./constants"; +import { + GridContainer, + LayoutContainer, +} from "IDE/Components/LayoutComponents"; function GitProtectedBranchCallout() { const isGitModEnabled = useGitModEnabled(); @@ -32,17 +35,6 @@ function GitProtectedBranchCallout() { return null; } -const GridContainer = styled.div` - display: grid; - width: 100vw; - height: 100%; -`; - -const LayoutContainer = styled.div<{ name: string }>` - position: relative; - grid-area: ${(props) => props.name}; -`; - export const StaticLayout = React.memo(() => { const { areas, columns } = useGridLayoutTemplate(); diff --git a/app/client/src/pages/AppIDE/layout/components/Editor.tsx b/app/client/src/pages/AppIDE/layouts/components/Editor.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/Editor.tsx rename to app/client/src/pages/AppIDE/layouts/components/Editor.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/EditorPane.tsx b/app/client/src/pages/AppIDE/layouts/components/EditorPane.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorPane.tsx rename to app/client/src/pages/AppIDE/layouts/components/EditorPane.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/AddTab.tsx b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/AddTab.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/AddTab.tsx rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/AddTab.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/EditableTab.tsx b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/EditableTab.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/EditableTab.tsx rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/EditableTab.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/Editortabs.test.tsx b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/Editortabs.test.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/Editortabs.test.tsx rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/Editortabs.test.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/List.tsx b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/List.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/List.tsx rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/List.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/ScreenModeToggle.tsx b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/ScreenModeToggle.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/ScreenModeToggle.tsx rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/ScreenModeToggle.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/constants.ts b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/constants.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/constants.ts rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/constants.ts diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/hooks.ts b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/hooks.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/hooks.ts rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/hooks.ts diff --git a/app/client/src/pages/AppIDE/layout/components/EditorTabs/index.tsx b/app/client/src/pages/AppIDE/layouts/components/EditorTabs/index.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/EditorTabs/index.tsx rename to app/client/src/pages/AppIDE/layouts/components/EditorTabs/index.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/Explorer.tsx b/app/client/src/pages/AppIDE/layouts/components/Explorer.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/Explorer.tsx rename to app/client/src/pages/AppIDE/layouts/components/Explorer.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/Header/DeployButton.tsx b/app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/Header/DeployButton.tsx rename to app/client/src/pages/AppIDE/layouts/components/Header/DeployButton.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/Header/EditorTitle.tsx b/app/client/src/pages/AppIDE/layouts/components/Header/EditorTitle.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/Header/EditorTitle.tsx rename to app/client/src/pages/AppIDE/layouts/components/Header/EditorTitle.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/Header/index.tsx b/app/client/src/pages/AppIDE/layouts/components/Header/index.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/Header/index.tsx rename to app/client/src/pages/AppIDE/layouts/components/Header/index.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/SegmentSwitcher/SegmentSwitcher.tsx b/app/client/src/pages/AppIDE/layouts/components/SegmentSwitcher/SegmentSwitcher.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/SegmentSwitcher/SegmentSwitcher.tsx rename to app/client/src/pages/AppIDE/layouts/components/SegmentSwitcher/SegmentSwitcher.tsx diff --git a/app/client/src/pages/AppIDE/layout/components/SegmentSwitcher/useSegmentNavigation.ts b/app/client/src/pages/AppIDE/layouts/components/SegmentSwitcher/useSegmentNavigation.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/components/SegmentSwitcher/useSegmentNavigation.ts rename to app/client/src/pages/AppIDE/layouts/components/SegmentSwitcher/useSegmentNavigation.ts diff --git a/app/client/src/pages/AppIDE/layout/constants.ts b/app/client/src/pages/AppIDE/layouts/constants.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/constants.ts rename to app/client/src/pages/AppIDE/layouts/constants.ts diff --git a/app/client/src/pages/AppIDE/layout/hooks/useEditorStateLeftPaneWidth.ts b/app/client/src/pages/AppIDE/layouts/hooks/useEditorStateLeftPaneWidth.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/hooks/useEditorStateLeftPaneWidth.ts rename to app/client/src/pages/AppIDE/layouts/hooks/useEditorStateLeftPaneWidth.ts diff --git a/app/client/src/pages/AppIDE/layout/hooks/useGridLayoutTemplate.ts b/app/client/src/pages/AppIDE/layouts/hooks/useGridLayoutTemplate.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/hooks/useGridLayoutTemplate.ts rename to app/client/src/pages/AppIDE/layouts/hooks/useGridLayoutTemplate.ts diff --git a/app/client/src/pages/AppIDE/layout/hooks/useWidgetSelectionBlockListener.ts b/app/client/src/pages/AppIDE/layouts/hooks/useWidgetSelectionBlockListener.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/hooks/useWidgetSelectionBlockListener.ts rename to app/client/src/pages/AppIDE/layouts/hooks/useWidgetSelectionBlockListener.ts diff --git a/app/client/src/pages/AppIDE/layout/index.tsx b/app/client/src/pages/AppIDE/layouts/index.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/index.tsx rename to app/client/src/pages/AppIDE/layouts/index.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/JSEditor/JSEditor.tsx b/app/client/src/pages/AppIDE/layouts/routers/JSEditor/JSEditor.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/JSEditor/JSEditor.tsx rename to app/client/src/pages/AppIDE/layouts/routers/JSEditor/JSEditor.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/JSEditor/JSRender.test.tsx b/app/client/src/pages/AppIDE/layouts/routers/JSEditor/JSRender.test.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/JSEditor/JSRender.test.tsx rename to app/client/src/pages/AppIDE/layouts/routers/JSEditor/JSRender.test.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/JSEditor/index.ts b/app/client/src/pages/AppIDE/layouts/routers/JSEditor/index.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/JSEditor/index.ts rename to app/client/src/pages/AppIDE/layouts/routers/JSEditor/index.ts diff --git a/app/client/src/pages/AppIDE/layout/routers/LeftPane.tsx b/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/LeftPane.tsx rename to app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/MainPane/MainPane.tsx b/app/client/src/pages/AppIDE/layouts/routers/MainPane/MainPane.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/MainPane/MainPane.tsx rename to app/client/src/pages/AppIDE/layouts/routers/MainPane/MainPane.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/MainPane/index.ts b/app/client/src/pages/AppIDE/layouts/routers/MainPane/index.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/MainPane/index.ts rename to app/client/src/pages/AppIDE/layouts/routers/MainPane/index.ts diff --git a/app/client/src/pages/AppIDE/layout/routers/QueryEditor/Editor.tsx b/app/client/src/pages/AppIDE/layouts/routers/QueryEditor/Editor.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/QueryEditor/Editor.tsx rename to app/client/src/pages/AppIDE/layouts/routers/QueryEditor/Editor.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/QueryEditor/QueryRender.test.tsx b/app/client/src/pages/AppIDE/layouts/routers/QueryEditor/QueryRender.test.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/QueryEditor/QueryRender.test.tsx rename to app/client/src/pages/AppIDE/layouts/routers/QueryEditor/QueryRender.test.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/QueryEditor/index.ts b/app/client/src/pages/AppIDE/layouts/routers/QueryEditor/index.ts similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/QueryEditor/index.ts rename to app/client/src/pages/AppIDE/layouts/routers/QueryEditor/index.ts diff --git a/app/client/src/pages/AppIDE/layout/routers/RightPane.tsx b/app/client/src/pages/AppIDE/layouts/routers/RightPane.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/RightPane.tsx rename to app/client/src/pages/AppIDE/layouts/routers/RightPane.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/Sidebar.tsx b/app/client/src/pages/AppIDE/layouts/routers/Sidebar.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/Sidebar.tsx rename to app/client/src/pages/AppIDE/layouts/routers/Sidebar.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/UISegmentLeftPane/UIRender.test.tsx b/app/client/src/pages/AppIDE/layouts/routers/UISegmentLeftPane/UIRender.test.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/UISegmentLeftPane/UIRender.test.tsx rename to app/client/src/pages/AppIDE/layouts/routers/UISegmentLeftPane/UIRender.test.tsx diff --git a/app/client/src/pages/AppIDE/layout/routers/UISegmentLeftPane/UISegmentLeftPane.tsx b/app/client/src/pages/AppIDE/layouts/routers/UISegmentLeftPane/UISegmentLeftPane.tsx similarity index 100% rename from app/client/src/pages/AppIDE/layout/routers/UISegmentLeftPane/UISegmentLeftPane.tsx rename to app/client/src/pages/AppIDE/layouts/routers/UISegmentLeftPane/UISegmentLeftPane.tsx From 45392d2bc3850ecdbcda7b52e7238bca0298dbc3 Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Thu, 20 Feb 2025 17:43:23 +0530 Subject: [PATCH 2/5] showing add button for libraries via props --- .../AppIDE/components/LibrariesList/LibrarySidePane.tsx | 6 ++++-- .../components/LibrariesList/JSLibrariesSection.tsx | 8 ++++++-- app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx | 4 +++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx b/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx index 720035cecc11..19787672c9c3 100644 --- a/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx +++ b/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx @@ -2,10 +2,12 @@ import React from "react"; import JSLibrariesSection from "pages/AppIDE/components/LibrariesList/JSLibrariesSection"; import { IDESidePaneWrapper } from "IDE"; -const LibrarySidePane = () => { +const LibrarySidePane = (props: { showAddButton: boolean }) => { + const { showAddButton } = props; + return ( - + ); }; diff --git a/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx b/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx index 4c89d1f2c48f..67500b0c50b6 100644 --- a/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx +++ b/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx @@ -7,7 +7,8 @@ import { useSelector } from "react-redux"; import { animated, useTransition } from "react-spring"; import { LibraryEntity } from "pages/Editor/Explorer/Libraries"; -function JSLibrariesSection() { +function JSLibrariesSection(props: { showAddButton: boolean }) { + const { showAddButton } = props; const libraries = useSelector(selectLibrariesForExplorer); const transitions = useTransition(libraries, { keys: (lib) => lib.name, @@ -16,7 +17,10 @@ function JSLibrariesSection() { leave: { opacity: 1 }, }); - const rightIcon = useMemo(() => , []); + const rightIcon = useMemo( + () => (showAddButton ? : null), + [], + ); return ( <> diff --git a/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx b/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx index 59ef226148cd..033affcb9a1c 100644 --- a/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx +++ b/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx @@ -60,9 +60,11 @@ const LeftPane = () => { )} /> ( + + )} /> Date: Thu, 20 Feb 2025 18:24:29 +0530 Subject: [PATCH 3/5] fixing client build --- app/client/src/ce/pages/common/AppHeader.tsx | 2 +- .../AppIDE/components/LibrariesList/JSLibrariesSection.tsx | 2 +- .../src/pages/Editor/GlobalHotKeys/GlobalHotKeys.test.tsx | 2 +- app/client/test/testMockedWidgets.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/client/src/ce/pages/common/AppHeader.tsx b/app/client/src/ce/pages/common/AppHeader.tsx index c2b601048dfa..c85696568649 100644 --- a/app/client/src/ce/pages/common/AppHeader.tsx +++ b/app/client/src/ce/pages/common/AppHeader.tsx @@ -19,7 +19,7 @@ import { } from "constants/routes"; import Navigation from "pages/AppViewer/Navigation"; import type { RouteComponentProps } from "react-router"; -import { Header as AppIDEHeader } from "pages/AppIDE/layout/components/Header"; +import { Header as AppIDEHeader } from "pages/AppIDE/layouts/components/Header"; export type Props = RouteComponentProps; diff --git a/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx b/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx index 67500b0c50b6..28408a84ec38 100644 --- a/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx +++ b/app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx @@ -19,7 +19,7 @@ function JSLibrariesSection(props: { showAddButton: boolean }) { const rightIcon = useMemo( () => (showAddButton ? : null), - [], + [showAddButton], ); return ( diff --git a/app/client/src/pages/Editor/GlobalHotKeys/GlobalHotKeys.test.tsx b/app/client/src/pages/Editor/GlobalHotKeys/GlobalHotKeys.test.tsx index 9e1cb01eb581..e199eefdeed9 100644 --- a/app/client/src/pages/Editor/GlobalHotKeys/GlobalHotKeys.test.tsx +++ b/app/client/src/pages/Editor/GlobalHotKeys/GlobalHotKeys.test.tsx @@ -28,7 +28,7 @@ import { import { MockCanvas } from "test/testMockedWidgets"; import { act, fireEvent, render, waitFor } from "test/testUtils"; import * as widgetRenderUtils from "utils/widgetRenderUtils"; -import IDE from "pages/AppIDE/layout"; +import IDE from "pages/AppIDE/layouts"; import GlobalHotKeys from "./GlobalHotKeys"; import * as widgetSelectionsActions from "actions/widgetSelectionActions"; import { SelectionRequestType } from "sagas/WidgetSelectUtils"; diff --git a/app/client/test/testMockedWidgets.tsx b/app/client/test/testMockedWidgets.tsx index 26f3a88cb84f..1314cb303169 100644 --- a/app/client/test/testMockedWidgets.tsx +++ b/app/client/test/testMockedWidgets.tsx @@ -1,7 +1,7 @@ import { APP_MODE } from "entities/App"; import AppViewerPageContainer from "pages/AppViewer/AppViewerPageContainer"; import Canvas from "pages/Editor/Canvas"; -import IDE from "pages/AppIDE/layout"; +import IDE from "pages/AppIDE/layouts"; import React from "react"; import { useSelector } from "react-redux"; import { getCanvasWidgetsStructure } from "ee/selectors/entitiesSelector"; From 61dbfd5ed15ce82058263caaa57e9731e6723464 Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Thu, 20 Feb 2025 18:31:45 +0530 Subject: [PATCH 4/5] minor change --- .../pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx | 4 ++-- app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx b/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx index 19787672c9c3..6a6eb00b1797 100644 --- a/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx +++ b/app/client/src/ce/pages/AppIDE/components/LibrariesList/LibrarySidePane.tsx @@ -2,8 +2,8 @@ import React from "react"; import JSLibrariesSection from "pages/AppIDE/components/LibrariesList/JSLibrariesSection"; import { IDESidePaneWrapper } from "IDE"; -const LibrarySidePane = (props: { showAddButton: boolean }) => { - const { showAddButton } = props; +const LibrarySidePane = (props: { showAddButton?: boolean }) => { + const { showAddButton = true } = props; return ( diff --git a/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx b/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx index 033affcb9a1c..59ef226148cd 100644 --- a/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx +++ b/app/client/src/pages/AppIDE/layouts/routers/LeftPane.tsx @@ -60,11 +60,9 @@ const LeftPane = () => { )} /> ( - - )} /> Date: Thu, 20 Feb 2025 18:45:24 +0530 Subject: [PATCH 5/5] fixing unit tests --- .../components/ProtectedCallout/ProtectedCallout.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/client/src/pages/AppIDE/components/ProtectedCallout/ProtectedCallout.test.tsx b/app/client/src/pages/AppIDE/components/ProtectedCallout/ProtectedCallout.test.tsx index 1cd6d891a2d6..2c94eb84507c 100644 --- a/app/client/src/pages/AppIDE/components/ProtectedCallout/ProtectedCallout.test.tsx +++ b/app/client/src/pages/AppIDE/components/ProtectedCallout/ProtectedCallout.test.tsx @@ -41,10 +41,10 @@ const getMockStore = (override: Record = {}): any => { }); }; -jest.mock("../../layout/routers/MainPane/MainPane.tsx", () => () =>
); -jest.mock("../../layout/routers/LeftPane", () => () =>
); -jest.mock("../../layout/routers/RightPane", () => () =>
); -jest.mock("../../layout/routers/Sidebar", () => () =>
); +jest.mock("../../layouts/routers/MainPane/MainPane.tsx", () => () =>
); +jest.mock("../../layouts/routers/LeftPane", () => () =>
); +jest.mock("../../layouts/routers/RightPane", () => () =>
); +jest.mock("../../layouts/routers/Sidebar", () => () =>
); jest.mock("../../../../components/BottomBar", () => () =>
); const dispatch = jest.fn();