Skip to content

Conversation

lucasgoral
Copy link
Contributor

What this PR does / why we need it:
Adds "charging target type" input required to create a Project

@andreaskienle andreaskienle self-assigned this Jul 4, 2025
@andreaskienle andreaskienle requested a review from Copilot July 4, 2025 10:03
Copy link
Contributor

@Copilot Copilot AI left a 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 MetadataForm with 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 btpChargingTargetRegex is ambiguous—this regex appears to match a UUID for charging targets, not specifically BTP. Consider renaming to chargingTargetUuidRegex or similar for clarity.
export const btpChargingTargetRegex =

andreaskienle
andreaskienle previously approved these changes Jul 4, 2025
Copy link
Contributor

@andreaskienle andreaskienle left a 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>
lucasgoral and others added 5 commits July 4, 2025 12:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit bb94cf8.
@andreaskienle andreaskienle merged commit 99131bb into main Jul 4, 2025
5 checks passed
@andreaskienle andreaskienle deleted the feat/add-charging-target-inputs branch July 4, 2025 10:38
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