Skip to content

Conversation

@richie-ni
Copy link
Collaborator

@richie-ni richie-ni commented Jun 17, 2025

Pull Request

🤨 Rationale

The current implementation does not update the dependency when initializing.

This pull request refines the logic for detecting and handling changes in resultsQuery.

👩‍💻 Implementation

  • Simplified the loadStepPaths method in QueryStepsDataSource by removing unused parameters and streamlining its implementation. (
  • Consolidated duplicate logic for updating stepsPath into the new validateAndUpdateStepPaths method, reducing redundancy across the codebase.
  • Refined the logic in onResultsFilterChange within QueryStepsEditor to ensure that handleQueryChange is triggered only when resultsQuery differs from both the current and previous values.
  • Updated QueryStepsDataSource to introduce currentResultsQuery alongside previousResultsQuery, and moved the logic for updating stepsPath into a new validateAndUpdateStepPaths method for better encapsulation and reusability.

🧪 Testing

  • Added a new test case in QueryStepsEditor.test.tsx to verify that resultsQuery updates correctly when it differs from the previous query.
  • Mocked and validated the behavior of validateAndUpdateStepPaths in QueryStepsDataSource.test.ts to ensure it updates stepsPath correctly when resultsQuery changes.

✅ Checklist

@richie-ni richie-ni marked this pull request as ready for review June 18, 2025 08:58
@richie-ni richie-ni merged commit dfa8fe5 into main Jun 18, 2025
1 check passed
@richie-ni richie-ni deleted the users/richie/fix-internal-dependencies-on-init branch June 18, 2025 09:32
manisha-ni pushed a commit that referenced this pull request Jun 19, 2025
## [3.139.0](v3.138.4...v3.139.0) (2025-06-18)

### Features

* **results:** Update dependencies to load on initialization ([#309](#309)) ([dfa8fe5](dfa8fe5))
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.

3 participants