Skip to content

Add "New Client" page to allow client creation#21

Merged
rafaelhgcarlos merged 12 commits intostagefrom
feat/clients-module/new-client-page
Apr 21, 2026
Merged

Add "New Client" page to allow client creation#21
rafaelhgcarlos merged 12 commits intostagefrom
feat/clients-module/new-client-page

Conversation

@rafaelhgcarlos
Copy link
Copy Markdown
Member

This pull request introduces a new "Create Client" feature, allowing users to add new clients to the system through a dedicated page and form. It also integrates the new page into the application routing and updates the clients module exports so the page can be properly referenced throughout the application.

The most important changes include:

New Client Creation Feature:

  • Added a new page component NewClientPage with a form for creating clients. The form includes fields for name, email, phone, company, status, and notes, and handles submission, validation, and user feedback using toast notifications. (src/modules/clients/pages/NewClientPage.tsx)
  • Added navigation flow so users are redirected back to the clients list after successful client creation.

Routing Integration:

  • Registered a new protected route at /clients/new so authenticated users can access the client creation page. (src/router/components/AppRoute.tsx)
  • Updated the router to import and render NewClientPage within the existing ProtectedRoute wrapper to maintain authentication control.

Module Export Updates:

  • Updated the clients module exports to include NewClientPage, allowing it to be easily imported and registered in the router. (src/modules/clients/pages/index.tsx)

UI/UX Behavior:

  • Added loading state handling to prevent duplicate submissions while the client is being created.
  • Implemented success and error toast notifications to provide clear feedback to the user after form submission.
  • Added cancel and save actions with proper navigation and loading indicators to improve usability.

@rafaelhgcarlos rafaelhgcarlos self-assigned this Apr 1, 2026
@rafaelhgcarlos rafaelhgcarlos added the enhancement New feature or request label Apr 1, 2026
…handling

- Integrates validateClientForm for centralized validation
- Adds inline error handling for all fields
- Implements CPF and ZIP code input masks
- Improves ZIP code logic with auto-fill and validation states
- Refactors form state management and error handling
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 21, 2026

Deploying hs-system with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7cbdcd4
Status: ✅  Deploy successful!
Preview URL: https://206aaa9f.hs-system.pages.dev
Branch Preview URL: https://feat-clients-module-new-clie.hs-system.pages.dev

View logs

- Refactors zip code input handling logic
- Integrates validation with errors state instead of separate zipError
- Fixes error behavior during typing vs submit
- Ensures proper address autofill after valid ZIP Code
- Improves form state consistency and UX
@rafaelhgcarlos rafaelhgcarlos merged commit 66c06b7 into stage Apr 21, 2026
2 checks passed
@rafaelhgcarlos rafaelhgcarlos deleted the feat/clients-module/new-client-page branch April 21, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant