From 038d312fa2b2b51e34bf3c681e14887c4eface36 Mon Sep 17 00:00:00 2001 From: tristandubbeld Date: Tue, 11 Nov 2025 15:26:13 +0100 Subject: [PATCH] fix: access throughout dashboard --- .../pages/Dashboard/Components/Folder/FolderCard.tsx | 4 ++-- .../app/pages/Dashboard/Components/Folder/index.tsx | 10 +++++----- .../app/pages/Dashboard/Components/Header/index.tsx | 4 ++-- .../Components/Selection/ContextMenus/FolderMenu.tsx | 4 ++-- .../pages/Dashboard/Content/routes/Sandboxes/index.tsx | 4 ++-- .../src/app/pages/Dashboard/Sidebar/ContextMenu.tsx | 4 ++-- packages/app/src/app/pages/Dashboard/Sidebar/index.tsx | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/app/src/app/pages/Dashboard/Components/Folder/FolderCard.tsx b/packages/app/src/app/pages/Dashboard/Components/Folder/FolderCard.tsx index ccd1f2dc438..9f38c2ca1c9 100644 --- a/packages/app/src/app/pages/Dashboard/Components/Folder/FolderCard.tsx +++ b/packages/app/src/app/pages/Dashboard/Components/Folder/FolderCard.tsx @@ -37,7 +37,7 @@ export const FolderCard: React.FC = ({ 'data-selection-id': dataSelectionId, ...props }) => { - const { isTeamEditor } = useWorkspaceAuthorization(); + const { hasEditorAccess } = useWorkspaceAuthorization(); return ( @@ -48,7 +48,7 @@ export const FolderCard: React.FC = ({ > - {!isNewFolder && isTeamEditor ? ( + {!isNewFolder && hasEditorAccess ? ( { const { dashboard: { renameFolder }, } = useActions(); - const { isTeamEditor } = useWorkspaceAuthorization(); + const { hasEditorAccess } = useWorkspaceAuthorization(); const { name = '', @@ -95,7 +95,7 @@ export const Folder = (folderItem: DashboardFolder) => { /* Drop target logic */ - const accepts = isTeamEditor ? ['sandbox'] : []; + const accepts = hasEditorAccess ? ['sandbox'] : []; const [{ isOver, canDrop }, dropRef] = useDrop({ accept: accepts, @@ -114,7 +114,7 @@ export const Folder = (folderItem: DashboardFolder) => { const [, dragRef, preview] = useDrag({ item: folderItem, - canDrag: isTeamEditor, + canDrag: hasEditorAccess, end: (item, monitor) => { const dropResult = monitor.getDropResult(); @@ -127,7 +127,7 @@ export const Folder = (folderItem: DashboardFolder) => { const dragProps = { ref: dragRef, - onDragStart: isTeamEditor ? (event => onDragStart(event, path, 'folder')) : undefined, + onDragStart: hasEditorAccess ? (event => onDragStart(event, path, 'folder')) : undefined, }; React.useEffect(() => { @@ -188,7 +188,7 @@ export const Folder = (folderItem: DashboardFolder) => { onClick, onDoubleClick, // edit mode - editing: isRenaming && selected && isTeamEditor, + editing: isRenaming && selected && hasEditorAccess, isNewFolder: false, isDragging, newName, diff --git a/packages/app/src/app/pages/Dashboard/Components/Header/index.tsx b/packages/app/src/app/pages/Dashboard/Components/Header/index.tsx index 03efb2ccd5d..d0e2e4870f1 100644 --- a/packages/app/src/app/pages/Dashboard/Components/Header/index.tsx +++ b/packages/app/src/app/pages/Dashboard/Components/Header/index.tsx @@ -36,7 +36,7 @@ export const Header = ({ const location = useLocation(); const { modalOpened, dashboard: dashboardActions } = useActions(); const { dashboard } = useAppState(); - const { isTeamEditor } = useWorkspaceAuthorization(); + const { hasEditorAccess } = useWorkspaceAuthorization(); const repositoriesListPage = location.pathname.includes('/repositories') && @@ -70,7 +70,7 @@ export const Header = ({ )} - {location.pathname.includes('/sandboxes') && isTeamEditor && ( + {location.pathname.includes('/sandboxes') && hasEditorAccess && (