[LOCKLITE-104] Refactor components architecture#65
Merged
Conversation
This reverts commit 7d1dcdf.
Contributor
There was a problem hiding this comment.
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
useApiintouseApiCallanduseApiFetchfor better separation of concerns - Extracted vault-related UI into reusable components following atomic design principles (atoms, molecules, organisms, templates)
- Updated DTOs from
CreateVaultRequestDtotoCreateVaultPayloadDtofor 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 |
src/modules/ui/components/modals/molecules/ConfirmationModal.tsx
Outdated
Show resolved
Hide resolved
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.
No description provided.