Skip to content

[LOCKLITE-104] Refactor components architecture#65

Merged
vbetsch merged 60 commits intodevelopfrom
refactor/104-improve-ui
Aug 5, 2025
Merged

[LOCKLITE-104] Refactor components architecture#65
vbetsch merged 60 commits intodevelopfrom
refactor/104-improve-ui

Conversation

@vbetsch
Copy link
Owner

@vbetsch vbetsch commented Aug 5, 2025

No description provided.

@vbetsch vbetsch requested a review from Copilot August 5, 2025 00:31
@vbetsch vbetsch self-assigned this Aug 5, 2025
@vbetsch vbetsch added ui About templating and styling Code refactoring Code refactoring (for the release changelog) labels Aug 5, 2025
@notion-workspace
Copy link

Refactor user story

Copy link
Contributor

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

This PR refactors the components architecture by reorganizing and improving API hook patterns, extracting UI components into atomic design patterns, and updating DTOs to use consistent naming conventions.

  • Refactored API hooks by splitting useApi into useApiCall and useApiFetch for better separation of concerns
  • Extracted vault-related UI into reusable components following atomic design principles (atoms, molecules, organisms, templates)
  • Updated DTOs from CreateVaultRequestDto to CreateVaultPayloadDto for consistency and moved them to appropriate directories

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/units/modules/ui/hooks/useApi.test.tsx Removed test file for deprecated useApi hook
tests/units/modules/ui/components/common/ErrorMessage.test.tsx Updated tests to remove logging behavior and focus on rendering
tests/units/modules/shared/services/request.service.test.ts Updated import path and test expectation for refactored request service
src/modules/ui/services/locklite-api-request.service.ts Added base URL configuration and updated import path
src/modules/ui/hooks/useVaults.ts New hook for vault-specific data fetching using refactored API hooks
src/modules/ui/hooks/useApi.ts Removed deprecated hook replaced by new API hook pattern
src/modules/ui/hooks/api/useApiFetch.ts New hook for automatic data fetching with useEffect
src/modules/ui/hooks/api/useApiCall.ts New hook for manual API calls with loading and error state management
src/modules/ui/gateways/vaults.gateway.ts Updated to use new DTO names and consistent return types
src/modules/ui/components/vaults/templates/DynamicVaultsList.tsx New template component orchestrating vault list functionality
src/modules/ui/components/vaults/templates/AddVaultModal.tsx New improved modal component with better error handling and validation
src/modules/ui/components/vaults/organisms/VaultsList.tsx New organism component for displaying vault list with loading states
src/modules/ui/components/vaults/molecules/VaultSkeletons.tsx New skeleton loading component for vaults
src/modules/ui/components/vaults/molecules/VaultCard.tsx New card component for individual vault display with delete functionality
src/modules/ui/components/vaults/atoms/VaultCardContentLine.tsx New atomic component for vault property display
src/modules/ui/components/modals/molecules/ConfirmationModal.tsx New reusable confirmation modal component
src/modules/ui/components/modals/AddVaultModal.tsx Removed old modal implementation
src/modules/ui/components/common/SearchBar.tsx New reusable search bar component
src/modules/ui/components/common/ErrorMessage.tsx Simplified to remove automatic logging behavior
src/modules/shared/requests/request.service.ts Updated delete method to return consistent type
src/modules/shared/dto/input/payloads/create-vault.payload.dto.ts Renamed DTO for consistency
src/modules/api/usecases/vaults/create-vault.usecase.ts Updated to use renamed DTO
src/modules/api/repositories/vaults.repository.ts Updated to use renamed DTO and parameter naming
src/app/ui/workspace/page.tsx Simplified to use new template component
src/app/api/vaults/route.ts Updated to use renamed DTO
package.json Added granular test scripts for different modules
Makefile Added granular test targets

@vbetsch vbetsch merged commit 213ada3 into develop Aug 5, 2025
4 checks passed
@vbetsch vbetsch deleted the refactor/104-improve-ui branch August 5, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code refactoring Code refactoring (for the release changelog) ui About templating and styling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants