-
Notifications
You must be signed in to change notification settings - Fork 3
Fix: When editing MCP custom 'crossplane' providers should be preserved #397
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.
Pull request overview
This PR fixes an issue where custom crossplane providers were not being preserved when editing a Managed Control Plane (MCP). The solution introduces an explicit isProvider field to the ComponentsListItem interface and implements logic to preserve custom providers from the initial selection that may no longer be in the available components list.
Key changes:
- Added
isProviderboolean field toComponentsListIteminterface to replace string-matching logic for identifying providers - Implemented preservation logic for custom providers from
initialSelectionthat don't exist in the available components list - Centralized component sorting logic in
useComponentsSelectionDatahook to ensure providers are consistently positioned after crossplane
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib/api/types/crate/createManagedControlPlane.ts | Added isProvider field to ComponentsListItem interface and updated filter logic to use the new field instead of string matching |
| src/components/Wizards/CreateManagedControlPlane/useComponentsSelectionData.ts | Set isProvider field when building components list, added logic to preserve custom providers from initialSelection, and implemented sorting to position providers after crossplane |
| src/components/ComponentsSelection/ComponentsSelection.tsx | Removed local isProvider callback and sorting logic in favor of using pre-sorted data with component.isProvider field; also alphabetically sorted imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/components/Wizards/CreateManagedControlPlane/useComponentsSelectionData.ts
Show resolved
Hide resolved
andreaskienle
left a comment
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.
Tested it, fixes the issue.
Here's a follow-up task to clean things up: openmcp-project/backlog#399
What this PR does / why we need it:
When editing MCP custom 'crossplane' providers should be preserved