-
Notifications
You must be signed in to change notification settings - Fork 229
feat(compass-aggregations): add confirm banner for edit pipeline and new banners COMPASS-9700 #7198
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use showConfirmation
method from @mongodb-js/compass-components
instead of this custom built confirmation modal logic
289879a
to
f5f1030
Compare
1f65dc7
to
894cb50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds confirmation banners and validation for editing pipelines and creating search indexes on views. It introduces a new utility function to determine if a view's pipeline is compatible with search indexes and implements confirmation dialogs when modifying views that have existing search indexes.
- Adds
isPipelineSearchQueryable
utility function to validate view pipeline compatibility with search indexes - Implements confirmation dialogs when updating views with existing search indexes
- Disables search index creation buttons and shows warnings for incompatible view pipelines
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/compass-utils/src/view-search-queryable.ts | New utility function to check if a pipeline is search index compatible |
packages/compass-utils/src/view-search-queryable.spec.ts | Test coverage for the new utility function |
packages/compass-utils/src/index.ts | Exports the new utility function |
packages/compass-utils/package.json | Adds mongodb dependency for Document type |
packages/compass-indexes/src/modules/collection-stats.ts | Extends collection stats to include pipeline data |
packages/compass-indexes/src/components/view-version-incompatible-banners/ | Adds test ID to existing banner component |
packages/compass-indexes/src/components/search-indexes-table/ | Adds pipeline validation and disables buttons for incompatible views |
packages/compass-indexes/src/components/indexes/ | Implements new banner for pipeline incompatibility warnings |
packages/compass-indexes/src/components/indexes-toolbar/ | Disables create index button for incompatible pipelines |
packages/compass-indexes/package.json | Adds compass-utils dependency |
packages/compass-aggregations/src/modules/update-view.ts | Implements confirmation dialog when updating views with search indexes |
packages/compass-aggregations/src/modules/update-view.spec.ts | Test coverage for update view confirmation logic |
packages/compass-aggregations/src/modules/search-indexes.ts | Adds optional namespace parameter to fetchIndexes function |
Comments suppressed due to low confidence (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
} catch { | ||
throw new Error('Error occured fetching indexes'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't make too much sense to re-throw a less detailed error here I think. But also just in general doesn't look right to fail in this case: this method will throw if cluster doesn't support search indexes and this will fail the view update for no good reason in this case. When trying out this branch locally, view updates are broken unless you're running the latest version of mongodb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, I had it return false instead so it just skips confirmation in the second case. This was also prevent it from failing for less than latest version. I also made it check for 8.0+ so it only checks for confirmation for the versions it's possible to have search indexes on views (8.0 on de, 8.1+ on compass).
Description
When the user clicks edit pipeline, we will show a confirmation popup if they have search indexes. Popup will look different depending on whether the view is search queryable or not.
We also display banner if it is search queryable or not in indexes page.
confirmation.mov
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes