Skip to content

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

Open
Hristo313 wants to merge 2 commits into
vnextfrom
hhristov/fix-query-builder-react-samples
Open

fix(query-builder): refactor the components#1087
Hristo313 wants to merge 2 commits into
vnextfrom
hhristov/fix-query-builder-react-samples

Conversation

@Hristo313

Copy link
Copy Markdown

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: in-test PR ready for testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants