From 7bce9558734267846fc634432f957e728687aa5e Mon Sep 17 00:00:00 2001 From: Andre Pedroza Date: Sat, 9 Dec 2023 12:05:31 -0300 Subject: [PATCH] Remove Modules and Navigations from Non Administrators Home Page --- .../src/pages/ApplicationV2/HomeLayout.tsx | 4 ++++ .../openblocks/src/pages/ApplicationV2/index.tsx | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/client/packages/openblocks/src/pages/ApplicationV2/HomeLayout.tsx b/client/packages/openblocks/src/pages/ApplicationV2/HomeLayout.tsx index d902d0da..c0953934 100644 --- a/client/packages/openblocks/src/pages/ApplicationV2/HomeLayout.tsx +++ b/client/packages/openblocks/src/pages/ApplicationV2/HomeLayout.tsx @@ -281,6 +281,10 @@ export function HomeLayout(props: HomeLayoutProps) { return HomeResTypeEnum[filterBy].valueOf() === e.applicationType; } }) + .filter((e) => { + if (user.orgDev) { return true} + return e.folder || e.applicationType === 1 + }) .map((e) => e.folder ? { diff --git a/client/packages/openblocks/src/pages/ApplicationV2/index.tsx b/client/packages/openblocks/src/pages/ApplicationV2/index.tsx index fe28398d..a86b0b35 100644 --- a/client/packages/openblocks/src/pages/ApplicationV2/index.tsx +++ b/client/packages/openblocks/src/pages/ApplicationV2/index.tsx @@ -98,7 +98,7 @@ const FolderNameWrapper = styled.div<{ selected: boolean }>` } `; -const FolderName = (props: { id: string; name: string }) => { +const FolderName = (props: { id: string; name: string, orgDev?: boolean }) => { const dispatch = useDispatch(); const [folderNameEditing, setFolderNameEditing] = useState(false); @@ -116,9 +116,11 @@ const FolderName = (props: { id: string; name: string }) => { setFolderNameEditing(false); }} /> - setFolderNameEditing(true) }]}> - - + {props.orgDev ? ( + setFolderNameEditing(true) }]}> + + + ): null} ); }; @@ -263,7 +265,7 @@ export default function ApplicationHome() { onSelected: (_, currentPath) => currentPath === path, text: (props: { selected: boolean }) => ( - + ), routePath: FOLDER_URL,