-
Notifications
You must be signed in to change notification settings - Fork 3
Add charging target type input #168
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
Adds support for a new chargingTargetType field across validation, API types, resource creators, and UI forms to enable specifying the type of charging target when creating workspaces, projects, or control planes.
- Extend Zod schemas and type definitions to include
chargingTargetType - Define a label key and regex for the new field
- Update resource creators and dialog/wizard components to initialize, reset, and submit
chargingTargetType - Enhance
MetadataFormwith a<Select>input and add translations
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/api/validations/schemas.ts | Add chargingTargetType to project and control plane schemas |
| src/lib/api/validations/regex.ts | Add regex for BTP charging target IDs |
| src/lib/api/types/shared/keyNames.ts | Define label key CHARGING_TARGET_TYPE_LABEL |
| src/lib/api/types/crate/createWorkspace.ts | Include chargingTargetType in CreateWorkspace |
| src/lib/api/types/crate/createProject.ts | Include chargingTargetType in CreateProject |
| src/lib/api/types/crate/createManagedControlPlane.ts | Include chargingTargetType in CreateManagedControlPlane |
| src/components/Wizards/CreateManagedControlPlaneWizardContainer.tsx | Pass and reset chargingTargetType in wizard container |
| src/components/Dialogs/MetadataForm.tsx | Add <Select> for chargingTargetType input |
| src/components/Dialogs/CreateWorkspaceDialogContainer.tsx | Initialize and reset chargingTargetType in dialog |
| src/components/Dialogs/CreateProjectDialogContainer.tsx | Initialize, reset, and submit chargingTargetType |
| src/components/Dialogs/CreateProjectWorkspaceDialog.tsx | Pass type prop to require charging target on projects |
| src/components/Dialogs/CreateProjectDialog.cy.tsx | Set dialog type to workspace in tests |
| public/locales/en.json | Add translations for label and options |
Comments suppressed due to low confidence (1)
src/lib/api/validations/regex.ts:9
- [nitpick] The name
btpChargingTargetRegexis ambiguous—this regex appears to match a UUID for charging targets, not specifically BTP. Consider renaming tochargingTargetUuidRegexor similar for clarity.
export const btpChargingTargetRegex =
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 on Canary and it works well. We’ll implement proper validation and enhance the UI in a follow-up PR.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit bb94cf8.
What this PR does / why we need it:
Adds "charging target type" input required to create a Project