From 43dea52c88f076318e5d709d777805a0e79411ea Mon Sep 17 00:00:00 2001 From: FalkWolsky Date: Sat, 21 Sep 2024 16:35:19 +0200 Subject: [PATCH] Fixing Folders View in Admin Area --- .../src/pages/ApplicationV2/HomeLayout.tsx | 3 ++- .../pages/ApplicationV2/RootFolderListView.tsx | 2 ++ .../lowcoder/src/pages/ApplicationV2/index.tsx | 18 +++++++++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx b/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx index b65e78483..fd5c2df16 100644 --- a/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx +++ b/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx @@ -305,9 +305,10 @@ export interface HomeLayoutProps { export function HomeLayout(props: HomeLayoutProps) { - const { breadcrumb = [], elements = [], localMarketplaceApps = [], globalMarketplaceApps = [], mode } = props; + console.log("HomeLayout props: ", props); + const categoryOptions = [ { label: {trans("home.allCategories")}, value: 'All' }, ...Object.entries(ApplicationCategoriesEnum).map(([key, value]) => ({ diff --git a/client/packages/lowcoder/src/pages/ApplicationV2/RootFolderListView.tsx b/client/packages/lowcoder/src/pages/ApplicationV2/RootFolderListView.tsx index a2263017c..0cde49106 100644 --- a/client/packages/lowcoder/src/pages/ApplicationV2/RootFolderListView.tsx +++ b/client/packages/lowcoder/src/pages/ApplicationV2/RootFolderListView.tsx @@ -9,6 +9,8 @@ export function RootFolderListView() { const user = useSelector(getUser); const allFolders = useSelector(foldersSelector); + console.log("RootFolderListView", allFolders); + if (!user.currentOrgId) { return null; } diff --git a/client/packages/lowcoder/src/pages/ApplicationV2/index.tsx b/client/packages/lowcoder/src/pages/ApplicationV2/index.tsx index 4970355c3..26853306e 100644 --- a/client/packages/lowcoder/src/pages/ApplicationV2/index.tsx +++ b/client/packages/lowcoder/src/pages/ApplicationV2/index.tsx @@ -2,8 +2,8 @@ import { USER_PROFILE_URL, ALL_APPLICATIONS_URL, DATASOURCE_URL, - // FOLDER_URL, - // FOLDER_URL_PREFIX, + FOLDER_URL, + FOLDER_URL_PREFIX, FOLDERS_URL, MARKETPLACE_URL, // MODULE_APPLICATIONS_URL, @@ -50,7 +50,7 @@ import { NewsView } from "./NewsView"; import { OrgView } from "./OrgView"; import styled, { css } from "styled-components"; // import history from "../../util/history"; -// import { FolderView } from "./FolderView"; +import { FolderView } from "./FolderView"; import { TrashView } from "./TrashView"; import { MarketplaceView } from "./MarketplaceView"; // import { SideBarItemType } from "../../components/layout/SideBarSection"; @@ -334,6 +334,18 @@ export default function ApplicationHome() { ], }, + // this we need to show the Folders view in the Admin Area + { + items: [ + { + text: "", + routePath: FOLDER_URL, + routeComp: FolderView, + visible: () => false, + } + ] + } + ]} />