Feat/crm deal stage add/edit modal#1523
Conversation
…nd enhance deal stage management in state slices
|
|
There was a problem hiding this comment.
Pull request overview
This PR introduces the frontend pieces for a CRM Deal Stage add/edit modal: form UI + validation, API mutations/endpoints, and supporting Zustand state and i18n updates. It centralizes add/edit into a single reusable modal form and wires in create/update calls that invalidate the deal stages query.
Changes:
- Added Yup validation schema and new TypeScript payload/form types for deal stages.
- Extended CRM deal API layer with create/update deal stage mutations and endpoints.
- Introduced a unified
DealStageModalFormand updated modal controller + configuration store slice/i18n keys to support add/edit.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/community/crm/utils/dealStageValidations.ts | Adds Yup schema for deal stage form validation. |
| frontend/src/community/crm/types/CommonTypes.ts | Introduces form/payload types for deal stage create/update. |
| frontend/src/community/crm/api/utils/ApiEndpoints.ts | Adds create/update deal stage endpoint helpers. |
| frontend/src/community/crm/api/crmDealApi.ts | Adds useCreateDealStage / useUpdateDealStage mutations and request helpers. |
| frontend/src/community/configurations/types/zustand/StoreTypes.ts | Extends configuration store types with selectedDealStage + setter. |
| frontend/src/community/configurations/types/zustand/SliceTypes.ts | Adds selected stage fields/actions to the deal stage slice type. |
| frontend/src/community/configurations/stores/slices/dealStageSlice.ts | Implements selectedDealStage state and setSelectedDealStage. |
| frontend/src/community/configurations/components/organisms/DealStageModalController/DealStageModalController.tsx | Switches modal content to the new unified DealStageModalForm. |
| frontend/src/community/configurations/components/molecules/DealStageModalForm/DealStageModalForm.tsx | Implements the add/edit deal stage modal form UI, submission, and toasts. |
| frontend/src/community/common/assets/languages/english/configurations.json | Refactors deal stage modal translation keys and shared aria keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…gableDealStageCard
… in DealStagesDraggableContent
… useDealStageById hook
ThinuwanW
left a comment
There was a problem hiding this comment.
🤖 Claude Code Review
This PR consolidates the add/edit deal-stage modals into a single DealStageModalForm, adds delete and reorder flows, and wires up new API hooks and i18n. The logic is largely sound, but there are two type-safety defects that will fail strict TypeScript compilation and can crash at runtime: useDealStageById is typed to accept a non-null number yet is called with number | null, and its return value (CrmDealStageType | undefined) is dereferenced without guarding in DealStageModalForm. There are also a validation-message/constant mismatch, a hardcoded currency string, and minor dead code.
Found 12 new issue(s): 🟡 3 suggestion(s), 🟣 2 nit(s)
ThinuwanW
left a comment
There was a problem hiding this comment.
🤖 Claude Code Review
This PR adds full CRUD + reorder for CRM deal stages (create/edit/delete modals, reorder save, API hooks, store state) and restructures the i18n keys. The implementation is largely solid and consistent with existing patterns, but there is a real runtime-crash risk from unguarded access to a possibly-undefined deal stage in edit mode (TS errors are suppressed by ignoreBuildErrors), a validation-length/message mismatch for descriptions, plus some dead imports/variables and minor i18n gaps.
Found 9 new issue(s):
1 finding(s) already posted in a previous review.
…crm-configurations-page
|



PR checklist
TaskId: (https://github.com/SkappHQ/skapp/issues/[id])
Summary
How to test
Project Checklist
npm run formatnpm run check-lintOther
PR Checklist
ready-for-code-review)Additional Information