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): Fix PointCloudFilterCommand because it didn't show up in Search #4703

Merged
merged 7 commits into from
Aug 19, 2024

Conversation

nilscognite
Copy link
Contributor

Type of change

Bug

Description 📝

I have changed the way to get the point cloud only. The new way is more secure for not having bugs.

@nilscognite nilscognite requested a review from a team as a code owner August 16, 2024 08:44
@nilscognite nilscognite changed the title Fix PointCloudFilterCommand because it didn't show up in Search fix(react-components): Fix PointCloudFilterCommand because it didn't show up in Search Aug 16, 2024
Copy link
Contributor

@haakonflatval-cognite haakonflatval-cognite left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Even though I'm not sure what exactly is making this work contra the previous solution 😅 Also, a couple of suggestions

Comment on lines +97 to +102
for (const pointCloud of this.renderTarget.getPointClouds()) {
if (this._modelId === pointCloud.modelId && this._revisionId === pointCloud.revisionId) {
return pointCloud;
}
}
return undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

This function could be rewritten as return this.renderTarget.getPointClouds().find(pointCloud => pointCloud.modelId === this._modelId && pointCloud.revisionId === this._revisionId). It returns undefined if no applicable result is found

Comment on lines +168 to +173
for (const pointCloud of this.renderTarget.getPointClouds()) {
if (this._modelId === pointCloud.modelId && this._revisionId === pointCloud.revisionId) {
return pointCloud;
}
}
return undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

This could also be written with find

@nilscognite nilscognite enabled auto-merge (squash) August 19, 2024 07:49
@nilscognite nilscognite merged commit d9b6130 into master Aug 19, 2024
14 checks passed
@nilscognite nilscognite deleted the np/new-work branch August 19, 2024 07:52
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