feat: add generic VoltageLevelCreationForm component#1037
Open
achour94 wants to merge 11 commits intogridsuite:mainfrom
Open
feat: add generic VoltageLevelCreationForm component#1037achour94 wants to merge 11 commits intogridsuite:mainfrom
achour94 wants to merge 11 commits intogridsuite:mainfrom
Conversation
Move VoltageLevelCreationForm from gridstudy-app to commons-ui as a reusable component. The form includes basic voltage level fields (ID, name, substation, nominal voltage, voltage limits, short circuit limits, properties) and supports optional substationOptions prop for autocomplete mode vs free text. When no substationOptions are provided, the substation field is a free text input. The component also accepts children for extending with additional form sections. Includes types, utils (schema, dto converters, empty form data), and translations (en/fr). https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…d sub-components Move all VL creation related code into commons-ui: - Add missing field constants to FieldConstants enum (BUS_BAR_COUNT, SECTION_COUNT, etc.) - Move full VL creation schema, form data types, DTO types, and form-to-dto/dto-to-form converters - Move SwitchesBetweenSections, CreateSwitchesDialog, and related components - Move CouplingOmnibusForm, CouplingOmnibusCreation, and related components - Create SubstationCreationSection component for inline substation creation - Include BusBarSections and CouplingOmnibus in VoltageLevelCreationForm - Add EN/FR translations for all VL creation form labels - Make form generic with optional props (substationOptions, customSubstationSection, hideBusBarSection) https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…ble field names - Move full gridstudy schema into commons-ui (ADD_SUBSTATION_CREATION, SUBSTATION_CREATION_ID, SUBSTATION_NAME, COUNTRY, SUBSTATION_CREATION fields) - Replace IS_ATTACHMENT_POINT_CREATION with HIDE_NOMINAL_VOLTAGE and HIDE_BUS_BAR_SECTION for clearer schema intent - Add SubstationCreationSection toggle logic directly in VoltageLevelCreationForm (watches ADD_SUBSTATION_CREATION to switch between substation select and creation) - Add AttachedSubstationCreationDto type and include substationCreation in VoltageLevelCreationDto - Update formToDto to build substationCreation object when ADD_SUBSTATION_CREATION - Update dtoToForm to detect and restore substationCreation data - Remove customSubstationSection, hideNominalVoltage, hideBusBarSection props (form reads these from form context fields instead) https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…VL form Use yup from commons-ui yupConfig (with locale) instead of direct yup imports, and move fetchDefaultCountry logic from gridstudy into the generic VoltageLevelCreationForm component. https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…ected DTO types - Replace manually written VoltageLevelCreationFormData interface with yup.InferType<typeof voltageLevelCreationFormSchema> - Add SwitchKind enum to replace string literals - Fix CouplingDevice DTO to use busbarSectionId1/2 matching backend API - Map coupling device field names between form (busBarSectionId1) and DTO (busbarSectionId1) - Remove topologyKind from DTO and formToDto/dtoToForm - Remove FormSchemaType duplication in consumers https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…sion Add VoltageLevelFormInfos type matching network-map-server schema and refactor voltageLevelCreationDtoToForm to accept both VoltageLevelFormInfos and VoltageLevelCreationDto using a type guard discriminator. https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…ions Export voltageLevelCreationDtoToForm (VoltageLevelCreationDto → form) and voltageLevelInfosToForm (VoltageLevelFormInfos → form) as separate public functions instead of a single discriminated union function. https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
- Add optional intl param for switch kind translation - Fix substation properties: use raw properties instead of getFilledPropertiesFromModification to match original setValue behavior - Fix main VL properties: use getPropertiesFromModification (keeps all properties including null values) instead of getFilledPropertiesFromModification https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
… and voltageLevelCreationDtoToForm https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
Extract the showDeleteSubstationButton logic from the component internals and expose it as an optional prop with a default value of true. https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move VoltageLevelCreationForm from gridstudy-app to commons-ui as a reusable component. The form includes basic voltage level fields (ID, name, substation, nominal voltage, voltage limits, short circuit limits, properties) and supports optional substationOptions prop for autocomplete mode vs free text. When no substationOptions are provided, the substation field is a free text input. The component also accepts children for extending with additional form sections.
Includes types, utils (schema, dto converters, empty form data), and translations (en/fr).
https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
PR Summary