Skip to content

Commit

Permalink
[front] fix: parent usage in tree (#7759)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier authored Sep 30, 2024
1 parent 8b9b80e commit 217faab
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions front/components/DataSourceViewPermissionTree.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type {
ConnectorPermission,
ContentNodesViewType,
DataSourceViewType,
LightWorkspaceType,
Expand Down Expand Up @@ -32,37 +31,41 @@ const getUseResourceHook =

interface DataSourceViewPermissionTreeProps {
dataSourceView: DataSourceViewType;
onDocumentViewClick: (documentId: string) => void;
isSearchEnabled?: boolean;
isRoundedBackground?: boolean;
isSearchEnabled?: boolean;
onDocumentViewClick: (documentId: string) => void;
owner: LightWorkspaceType;
parentId?: string | null;
permissionFilter?: ConnectorPermission;
showExpand?: boolean;
viewType: ContentNodesViewType;
selectedNodes?: Record<string, ContentNodeTreeItemStatus>;
setSelectedNodes?: (
updater: (
prev: Record<string, ContentNodeTreeItemStatus>
) => Record<string, ContentNodeTreeItemStatus>
) => void;
showExpand?: boolean;
viewType: ContentNodesViewType;
}

export function DataSourceViewPermissionTree({
dataSourceView,
isSearchEnabled,
isRoundedBackground,
owner,
isSearchEnabled,
onDocumentViewClick,
showExpand,
viewType,
owner,
parentId,
selectedNodes,
setSelectedNodes,
showExpand,
viewType,
}: DataSourceViewPermissionTreeProps) {
const useResourcesHook = useCallback(
(parentId: string | null) =>
getUseResourceHook(owner, dataSourceView, viewType)(parentId),
[owner, dataSourceView, viewType]
(selectedParentId: string | null) =>
getUseResourceHook(
owner,
dataSourceView,
viewType
)(selectedParentId || parentId || null),
[owner, dataSourceView, viewType, parentId]
);

return (
Expand Down

0 comments on commit 217faab

Please sign in to comment.