From 99239744f368577e6fef02c1dd1d1453f74f040d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 31 May 2024 10:07:05 +0200 Subject: [PATCH 1/7] chore(react-components): add missing exports --- react-components/src/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/react-components/src/index.ts b/react-components/src/index.ts index cb06b695db7..0c573f24e86 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -99,12 +99,15 @@ export { type FdmAssetStylingGroup, type AssetStylingGroup, type DefaultResourceStyling, - type Image360AssetStylingGroup -} from './components/Reveal3DResources/types'; -export type { - AddImageCollection360Options, - AddResourceOptions, - AddReveal3DModelOptions + type Image360AssetStylingGroup, + type TaggedAddResourceOptions, + type TaggedAdd3DModelOptions, + type TaggedAddImageCollection360Options, + type AddImageCollection360EventsOptions, + type AddImageCollection360DatamodelsOptions, + type AddImageCollection360Options, + type AddResourceOptions, + type AddReveal3DModelOptions } from './components/Reveal3DResources/types'; export { type PointCloudAnnotationMappedAssetData, From d3c143ab50121309d7b9a23c6c73f6f05b4fe4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 31 May 2024 10:10:03 +0200 Subject: [PATCH 2/7] chore: another one --- react-components/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 0c573f24e86..7f2ddc036db 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -112,7 +112,8 @@ export { export { type PointCloudAnnotationMappedAssetData, type Image360AnnotationMappedAssetData, - type LayersUrlStateParam + type LayersUrlStateParam, + type ThreeDModelFdmMappings } from './hooks/types'; export type { CameraNavigationActions } from './hooks/useCameraNavigation'; export type { Source, DmsUniqueIdentifier } from './utilities/FdmSDK'; From 606af1da3750ee49fb087e2c9f53471c554da435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 31 May 2024 12:40:11 +0200 Subject: [PATCH 3/7] chore: rename AddImage360-option types --- .../Image360CollectionContainer.tsx | 6 ++--- .../Reveal3DResources/typeGuards.ts | 20 +++++++------- .../src/components/Reveal3DResources/types.ts | 26 +++++++++---------- .../useRemoveNonReferencedModels.ts | 6 ++--- .../hooks/useReveal3dResourcesFromScene.ts | 4 +-- react-components/src/index.ts | 6 ++--- react-components/src/query/use3dScenes.tsx | 6 ++--- .../Image360CollectionContainer.stories.tsx | 4 +-- .../stories/SearchHooks.stories.tsx | 4 +-- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx b/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx index 2140a89ea74..28ad8acbaed 100644 --- a/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx +++ b/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx @@ -5,7 +5,7 @@ import { type ReactElement, useEffect, useRef } from 'react'; import { useReveal } from '../RevealCanvas/ViewerContext'; import { type Image360Collection } from '@cognite/reveal'; import { useRevealKeepAlive } from '../RevealKeepAlive/RevealKeepAliveContext'; -import { type AddImageCollection360Options } from '../..'; +import { type AddImage360CollectionOptions } from '../Reveal3DResources/types'; import { type ImageCollectionModelStyling, useApply360AnnotationStyling @@ -13,10 +13,10 @@ import { import { type Matrix4 } from 'three'; type Image360CollectionContainerProps = { - addImageCollection360Options: AddImageCollection360Options; + addImageCollection360Options: AddImage360CollectionOptions; styling?: ImageCollectionModelStyling; onLoad?: (image360: Image360Collection) => void; - onLoadError?: (addOptions: AddImageCollection360Options, error: any) => void; + onLoadError?: (addOptions: AddImage360CollectionOptions, error: any) => void; }; export function Image360CollectionContainer({ diff --git a/react-components/src/components/Reveal3DResources/typeGuards.ts b/react-components/src/components/Reveal3DResources/typeGuards.ts index f0f9816c61f..48ee79798e7 100644 --- a/react-components/src/components/Reveal3DResources/typeGuards.ts +++ b/react-components/src/components/Reveal3DResources/typeGuards.ts @@ -2,16 +2,16 @@ * Copyright 2024 Cognite AS */ import { - type AddImageCollection360EventsOptions, - type AddImageCollection360DatamodelsOptions, - type AddImageCollection360Options, + type AddImage360CollectionEventsOptions, + type AddImage360CollectionDatamodelsOptions, + type AddImage360CollectionOptions, type AddResourceOptions, type AddReveal3DModelOptions } from './types'; export function is360ImageAddOptions( addOptions: AddResourceOptions -): addOptions is AddImageCollection360Options { +): addOptions is AddImage360CollectionOptions { return !is3dModelOptions(addOptions); } @@ -23,15 +23,15 @@ export function is3dModelOptions( } export function is360ImageDataModelAddOptions( - addOptions: AddImageCollection360Options -): addOptions is AddImageCollection360DatamodelsOptions { - const castOptions = addOptions as AddImageCollection360DatamodelsOptions; + addOptions: AddImage360CollectionOptions +): addOptions is AddImage360CollectionDatamodelsOptions { + const castOptions = addOptions as AddImage360CollectionDatamodelsOptions; return castOptions.externalId !== undefined && castOptions.space !== undefined; } export function is360ImageEventsAddOptions( - addOptions: AddImageCollection360Options -): addOptions is AddImageCollection360EventsOptions { - const castOptions = addOptions as AddImageCollection360EventsOptions; + addOptions: AddImage360CollectionOptions +): addOptions is AddImage360CollectionEventsOptions { + const castOptions = addOptions as AddImage360CollectionEventsOptions; return castOptions.siteId !== undefined; } diff --git a/react-components/src/components/Reveal3DResources/types.ts b/react-components/src/components/Reveal3DResources/types.ts index 10b3a2141ee..e162afc7c03 100644 --- a/react-components/src/components/Reveal3DResources/types.ts +++ b/react-components/src/components/Reveal3DResources/types.ts @@ -10,30 +10,30 @@ import { import { type Matrix4 } from 'three'; import { type DmsUniqueIdentifier, type Source } from '../../utilities/FdmSDK'; -import { type CogniteInternalId, type Node3D } from '@cognite/sdk/dist/src'; +import { type CogniteInternalId, type Node3D } from '@cognite/sdk'; -export type AddImageCollection360Options = - | AddImageCollection360EventsOptions - | AddImageCollection360DatamodelsOptions; +export type AddImage360CollectionOptions = + | AddImage360CollectionEventsOptions + | AddImage360CollectionDatamodelsOptions; -export type AddImageCollection360EventsOptions = { - siteId: string; -} & { +export type CommonImage360CollectionAddOptions = { transform?: Matrix4; }; -export type AddImageCollection360DatamodelsOptions = { +export type AddImage360CollectionEventsOptions = { + siteId: string; +} & CommonImage360CollectionAddOptions; + +export type AddImage360CollectionDatamodelsOptions = { externalId: string; space: string; -} & { - transform?: Matrix4; -}; +} & CommonImage360CollectionAddOptions; export type FdmPropertyType = Record>; export type TaggedAddImageCollection360Options = { type: 'image360'; - addOptions: AddImageCollection360Options; + addOptions: AddImage360CollectionOptions; }; export type TaggedAdd3DModelOptions = { type: 'cad' | 'pointcloud'; @@ -42,7 +42,7 @@ export type TaggedAdd3DModelOptions = { export type TaggedAddResourceOptions = TaggedAdd3DModelOptions | TaggedAddImageCollection360Options; -export type AddResourceOptions = AddReveal3DModelOptions | AddImageCollection360Options; +export type AddResourceOptions = AddReveal3DModelOptions | AddImage360CollectionOptions; export type AddReveal3DModelOptions = AddModelOptions & { transform?: Matrix4 } & { styling?: { default?: NodeAppearance; mapped?: NodeAppearance }; diff --git a/react-components/src/components/Reveal3DResources/useRemoveNonReferencedModels.ts b/react-components/src/components/Reveal3DResources/useRemoveNonReferencedModels.ts index b44536e0944..be318a6661a 100644 --- a/react-components/src/components/Reveal3DResources/useRemoveNonReferencedModels.ts +++ b/react-components/src/components/Reveal3DResources/useRemoveNonReferencedModels.ts @@ -2,7 +2,7 @@ * Copyright 2024 Cognite AS */ import { type Cognite3DViewer, type CogniteModel, type Image360Collection } from '@cognite/reveal'; -import { type AddImageCollection360Options, type TypedReveal3DModel } from './types'; +import { type AddImage360CollectionOptions, type TypedReveal3DModel } from './types'; import { is360ImageDataModelAddOptions, is360ImageEventsAddOptions, @@ -13,7 +13,7 @@ import { isSameCadModel, isSamePointCloudModel } from '../../utilities/isSameMod export function useRemoveNonReferencedModels( addOptions: TypedReveal3DModel[], - image360CollectionAddOptions: AddImageCollection360Options[], + image360CollectionAddOptions: AddImage360CollectionOptions[], viewer: Cognite3DViewer ): void { useEffect(() => { @@ -83,7 +83,7 @@ function findNonReferencedModels( } function findNonReferencedCollections( - image360CollectionAddOptions: AddImageCollection360Options[], + image360CollectionAddOptions: AddImage360CollectionOptions[], viewer: Cognite3DViewer ): Image360Collection[] { const collections = viewer.get360ImageCollections(); diff --git a/react-components/src/hooks/useReveal3dResourcesFromScene.ts b/react-components/src/hooks/useReveal3dResourcesFromScene.ts index 148d3eae57b..882226ff24c 100644 --- a/react-components/src/hooks/useReveal3dResourcesFromScene.ts +++ b/react-components/src/hooks/useReveal3dResourcesFromScene.ts @@ -6,7 +6,7 @@ import { useSceneConfig } from '../query/useSceneConfig'; import { type CogniteClient } from '@cognite/sdk'; import { type AddResourceOptions, - type AddImageCollection360DatamodelsOptions + type AddImage360CollectionDatamodelsOptions } from '../components/Reveal3DResources/types'; import { CDF_TO_VIEWER_TRANSFORMATION, type AddModelOptions } from '@cognite/reveal'; import { useEffect, useState } from 'react'; @@ -48,7 +48,7 @@ export const useReveal3dResourcesFromScene = ( scene.data.image360Collections.forEach((collection) => { const transform = createResourceTransformation(collection); - const addModelOptions: AddImageCollection360DatamodelsOptions = { + const addModelOptions: AddImage360CollectionDatamodelsOptions = { externalId: collection.image360CollectionExternalId, space: collection.image360CollectionSpace }; diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 7f2ddc036db..203a95c7ac2 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -103,9 +103,9 @@ export { type TaggedAddResourceOptions, type TaggedAdd3DModelOptions, type TaggedAddImageCollection360Options, - type AddImageCollection360EventsOptions, - type AddImageCollection360DatamodelsOptions, - type AddImageCollection360Options, + type AddImage360CollectionEventsOptions, + type AddImage360CollectionDatamodelsOptions, + type AddImage360CollectionOptions, type AddResourceOptions, type AddReveal3DModelOptions } from './components/Reveal3DResources/types'; diff --git a/react-components/src/query/use3dScenes.tsx b/react-components/src/query/use3dScenes.tsx index 2284ea46a67..7721cbe4856 100644 --- a/react-components/src/query/use3dScenes.tsx +++ b/react-components/src/query/use3dScenes.tsx @@ -19,7 +19,7 @@ import { Euler, MathUtils, Matrix4 } from 'three'; import { CDF_TO_VIEWER_TRANSFORMATION } from '@cognite/reveal'; import { type AddReveal3DModelOptions, - type AddImageCollection360DatamodelsOptions + type AddImage360CollectionDatamodelsOptions } from '../components/Reveal3DResources/types'; import { type GroundPlane, type Skybox } from '../components/SceneContainer/sceneTypes'; @@ -35,7 +35,7 @@ export type SceneData = { cameraEulerRotationY: number; cameraEulerRotationZ: number; cadModelOptions: AddReveal3DModelOptions[]; - image360CollectionOptions: AddImageCollection360DatamodelsOptions[]; + image360CollectionOptions: AddImage360CollectionDatamodelsOptions[]; groundPlanes: GroundPlane[]; skybox?: Skybox; }; @@ -183,7 +183,7 @@ function populateSceneMapWith360Images( const properties = Object.values(Object.values(edge.properties)[0])[0]; const transform = createTransformFromEdge(properties); - const newImage360Collection: AddImageCollection360DatamodelsOptions = { + const newImage360Collection: AddImage360CollectionDatamodelsOptions = { externalId: properties.image360CollectionExternalId, space: properties.image360CollectionSpace, transform diff --git a/react-components/stories/Image360CollectionContainer.stories.tsx b/react-components/stories/Image360CollectionContainer.stories.tsx index f4d17c4a14f..9758910ce3e 100644 --- a/react-components/stories/Image360CollectionContainer.stories.tsx +++ b/react-components/stories/Image360CollectionContainer.stories.tsx @@ -3,7 +3,7 @@ */ import type { Meta, StoryObj } from '@storybook/react'; import { - type AddImageCollection360Options, + type AddImage360CollectionOptions, Image360CollectionContainer, useCameraNavigation } from '../src'; @@ -37,7 +37,7 @@ export const Main: Story = { }; type CadModelContainerStoryContentProps = { - addImageCollection360Options: AddImageCollection360Options; + addImageCollection360Options: AddImage360CollectionOptions; transform?: Matrix4; styling?: ImageCollectionModelStyling; }; diff --git a/react-components/stories/SearchHooks.stories.tsx b/react-components/stories/SearchHooks.stories.tsx index 3ad48ef8cd0..191e9a0252e 100644 --- a/react-components/stories/SearchHooks.stories.tsx +++ b/react-components/stories/SearchHooks.stories.tsx @@ -8,7 +8,7 @@ import { RevealToolbar, type AddResourceOptions, type AddReveal3DModelOptions, - type AddImageCollection360Options, + type AddImage360CollectionOptions, RevealContext } from '../src'; import { Color } from 'three'; @@ -89,7 +89,7 @@ const StoryContent = ({ resources }: { resources: AddResourceOptions[] }): React } = useAllMappedEquipmentAssetMappings(filteredResources, sdk); const filtered360ImageResources = resources.filter( - (resource): resource is AddImageCollection360Options => 'siteId' in resource + (resource): resource is AddImage360CollectionOptions => 'siteId' in resource ); const siteIds = filtered360ImageResources.map((filteredResource) => { return 'siteId' in filteredResource ? filteredResource.siteId : filteredResource.externalId; From 1db0524d45cc33c354c56d78f8150fa4c8f8a0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 31 May 2024 12:45:49 +0200 Subject: [PATCH 4/7] chore: type fix --- .../RevealToolbar/LayersContainer/useModelHandlers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-components/src/components/RevealToolbar/LayersContainer/useModelHandlers.tsx b/react-components/src/components/RevealToolbar/LayersContainer/useModelHandlers.tsx index 79532fb2b25..d48e2b0383c 100644 --- a/react-components/src/components/RevealToolbar/LayersContainer/useModelHandlers.tsx +++ b/react-components/src/components/RevealToolbar/LayersContainer/useModelHandlers.tsx @@ -66,7 +66,7 @@ export const useModelHandlers = ( function createHandlers( models: CogniteModel[], - modelNames: string[] | undefined, + modelNames: Array | undefined, image360Collections: Image360Collection[], viewer: Cognite3DViewer ): ModelLayerHandlers { From ea6323d205d2f5c71a5c36989744f2afd1ec1063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 31 May 2024 12:48:18 +0200 Subject: [PATCH 5/7] chore: actually push changes to use3dmodelnames --- react-components/src/query/use3DModelName.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/react-components/src/query/use3DModelName.tsx b/react-components/src/query/use3DModelName.tsx index 261fad53e86..d40834082f6 100644 --- a/react-components/src/query/use3DModelName.tsx +++ b/react-components/src/query/use3DModelName.tsx @@ -5,10 +5,12 @@ import { type QueryFunction, useQuery, type UseQueryResult } from '@tanstack/react-query'; import { useSDK } from '../components/RevealCanvas/SDKProvider'; -export const use3DModelName = (ids: number[]): UseQueryResult => { +export const use3DModelName = ( + ids: number[] +): UseQueryResult, unknown> => { const sdk = useSDK(); - const queryFunction: QueryFunction = async () => { + const queryFunction: QueryFunction> = async () => { const modelNamePromises = await Promise.allSettled( ids.map(async (id) => { const model = await sdk.models3D.retrieve(id); @@ -16,19 +18,20 @@ export const use3DModelName = (ids: number[]): UseQueryResult = []; modelNamePromises.forEach((modelNamePromise) => { if (modelNamePromise.status === 'fulfilled') { - modelResolvedNames.push(modelNamePromise.value); + modelNames.push(modelNamePromise.value); } else if (modelNamePromise.status === 'rejected') { console.error('Error while retriving Model Name', modelNamePromise.reason); + modelNames.push(undefined); } }); - return modelResolvedNames; + return modelNames; }; - const queryResult = useQuery({ + const queryResult = useQuery>({ queryKey: ['cdf', '3d', 'model', ids], queryFn: queryFunction, staleTime: Infinity From f6e511b211e30b65f0dd57f7290d501f25a189f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 31 May 2024 13:01:34 +0200 Subject: [PATCH 6/7] chore: ASNTHSNOETHUSNTH --- .../Image360CollectionContainer/Image360CollectionContainer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx b/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx index 28ad8acbaed..498f289123b 100644 --- a/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx +++ b/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx @@ -115,7 +115,7 @@ export function Image360CollectionContainer({ } } -function defaultLoadErrorHandler(addOptions: AddImageCollection360Options, error: any): void { +function defaultLoadErrorHandler(addOptions: AddImage360CollectionOptions, error: any): void { console.warn( `Failed to load image collection ${ 'siteId' in addOptions ? addOptions.siteId : addOptions.externalId From 3319bd4f444522c47e537f864cb0ea0afa2bb39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 31 May 2024 17:16:05 +0200 Subject: [PATCH 7/7] chore: rename a bit more for consistency --- .../Image360CollectionContainer.tsx | 34 +++++++++---------- .../Reveal3DResources/Reveal3DResources.tsx | 2 +- .../src/components/Reveal3DResources/types.ts | 4 +-- .../network/getImage360CollectionsForAsset.ts | 4 +-- react-components/src/index.ts | 2 +- .../Image360CollectionContainer.stories.tsx | 8 ++--- .../stories/Image360Details.stories.tsx | 2 +- .../stories/LayersContainer.stories.tsx | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx b/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx index 498f289123b..07cfaa54334 100644 --- a/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx +++ b/react-components/src/components/Image360CollectionContainer/Image360CollectionContainer.tsx @@ -13,14 +13,14 @@ import { import { type Matrix4 } from 'three'; type Image360CollectionContainerProps = { - addImageCollection360Options: AddImage360CollectionOptions; + addImage360CollectionOptions: AddImage360CollectionOptions; styling?: ImageCollectionModelStyling; onLoad?: (image360: Image360Collection) => void; onLoadError?: (addOptions: AddImage360CollectionOptions, error: any) => void; }; export function Image360CollectionContainer({ - addImageCollection360Options, + addImage360CollectionOptions, styling, onLoad, onLoadError @@ -35,31 +35,31 @@ export function Image360CollectionContainer({ useEffect(() => { if ( - 'siteId' in addImageCollection360Options && - initializingSiteId.current === addImageCollection360Options + 'siteId' in addImage360CollectionOptions && + initializingSiteId.current === addImage360CollectionOptions ) { return; } - initializingSiteId.current = addImageCollection360Options; + initializingSiteId.current = addImage360CollectionOptions; - void add360Collection(addImageCollection360Options.transform); + void add360Collection(addImage360CollectionOptions.transform); return remove360Collection; - }, [addImageCollection360Options]); + }, [addImage360CollectionOptions]); useApply360AnnotationStyling(modelRef.current, styling); useEffect(() => { if ( modelRef.current === undefined || - addImageCollection360Options.transform === undefined || + addImage360CollectionOptions.transform === undefined || !viewer.get360ImageCollections().includes(modelRef.current) ) { return; } - modelRef.current.setModelTransformation(addImageCollection360Options.transform); - }, [modelRef, addImageCollection360Options.transform, viewer]); + modelRef.current.setModelTransformation(addImage360CollectionOptions.transform); + }, [modelRef, addImage360CollectionOptions.transform, viewer]); return <>; @@ -75,21 +75,21 @@ export function Image360CollectionContainer({ }) .catch((error: any) => { const errorReportFunction = onLoadError ?? defaultLoadErrorHandler; - errorReportFunction(addImageCollection360Options, error); + errorReportFunction(addImage360CollectionOptions, error); }); async function getOrAdd360Collection(): Promise { const collections = viewer.get360ImageCollections(); const siteId = - 'siteId' in addImageCollection360Options - ? addImageCollection360Options.siteId - : addImageCollection360Options.externalId; + 'siteId' in addImage360CollectionOptions + ? addImage360CollectionOptions.siteId + : addImage360CollectionOptions.externalId; const collection = collections.find((collection) => collection.id === siteId); if (collection !== undefined) { return collection; } - if ('siteId' in addImageCollection360Options) { + if ('siteId' in addImage360CollectionOptions) { return await viewer.add360ImageSet( 'events', { site_id: siteId }, @@ -97,8 +97,8 @@ export function Image360CollectionContainer({ ); } else { return await viewer.add360ImageSet('datamodels', { - image360CollectionExternalId: addImageCollection360Options.externalId, - space: addImageCollection360Options.space + image360CollectionExternalId: addImage360CollectionOptions.externalId, + space: addImage360CollectionOptions.space }); } } diff --git a/react-components/src/components/Reveal3DResources/Reveal3DResources.tsx b/react-components/src/components/Reveal3DResources/Reveal3DResources.tsx index 5bfb3966876..2d9daac910a 100644 --- a/react-components/src/components/Reveal3DResources/Reveal3DResources.tsx +++ b/react-components/src/components/Reveal3DResources/Reveal3DResources.tsx @@ -162,7 +162,7 @@ export const Reveal3DResources = ({ return ( = Record>; -export type TaggedAddImageCollection360Options = { +export type TaggedAddImage360CollectionOptions = { type: 'image360'; addOptions: AddImage360CollectionOptions; }; @@ -40,7 +40,7 @@ export type TaggedAdd3DModelOptions = { addOptions: AddReveal3DModelOptions; }; -export type TaggedAddResourceOptions = TaggedAdd3DModelOptions | TaggedAddImageCollection360Options; +export type TaggedAddResourceOptions = TaggedAdd3DModelOptions | TaggedAddImage360CollectionOptions; export type AddResourceOptions = AddReveal3DModelOptions | AddImage360CollectionOptions; diff --git a/react-components/src/hooks/network/getImage360CollectionsForAsset.ts b/react-components/src/hooks/network/getImage360CollectionsForAsset.ts index 81918bff605..d920581c737 100644 --- a/react-components/src/hooks/network/getImage360CollectionsForAsset.ts +++ b/react-components/src/hooks/network/getImage360CollectionsForAsset.ts @@ -4,12 +4,12 @@ import { type AnnotationsAssetRef, type CogniteClient, type IdEither } from '@cognite/sdk/dist/src'; import { uniq } from 'lodash'; import { isDefined } from '../../utilities/isDefined'; -import { type TaggedAddImageCollection360Options } from '../../components/Reveal3DResources/types'; +import { type TaggedAddImage360CollectionOptions } from '../../components/Reveal3DResources/types'; export async function getImage360CollectionsForAsset( assetId: number, sdk: CogniteClient -): Promise { +): Promise { const fileRefsResult = await sdk.annotations.reverseLookup({ filter: { annotatedResourceType: 'file', data: { assetRef: { id: assetId } } }, limit: 1000 diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 203a95c7ac2..7c895f22d29 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -102,7 +102,7 @@ export { type Image360AssetStylingGroup, type TaggedAddResourceOptions, type TaggedAdd3DModelOptions, - type TaggedAddImageCollection360Options, + type TaggedAddImage360CollectionOptions, type AddImage360CollectionEventsOptions, type AddImage360CollectionDatamodelsOptions, type AddImage360CollectionOptions, diff --git a/react-components/stories/Image360CollectionContainer.stories.tsx b/react-components/stories/Image360CollectionContainer.stories.tsx index 9758910ce3e..7d6e7e2336f 100644 --- a/react-components/stories/Image360CollectionContainer.stories.tsx +++ b/react-components/stories/Image360CollectionContainer.stories.tsx @@ -24,12 +24,12 @@ type Story = StoryObj; export const Main: Story = { args: { - addImageCollection360Options: { siteId: 'c_RC_2', transform: new Matrix4() } + addImage360CollectionOptions: { siteId: 'c_RC_2', transform: new Matrix4() } }, - render: ({ addImageCollection360Options, styling }) => ( + render: ({ addImage360CollectionOptions, styling }) => ( @@ -57,7 +57,7 @@ const Image360CollectionContainerStoryContent = ({ return ( <> diff --git a/react-components/stories/Image360Details.stories.tsx b/react-components/stories/Image360Details.stories.tsx index a07521e6419..b67da69dc81 100644 --- a/react-components/stories/Image360Details.stories.tsx +++ b/react-components/stories/Image360Details.stories.tsx @@ -25,7 +25,7 @@ export const Main: Story = { { setLoading(false); }} diff --git a/react-components/stories/LayersContainer.stories.tsx b/react-components/stories/LayersContainer.stories.tsx index 8e3b980fe12..8ba12cf5f71 100644 --- a/react-components/stories/LayersContainer.stories.tsx +++ b/react-components/stories/LayersContainer.stories.tsx @@ -51,7 +51,7 @@ export const Main: Story = { }} transform={new Matrix4()} /> - +