Skip to content

fix(query-builder): refactor the components#1087

Merged
Hristo313 merged 8 commits into
vnextfrom
hhristov/fix-query-builder-react-samples
Jul 9, 2026
Merged

fix(query-builder): refactor the components#1087
Hristo313 merged 8 commits into
vnextfrom
hhristov/fix-query-builder-react-samples

Conversation

@Hristo313

Copy link
Copy Markdown
Contributor

Refactor the query builder samples to use functional components

Copilot AI 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.

Pull request overview

Refactors the Query Builder interaction samples from class-based React components to functional components using hooks, while keeping the existing Ignite UI Query Builder setup and behavior.

Changes:

  • Converted the Sample components to functional components with useRef and useEffect lifecycle equivalents.
  • Moved static configuration (entities/fields/options and template builders) out of component instances into module-level constants/functions.
  • Rewired expressionTreeChange handling and initial setup/teardown to use effect cleanup.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
samples/interactions/query-builder/template/src/index.tsx Converts the template sample to hooks, extracts field/options/template helpers, and sets up Query Builder event handling via useEffect.
samples/interactions/query-builder/overview/src/index.tsx Converts the overview + grid sample to hooks, extracts entities/fields, and fetches data on expressionTreeChange with effect-based setup/cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/overview/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/overview/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/overview/src/index.tsx
Comment thread samples/interactions/query-builder/overview/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
@Hristo313
Hristo313 requested a review from IMinchev64 July 8, 2026 11:05

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

Hmm, weird. I still notice strange behavior with the default input field. I thought changing the input event to the correct onInput would resolve it but I was wrong.

See attached video of the behavior:

query-builder-react.mp4

@Hristo313
Hristo313 requested a review from IMinchev64 July 9, 2026 08:32

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

It seems that similar to IgrInput in buildDefaultInput the following components also use sender.vlaue which is undefined and needs to be changed to sender.detail:

  • IgrSelect
  • IgrDatePicker
  • IgrDateTimeInput

@Hristo313
Hristo313 requested a review from IMinchev64 July 9, 2026 11:10
Comment thread samples/interactions/query-builder/template/src/index.tsx Outdated
@IMinchev64 IMinchev64 added status: verified The PR is tested and ready for a merge and removed status: in-test PR ready for testing labels Jul 9, 2026
@Hristo313
Hristo313 merged commit 02a4959 into vnext Jul 9, 2026
4 checks passed
@Hristo313
Hristo313 deleted the hhristov/fix-query-builder-react-samples branch July 9, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: verified The PR is tested and ready for a merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants