refactor: use generic VoltageLevelCreationForm from commons-ui#3769
Open
achour94 wants to merge 11 commits intogridsuite:mainfrom
Open
refactor: use generic VoltageLevelCreationForm from commons-ui#3769achour94 wants to merge 11 commits intogridsuite:mainfrom
achour94 wants to merge 11 commits intogridsuite:mainfrom
Conversation
Refactor the voltage level creation form to use the generic VoltageLevelCreationForm from @gridsuite/commons-ui. The study-specific form (StudyVoltageLevelCreationForm) now wraps the generic form and adds: - Substation autocomplete with create-inline option - Bus bar count, section count, coupling omnibus, switches between sections - Attachment point mode support The dialog is updated to use commons-ui field constants (FieldConstants.EQUIPMENT_ID instead of the local EQUIPMENT_ID) for consistency with the generic form's field naming convention. https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
- Rewrite VL creation dialog to use FieldConstants from commons-ui - Simplify VL creation form using generic VoltageLevelCreationForm - Use SubstationCreationSection from commons-ui for inline substation creation - Import SwitchesBetweenSections from commons-ui in topology creation form - Remove old local coupling-omnibus and switches-between-sections components - Remove unused voltage-level-creation-utils.js https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
- Remove duplicated schema from gridstudy dialog (now in commons-ui) - Use voltageLevelCreationFormSchema, voltageLevelCreationEmptyFormData, voltageLevelCreationFormToDto from commons-ui - Replace IS_ATTACHMENT_POINT_CREATION with HIDE_NOMINAL_VOLTAGE and HIDE_BUS_BAR_SECTION - Simplify onSubmit using commons-ui formToDto - Simplify form wrapper: remove manual SubstationCreationSection toggle (handled by VoltageLevelCreationForm internally) - Keep study-specific logic: substation fetching, custom paper component with CreateSubstation button, default country fetching https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
The fetchDefaultCountry logic has been moved to the generic VoltageLevelCreationForm component in commons-ui. https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…rmSchemaType - Replace local FormSchemaType with VoltageLevelCreationFormData from commons-ui - Map coupling device field names from backend to form field names - Simplify type casts now that DTO field names match https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
Simplify fromExternalDataToFormValues by delegating field mapping to commons-ui's unified conversion function that handles both edit data (VoltageLevelCreationDto) and copy data (VoltageLevelFormInfos). https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…ialog Split fromExternalDataToFormValues into fromEditDataToFormValues (using voltageLevelCreationDtoToForm for editData/useEffect) and fromSearchCopyToFormValues (using voltageLevelInfosToForm for useFormSearchCopy). Extract shared attachment point logic into applyAttachmentPointOverrides helper. https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
…tionForm Move the showDeleteSubstationButton logic to StudyVoltageLevelCreationForm and pass it as a prop to the shared VoltageLevelCreationForm component. 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.
Refactor the voltage level creation form to use the generic VoltageLevelCreationForm from @gridsuite/commons-ui. The study-specific form (StudyVoltageLevelCreationForm) now wraps the generic form and adds:
The dialog is updated to use commons-ui field constants (FieldConstants.EQUIPMENT_ID instead of the local EQUIPMENT_ID) for consistency with the generic form's field naming convention.
https://claude.ai/code/session_01CUA6hVhwcTV96EMWeQrKFv
PR Summary