Skip to content

Commit

Permalink
thread event
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Sep 14, 2023
1 parent 6e1f6e5 commit 32d2f5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ const AssetGraphExplorerWithData: React.FC<WithDataProps> = ({
assetGraphData={assetGraphData}
lastSelectedNode={lastSelectedNode}
selectNode={React.useCallback(
(nodeId) => {
selectNodeById({stopPropagation: () => {}} as any, nodeId);
(e, nodeId) => {
selectNodeById(e, nodeId);
},
[selectNodeById],
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const AssetGraphExplorerSidebar = React.memo(
}: {
assetGraphData: GraphData;
lastSelectedNode: GraphNode;
selectNode: (nodeId: string) => void;
selectNode: (e: React.MouseEvent<any> | React.KeyboardEvent<any>, nodeId: string) => void;
}) => {
const [openNodes, setOpenNodes] = React.useState<Set<string>>(new Set());
const [selectedNode, setSelectedNode] = React.useState<null | {id: string; path: string}>(null);
Expand Down Expand Up @@ -172,11 +172,11 @@ export const AssetGraphExplorerSidebar = React.memo(
return openNodes;
});
}}
selectNode={(id) => {
selectNode(id);
selectNode={(e, id) => {
selectNode(e, id);
}}
selectThisNode={() => {
selectNode(node.id);
selectThisNode={(e) => {
selectNode(e, node.id);
setSelectedNode(node);
}}
/>
Expand Down Expand Up @@ -206,8 +206,8 @@ const Node = ({
node: GraphNode;
level: number;
toggleOpen: () => void;
selectThisNode: () => void;
selectNode: (nodeId: string) => void;
selectThisNode: (e: React.MouseEvent<any> | React.KeyboardEvent<any>) => void;
selectNode: (e: React.MouseEvent<any> | React.KeyboardEvent<any>, nodeId: string) => void;
isOpen: boolean;
isSelected: boolean;
}) => {
Expand Down Expand Up @@ -336,7 +336,7 @@ const UpstreamDownstreamDialog = ({
assetGraphData: GraphData;
isOpen: boolean;
close: () => void;
selectNode: (nodeId: string) => void;
selectNode: (e: React.MouseEvent<any> | React.KeyboardEvent<any>, nodeId: string) => void;
}) => {
return (
<Dialog isOpen={isOpen} onClose={close} title={title}>
Expand All @@ -351,8 +351,8 @@ const UpstreamDownstreamDialog = ({
<MenuItem
text={asset.assetKey.path[asset.assetKey.path.length - 1]}
key={asset.id}
onClick={() => {
selectNode(asset.id);
onClick={(e) => {
selectNode(e, asset.id);
close();
}}
/>
Expand Down Expand Up @@ -394,7 +394,7 @@ const SearchFilter = <T,>({
onSelectValue,
}: {
values: {label: string; value: T}[];
onSelectValue: (value: T) => void;
onSelectValue: (e: React.MouseEvent<any>, value: T) => void;
}) => {
const [searchValue, setSearchValue] = React.useState('');
const filteredValues = React.useMemo(() => {
Expand Down Expand Up @@ -424,8 +424,8 @@ const SearchFilter = <T,>({
filteredValues.map((value) => (
<MenuItem
key={value.label}
onClick={() => {
onSelectValue(value.value);
onClick={(e) => {
onSelectValue(e, value.value);
setSearchValue('');
}}
text={value.label}
Expand Down

0 comments on commit 32d2f5b

Please sign in to comment.