-
Notifications
You must be signed in to change notification settings - Fork 3
Feat: charging target inputs improvements and validation #187
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
Feat: charging target inputs improvements and validation #187
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 enhances how the chargingTarget
and chargingTargetType
inputs are handled and validated across the project.
- Adds schema-level validation (format and presence) for
chargingTarget
when a type is selected - Updates form components to disable/mark fields based on selected type and surfaces validation messages
- Passes
getValues
through dialog/container components to drive dynamic form behavior
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/lib/api/validations/schemas.ts | Imported btpChargingTargetRegex and added superRefine checks |
src/components/Wizards/CreateManagedControlPlaneWizardContainer.tsx | Flattened props/callbacks, no functional change |
src/components/Dialogs/MetadataForm.tsx | Added getValues , dynamic disabling/valueState on charging inputs |
src/components/Dialogs/CreateWorkspaceDialogContainer.tsx | Passed getValues to CreateProjectWorkspaceDialog |
src/components/Dialogs/CreateProjectWorkspaceDialog.tsx | Added getValues prop and inline formatting updates |
src/components/Dialogs/CreateProjectDialogContainer.tsx | Passed getValues to workspace dialog |
src/components/Dialogs/CreateProjectDialog.cy.tsx | Updated default values and flattened test selectors |
public/locales/en.json | Added new validation message key notValidChargingTargetFormat |
Comments suppressed due to low confidence (1)
src/components/Dialogs/CreateProjectDialog.cy.tsx:33
- New validation for
chargingTarget
format and required presence when a type is selected isn’t covered by existing tests. Add scenarios that try invalid formats and missing targets forbtp
type to ensure the error messages surface correctly.
chargingTargetType: 'btp',
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.
👍
What this PR does / why we need it:
Added logic to handle input of charging target and charging target type properly. And added validation.
Fixes openmcp-project/backlog#163