VSN-2036 : Defining new listing view of prepared circuits.
Merge Request Description
Title
Defining new listing drawer view in circuits preparation.
Overview
This merge request introduces the first functional draft of the Prepared Circuits feature on the front end.
It focuses on establishing a clean foundation for circuit preparation by defining a dedicated view, introducing a custom hook to manage circuit table logic, integrating the circuit form and table components, and removing temporary or unused code.
The goal of this MR is not to finalize business logic, but to structure the feature correctly, ensure clear separation of concerns, and prepare the codebase for upcoming enhancements related to circuit preparation workflows.
Key Changes and Contributions
1. Code Cleanup and Maintenance
- Removed unused Axios instance import from the prepared passengers view.
- Cleaned up unused imports across newly introduced and existing components.
- Removed temporary test data and obsolete custom form logic that was used during early experimentation.
These changes improve readability, reduce technical debt, and keep the codebase aligned with production standards.
2. Preparation Circuit Custom Hook
- Introduced a dedicated Preparation Circuit hook responsible for managing:
- Circuit table state
- Data preparation and transformation
- Table-related utilities and handlers
- This hook centralizes circuit-related logic and avoids scattering state management across views and components.
This approach improves scalability and makes future enhancements (filters, sorting, pagination, actions) easier to implement.
3. Draft View for Prepared Circuits
- Created a draft view specifically for prepared circuits.
- The draft view acts as a temporary visualization layer to:
- Display circuit-related data
- Validate layout, structure, and data flow
- Serve as a foundation for the final circuits listing screen
This step allows iterative development without impacting stable views.
4. View Integration and Referencing
- Referenced the newly created draft view to make it accessible and testable.
- Integrated the preparation circuit hook into the draft view to ensure proper data flow.
- Ensured the view correctly consumes hook outputs and utilities.
5. Circuit Form and Table Integration
- Integrated the Circuit Form into the prepared circuits list view.
- Integrated the Circuit Table component into the same view.
- Removed the old
renderRowapproach and delegated row rendering logic directly to the Circuit Table component.
This refactor improves component responsibility:
- The list view orchestrates the feature
- The table component fully owns row rendering logic
- The hook manages data and state
Architectural Improvements
- Clear separation between:
- View layer
- State and logic layer (custom hook)
- Presentation layer (table and form components)
- Reduced coupling between components
- Better alignment with scalable front-end architecture patterns
Outcome
This MR establishes a clean and extensible baseline for the Prepared Circuits feature.
It enables future work such as:
- Advanced circuit listing
- Editing and validation flows
- Integration with backend APIs
- Enhanced user interactions
The feature is now structurally ready for iterative functional development.
Changelog
- Prepared circuits draft view introduced
- Circuit table custom hook added
- Circuit form and table integrated
- Temporary logic and unused imports removed
- General code cleanup applied
Closes VSN-2036