Skip to content

Commit

Permalink
Remove Modules and Navigations from Non Administrators Home Page
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrozadotdev committed Dec 9, 2023
1 parent 9800978 commit 7bce955
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
? {
Expand Down
12 changes: 7 additions & 5 deletions client/packages/openblocks/src/pages/ApplicationV2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -116,9 +116,11 @@ const FolderName = (props: { id: string; name: string }) => {
setFolderNameEditing(false);
}}
/>
<EditPopover items={[{ text: trans("rename"), onClick: () => setFolderNameEditing(true) }]}>
<PopoverIcon tabIndex={-1} />
</EditPopover>
{props.orgDev ? (
<EditPopover items={[{ text: trans("rename"), onClick: () => setFolderNameEditing(true) }]}>
<PopoverIcon tabIndex={-1} />
</EditPopover>
): null}
</>
);
};
Expand Down Expand Up @@ -263,7 +265,7 @@ export default function ApplicationHome() {
onSelected: (_, currentPath) => currentPath === path,
text: (props: { selected: boolean }) => (
<FolderNameWrapper selected={props.selected}>
<FolderName name={folder.name} id={folder.folderId} />
<FolderName name={folder.name} id={folder.folderId} orgDev={user.orgDev} />
</FolderNameWrapper>
),
routePath: FOLDER_URL,
Expand Down

0 comments on commit 7bce955

Please sign in to comment.