Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-components): list 360-core-dm-connected assets #4967

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

haakonflatval-cognite
Copy link
Contributor

@haakonflatval-cognite haakonflatval-cognite commented Jan 23, 2025

Does not include Search-capabilities

Type of change

Bug

Jira ticket 📘

https://cognitedata.atlassian.net/browse/

Description 📝

Return coreDM-360-connected assets from the useSearch...-hook.

Not yet finished - next step is ensuring it also works with the search functionality.

Enables https://github.com/cognitedata/fusion/pull/11099

How has this been tested? 🔍

Test instructions ℹ️

Checklist ☑️

  • I am proud of this feature.
  • I have performed a self-review of my own code.
  • I have added PR type (Feat, Bug, Chore, Test, Docs, Style, Refactor) to the PR title.
  • I have manually tested this for different scenarios (different models, formats, devices, browsers).
  • I have commented my code in hard-to-understand areas.
  • I have made corresponding changes to the public documentation.
  • I have added unit and visuals tests to prove that my feature works to the best of my ability.
  • I have refactored the code for readability to the best of my ability.
  • I have checked that my changes do not introduce regressions in the public documentation.
  • I have outlined any known defects / lacking capabilities in the contents of this PR.
  • I have listed any remaining work that should follow this PR in the description or jira/miro/etc.
  • I have added TSDoc to any public facing changes.
  • I have added "developer documentation" in any package README.md that is related / applicable to this PR.
  • I have noted down and am currently tracking any technical debt introduced in this PR.
  • I have thoroughly thought about the architecture of this implementation.
  • I have asked peers to test this feature.

Does not include Search-capabilities
Copy link

There were failures in the visual tests workflow.
Image diffs for visual tests can be downloaded as an artifact here.

@@ -5,15 +5,17 @@ import { type ExternalId, type IdEither, type InternalId } from '@cognite/sdk';
import { type DmsUniqueIdentifier } from '../../data-providers';
import { type InstanceReference } from './types';

export function isIdEither(instance: InstanceReference): instance is IdEither {
export type AnnotationAssetRef = { externalId?: string; space?: string };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use DmsUniqueIdentifier directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is actually a mistake from my side 🙈 This is supposed to be the assetRef field of the images.assetLink datatype of annotations. I've corrected it now to { id?: number; externalId?: string; }

@@ -153,3 +124,93 @@ function getObject3dRelation(visualizableTableName: string): QueryTableExpressio
}
};
}

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export function createCheck3dConnectedEquipmentQuery(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we have too many properties been selected here in single query, was wondering if it could have any performance issue while fetching huge data for all resources

Copy link
Contributor Author

@haakonflatval-cognite haakonflatval-cognite Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's quite a lot 😓 I'm sure it can be heavy for some queries, but in practice, I don't think there will be a huge amount of returned data. We're only looking for 3D-connections (including directly connected, indirect through reference and indirect through edge) in the different model types for a few specific input instances. I expect almost all such queries to return less than 100 results for each input instance in total

I swear, I could not for the life of me make the linter accept this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants