Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(sales): integrate deal search into SalesFilter - #8824

#8824
Open
BatKa-B wants to merge 1 commit into
mainerxes/erxes:mainfrom
feat/sales-filter-search-integrationerxes/erxes:feat/sales-filter-search-integrationCopy head branch name to clipboard
Open

feat(sales): integrate deal search into SalesFilter#8824
BatKa-B wants to merge 1 commit into
mainerxes/erxes:mainfrom
feat/sales-filter-search-integrationerxes/erxes:feat/sales-filter-search-integrationCopy head branch name to clipboard

Conversation

@BatKa-B

@BatKa-B BatKa-B commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Replaces the separate SalesSearch input in MainActionBar with a search filter item inside SalesFilter, matching the popover/dialog/chip pattern used by other filters in the codebase. Reuses the existing search query key so it wires into the existing deals.ts backend resolver without changes. Also adds i18n default values and translates the remaining hardcoded date filter labels (close-date, stage-changed).

Summary by Sourcery

Integrate deal text search into the SalesFilter UI and align sales filters with the shared filter bar and dialog patterns.

New Features:

  • Add a search filter item to SalesFilter using the existing search query key, including bar, dialog, and command palette entries for deals search.

Enhancements:

  • Remove the standalone SalesSearch control from the MainActionBar in favor of the unified filter-based search experience.
  • Localize sales filter labels by wiring them through the i18n sales namespace and providing default strings for date and entity-based filters.

Summary by CodeRabbit

  • New Features

    • Added translated labels for sales filters, including search, date ranges, and stage-change dates.
    • Added Mongolian translations for the new sales labels.
    • Integrated search into the sales filter controls.
  • Improvements

    • Consolidated sales search and filtering into a single filter interface.
    • Removed the separate search control from the action bar.

…e SalesSearch

Replaces the separate SalesSearch input in MainActionBar with a search
filter item inside SalesFilter, matching the popover/dialog/chip pattern
used by other filters in the codebase. Reuses the existing `search`
query key so it wires into the existing deals.ts backend resolver
without changes. Also adds i18n default values and translates the
remaining hardcoded date filter labels (close-date, stage-changed).
@sourcery-ai

sourcery-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Reviewer's Guide

Integrates deal text search into the existing SalesFilter system by introducing a search filter key and corresponding dialog/bar views, removes the standalone SalesSearch component from MainActionBar, and localizes previously hardcoded labels for date and other filters via the sales i18n namespace.

Sequence diagram for search filter interaction in SalesFilter

sequenceDiagram
  actor User
  participant SalesFilter
  participant useMultiQueryState
  participant Filter_DialogStringView
  participant SalesFilterBar
  participant filterDeals

  User->>SalesFilter: open search filter dialog
  SalesFilter->>useMultiQueryState: useMultiQueryState(search, companyIds, ...)
  User->>Filter_DialogStringView: enter search text
  Filter_DialogStringView->>useMultiQueryState: update search query
  useMultiQueryState->>SalesFilterBar: provide queries including search
  SalesFilterBar->>filterDeals: filterDeals(deals, queries)
  filterDeals-->>User: display filtered deals
Loading

Flow diagram for SalesFilter integration of search into MainActionBar

graph TD
  MainActionBar[MainActionBar]
  SalesFilter[SalesFilter]
  ArchivedDeals[ArchivedDeals]
  DealsViewControl[DealsViewControl]
  Filter_DialogStringView["Filter.DialogStringView (search)"]
  Filter_BarItem_search["Filter.BarItem search"]

  MainActionBar --> SalesFilter
  MainActionBar --> ArchivedDeals
  MainActionBar --> DealsViewControl

  SalesFilter --> Filter_DialogStringView
  SalesFilter --> Filter_BarItem_search
Loading

File-Level Changes

Change Details Files
Add a search filter integrated into SalesFilter’s dialog, bar, and command palette views using the existing search query key.
  • Register search in SalesFilter’s useMultiQueryState so it participates in query state and backend wiring.
  • Add a search string dialog view (Filter.DialogStringView) under the filter dialog, using a localized label.
  • Render a search chip in the filter bar when a search value exists, with icon and dialog button.
  • Expose a search item in the command palette-style filter picker, matching other filters’ UX.
frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesFilter.tsx
Localize previously hardcoded date and filter labels in SalesFilter using the sales translation namespace with default strings.
  • Instantiate useTranslation('sales') in SalesFilter where needed.
  • Wrap date-related labels (created, start, close, stage-changed) and various “by-*” labels with t() calls, providing English defaults for fallbacks.
  • Propagate localized labels into Filter.Date, Filter.DateView, Filter.DialogDateView, and filter item components for consistency across dialog, bar, and command views.
frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesFilter.tsx
backend/gateway/src/locales/en/sales.json
backend/gateway/src/locales/mn/sales.json
Remove the standalone SalesSearch component from the main action bar now that search is handled via SalesFilter.
  • Delete the SalesSearch import and JSX usage from MainActionBar so the layout relies on SalesFilter for search.
  • Remove the SalesSearch component file to avoid dead code.
frontend/plugins/sales_ui/src/modules/deals/actionBar/components/MainActionBar.tsx
frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesSearch.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The search chip in SalesFilterBar renders the full search string inside Filter.BarButton; consider truncating long values and/or adding a tooltip to avoid layout breakage when users enter very long queries.
  • Label texts are slightly inconsistent in capitalization and wording (e.g. 'Start Date' vs 'Date created', 'By Assigned user' vs 'By User'); it may be worth standardizing these to a consistent style before finalizing the UI.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The search chip in `SalesFilterBar` renders the full `search` string inside `Filter.BarButton`; consider truncating long values and/or adding a tooltip to avoid layout breakage when users enter very long queries.
- Label texts are slightly inconsistent in capitalization and wording (e.g. `'Start Date'` vs `'Date created'`, `'By Assigned user'` vs `'By User'`); it may be worth standardizing these to a consistent style before finalizing the UI.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d22e6d10-3b41-4c47-a9f0-04f439e708b5

📥 Commits

Reviewing files that changed from the base of the PR and between baaf14f and b16e0d6.

📒 Files selected for processing (5)
  • backend/gateway/src/locales/en/sales.json
  • backend/gateway/src/locales/mn/sales.json
  • frontend/plugins/sales_ui/src/modules/deals/actionBar/components/MainActionBar.tsx
  • frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesFilter.tsx
  • frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesSearch.tsx
💤 Files with no reviewable changes (2)
  • frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesSearch.tsx
  • frontend/plugins/sales_ui/src/modules/deals/actionBar/components/MainActionBar.tsx

📝 Walkthrough

Walkthrough

Sales deal filters now include translated search and date labels in English and Mongolian. Search is integrated into SalesFilter, while the standalone SalesSearch component is removed from the action bar.

Changes

Sales filter localization and search

Layer / File(s) Summary
Translated filter controls and query integration
backend/gateway/src/locales/{en,mn}/sales.json, frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesFilter.tsx
Sales filters now wire the search query, render translated labels and icons, and use localized date-filter labels with English fallbacks.
Action bar search wiring
frontend/plugins/sales_ui/src/modules/deals/actionBar/components/MainActionBar.tsx, frontend/plugins/sales_ui/src/modules/deals/actionBar/components/SalesSearch.tsx
The standalone SalesSearch component is removed from the action bar, leaving search presentation within SalesFilter.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • erxes/erxes#8294: Adds related stage-change date filter fields and sales filter localization.
  • erxes/erxes#8585: Updates sales action bar internationalization and search component wiring.

Suggested reviewers: khuslen122, zolb646

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: moving deal search into SalesFilter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sales-filter-search-integration

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.