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()} /> - +