Skip to content

Feat/crm deal stage add/edit modal#1523

Open
sanjula-rtc wants to merge 36 commits into
developfrom
feat/crm-configurations-page
Open

Feat/crm deal stage add/edit modal#1523
sanjula-rtc wants to merge 36 commits into
developfrom
feat/crm-configurations-page

Conversation

@sanjula-rtc

Copy link
Copy Markdown
Contributor

PR checklist

TaskId: (https://github.com/SkappHQ/skapp/issues/[id])

Summary

How to test

Project Checklist

  • Changes build without any errors
  • Have written adequate test cases
  • Done developer testing in
    • Chrome
    • Firefox
    • Safari
  • Code is formatted with npm run format
  • Code is linted with npm run check-lint
  • No unnecessary comments left in code
  • Made corresponding changes to the documentation

Other

  • New atomic components added
  • New molecules added
  • New pages(routes) added
  • New dependencies installed

PR Checklist

  • Pull request is raised from the correct source branch
  • Pull request is raised to the correct destination branch
  • Pull request is raised with correct title
  • Pull request is self reviewed
  • Pull request is self assigned
  • Suitable pull request status labels are added (ready-for-code-review)

Additional Information

@sanjula-rtc sanjula-rtc requested a review from ThinuwanW as a code owner June 21, 2026 17:56
Copilot AI review requested due to automatic review settings June 21, 2026 17:56
@CLAassistant

CLAassistant commented Jun 21, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 DealStageModalForm and 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.

Comment thread frontend/src/community/crm/utils/dealStageValidations.ts

@ThinuwanW ThinuwanW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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)

Comment thread frontend/src/community/crm/api/crmDealApi.ts
Comment thread frontend/src/community/common/constants/stringConstants.ts
Comment thread frontend/src/community/crm/api/crmDealApi.ts
Comment thread frontend/src/community/configurations/types/zustand/StoreTypes.ts Outdated
Comment thread frontend/src/community/crm/utils/dealStageValidations.ts Outdated
Comment thread frontend/src/community/crm/api/crmDealApi.ts
Comment thread frontend/src/community/crm/api/crmDealApi.ts

@ThinuwanW ThinuwanW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

Comment thread frontend/src/community/configurations/stores/slices/dealStageSlice.ts Outdated
Comment thread frontend/src/community/configurations/types/zustand/StoreTypes.ts Outdated
Comment thread frontend/src/community/crm/constants/stageConstants.ts Outdated
charith-rc
charith-rc previously approved these changes Jun 26, 2026
Comment thread frontend/src/community/crm/constants/stageConstants.ts Outdated
Comment thread frontend/src/community/crm/utils/crmUtil.ts
Comment thread frontend/src/community/common/assets/languages/english/configurations.json Outdated
Comment thread frontend/src/community/crm/utils/dealStageValidations.ts Outdated
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants