Commit Graph

35 Commits

Author SHA1 Message Date
bdbaf36456 Centralize authentication logic and integrate token refresh mechanism
- Introduce `AuthWrapper` component for streamlined session-based layouts and authentication handling.
- Add new utilities (`tokenUtils.ts`) for JWT decoding, token expiration checks, and refresh operations via Keycloak.
- Refactor `serverCall` and `authOptions` to use centralized token refresh logic, removing redundant implementations.
- Implement `ClientSessionProvider` for consistent session management across the client application.
- Simplify `RootLayout` by delegating authentication enforcement to `AuthWrapper`.
2025-07-11 23:42:41 +02:00
6aae06635d Reset form state on dialog close in NewCustomerModal
- Add `resetForm` utility to restore initial modal state.
- Automatically reset form state when dialog closes or a new customer is created to improve UX.
2025-07-11 20:36:51 +02:00
14d089073b Make NewCustomerModal props readonly to ensure immutability 2025-07-11 20:31:36 +02:00
b62ee3e9ad Add token expiration check and refresh mechanism in serverCall
- Decode and validate JWT payload to detect expired or near-expiring tokens.
- Implement `refreshAccessToken` using Keycloak endpoints for seamless token refresh.
- Modify `serverCall` to refresh and update token dynamically before API requests.
- Improve error logging for token decoding and refresh operations.
2025-07-11 20:30:12 +02:00
52c6358a0c Remove unused showInfoToast during customer data fetch 2025-07-11 20:22:20 +02:00
0724f3b1e7 Remove callApi, refactor API integrations, and adjust error handling
- Delete unused `callApi` utility and related imports across components.
- Replace `callApi` with direct `fetch` usage in `validateCustomer` and `addCustomer`.
- Update `customerRoutes` to include `/api` prefix for consistency.
- Refactor `useErrorHandler` to ensure comprehensive state management during errors.
- Improve `ErrorBoundary` component text for better clarity in fallback UI.
- Align `CustomersPage` logic with `useCallback` for optimized dependency management.
2025-07-11 20:21:45 +02:00
86be1e8920 Enhance NewCustomerModal with callback support and toast notifications
- Add `onCustomerCreated` callback to refresh customer list after creation.
- Integrate `showInfoToast` and `showSuccessToast` for validation and creation feedback.
- Prevent closing modal on backdrop click; add explicit cancel button.
- Refactor `addCustomer` to use `callApi` and centralized routes.
- Simplify customer fetching logic in `CustomersPage` with reusable function.
2025-07-11 19:53:52 +02:00
644d907b45 Reset state on dialog close in ErrorDialog component 2025-07-11 19:33:27 +02:00
c99e09056c Refactor error handling utilities
- Replace `showError` with a more versatile `showToast` utility.
- Add specific toast functions (`showErrorToast`, `showSuccessToast`, etc.) for better message handling.
- Remove `showError.ts` and migrate logic to `showToast.ts` for cleaner structure.
- Update `ErrorBoundary` and `useErrorHandler` to use the new `showToast` functions.
2025-07-11 19:15:08 +02:00
18014ce9f0 Introduce ErrorBoundary component for improved error handling
- Add `ErrorBoundary` component to handle rendering fallback UI during errors.
- Integrate `ErrorBoundary` into main layout and critical pages for global error handling.
- Create `useErrorHandler` hook to handle async errors consistently across components.
- Refactor `NewCustomerModal` and `CustomersPage` to leverage `useErrorHandler` for improved error management.
- Add a fallback dialog UI for user-friendly error reporting and resolution.
2025-07-11 19:06:07 +02:00
2a95efb75f Remove CustomerRepository and replace with direct API calls
- Remove `CustomerRepository` and its methods for customer management and caching.
- Refactor customer-related pages (`[id]/page.tsx`, `customers/page.tsx`) to use direct `fetch` API calls.
- Update breadcrumb resolver to fetch data directly from the API.
- Simplify `addCustomer` use case to avoid repository dependency.
2025-07-11 18:38:44 +02:00
328c0537ba Introduce caching in CustomerRepository and refactor API integration
- Add in-memory caching for customer data in `CustomerRepository` to reduce API calls.
- Replace direct API calls with methods from `CustomerRepository`.
- Update customer-related pages (`[id]/page.tsx`, `customers/page.tsx`) to use `CustomerRepository` for data fetching.
- Adjust breadcrumb resolver to leverage `CustomerRepository`.
- Remove `axios` dependency from customer-related components.
2025-07-07 22:02:55 +02:00
4ae62f2911 Handle empty input validation in validateCustomer use case 2025-07-07 22:02:38 +02:00
e42b352216 Refactor navigation structure and API routes
- Centralize user menu, sidebar items, and breadcrumb logic.
- Map consistent API endpoints in `customerRoutes`.
- Replace inline route definitions with reusable constants.
- Refactor auth configuration file location.
- Improve `<Link>` usage to replace static `<a>` elements.
- Adjust sidebar and dropdown components to use dynamic navigation configurations.
2025-07-07 19:49:58 +02:00
7b39ab8cd8 Add INTERNAL_BACKEND_URL to .env generation in CI pipeline 2025-07-06 20:24:37 +02:00
4b08e5e58c Fix base URL formatting in serverCall for API requests 2025-07-06 19:59:50 +02:00
54793437a1 Handle empty customers array in filtering logic 2025-07-06 19:52:48 +02:00
e00142ff81 Customer Detail Page and Enhance dynamic breadcrumbs 2025-07-06 17:24:12 +00:00
916dbfcf95 Add customer management 2025-07-06 08:31:48 +00:00
2bd76aa6bb Fix .env handling in CI pipeline 2025-07-02 11:18:11 +09:00
cd3165dbe6 Enhance CI pipeline to include NEXTAUTH_URL for production and test environments. 2025-07-02 11:12:12 +09:00
fb3b5b6880 Cleanup 2025-07-02 11:09:20 +09:00
63985d538a Improve .env handling and deployment; ensure .env is included as an artifact and update deployment scripts to copy it. 2025-07-02 11:01:29 +09:00
3f3ea936dc Log .env contents during CI pipeline 2025-07-02 10:46:39 +09:00
c16ba0d09a Add environment variable handling for CI builds in internal_frontend 2025-07-02 10:41:04 +09:00
9837259c41 Update authOptions import path 2025-07-02 10:22:08 +09:00
ae425e4e28 Refactor authOptions into a separate module to improve structure and reusability. 2025-07-02 10:14:21 +09:00
b1d7eb906f Remove unused jsonwebtoken and jwt-decode dependencies 2025-07-02 10:04:09 +09:00
2f71dca04d Integrate NextAuth with Keycloak and implement JWT validation in internal_frontend. 2025-07-02 09:55:25 +09:00
0b2f8332a2 Add dynamic breadcrumb navigation and update kanzlei routes under /demo 2025-07-02 01:25:55 +09:00
b33b470e7b Add foundational UI components (sidebar, some basic navigation) 2025-07-01 18:44:15 +09:00
20314c64b2 Add theme integration and shadcn setup in internal_frontend 2025-07-01 17:37:30 +09:00
e06e6f8669 Add Dockerfile for internal_frontend production deployment 2025-07-01 17:24:21 +09:00
b9ed439cba Add internal_frontend module with CI pipeline and Docker configuration 2025-07-01 17:22:33 +09:00
f121a0ef80 Initialize internal_frontend module with Next.js, 2025-07-01 17:18:13 +09:00