diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 37c32c2654d..38142dd17f5 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -21,7 +21,7 @@ export { use3DModelName } from './hooks/use3DModelName'; export { useFdmAssetMappings } from './hooks/useFdmAssetMappings'; export { useClickedNodeData } from './hooks/useClickedNode'; export { useCameraNavigation } from './hooks/useCameraNavigation'; -export { useMappedEquipmentByRevisionList } from './hooks/useMappedEquipmentBy3DModelsList'; +export { useMappedEdgesForRevisions } from './components/NodeCacheProvider/NodeCacheProvider'; // Higher order components export { withSuppressRevealEvents } from './higher-order-components/withSuppressRevealEvents'; diff --git a/react-components/stories/CadStylingCache.stories.tsx b/react-components/stories/CadStylingCache.stories.tsx index d02bc171778..d8306d4b194 100644 --- a/react-components/stories/CadStylingCache.stories.tsx +++ b/react-components/stories/CadStylingCache.stories.tsx @@ -14,7 +14,7 @@ import { Color, Matrix4, Vector3 } from 'three'; import { createSdkByUrlToken } from './utilities/createSdkByUrlToken'; import { type CogniteCadModel, DefaultNodeAppearance } from '@cognite/reveal'; import { useEffect, useMemo, useState, type JSX } from 'react'; -import { useMappedEquipmentByRevisionList } from '../src/hooks/useMappedEquipmentBy3DModelsList'; +import { useMappedEdgesForRevisions } from '../src/components/NodeCacheProvider/NodeCacheProvider'; const meta = { title: 'Example/CadStylingCache', @@ -50,13 +50,13 @@ const Models = ({ addModelOptions }: CogniteCadModelProps): JSX.Element => { const [platformStyling, setPlatformStyling] = useState(); - const { data } = useMappedEquipmentByRevisionList([platformModelOptions]); + const { data } = useMappedEdgesForRevisions([platformModelOptions], true); const nodeIds = useMemo( () => data ?.get(`${platformModelOptions.modelId}-${platformModelOptions.revisionId}`) - ?.map((edge) => edge.properties.revisionNodeId), + ?.map((edgeWithNode) => edgeWithNode.edge.properties.revisionNodeId), [data] ); diff --git a/react-components/stories/HighlightNode.stories.tsx b/react-components/stories/HighlightNode.stories.tsx index cd3062202d1..c68bfda0181 100644 --- a/react-components/stories/HighlightNode.stories.tsx +++ b/react-components/stories/HighlightNode.stories.tsx @@ -75,7 +75,7 @@ const StoryContent = ({ resources }: { resources: AddResourceOptions[] }): React } ]); void cameraNavigation.fitCameraToInstance(nodeData.fdmNode.externalId, 'pdms-mapping'); - }, [nodeData]); + }, [nodeData?.fdmNode]); return ( <> @@ -84,12 +84,6 @@ const StoryContent = ({ resources }: { resources: AddResourceOptions[] }): React instanceStyling={stylingGroups} /> - ); };