Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change endpoint monitor/builds to use useQuery #2622

Merged
merged 9 commits into from
Jul 29, 2024

Conversation

Cristhianzl
Copy link
Collaborator

@Cristhianzl Cristhianzl commented Jul 10, 2024

This pull request refactors the existing implementation of the monitor/builds endpoint to utilize React Query's useQuery hook.

@Cristhianzl Cristhianzl self-assigned this Jul 10, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. javascript Pull requests that update Javascript code labels Jul 10, 2024
Copy link
Contributor

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated.

Validation Report

Validation Active Result
All commits in this pull request has valid messages
Pull request does not introduce too many changes
Pull request has a valid title
Pull request has mentioned issues
Pull request has valid branch name
Pull request should have a non-empty body

Result

Pull request satisfies all enabled pull request rules.

Last Modified at 10 Jul 24 13:33 UTC

@github-actions github-actions bot added the refactor Maintenance tasks and housekeeping label Jul 10, 2024
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 10, 2024
@Cristhianzl Cristhianzl changed the title refactor: change delete -> builds to use useQuery refactor: change endpoint monitor/builds to use useQuery Jul 10, 2024
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jul 10, 2024
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

The request is duplicated because of the useEffect:
image

@Cristhianzl
Copy link
Collaborator Author

The request is duplicated because of the useEffect: image

fixed

Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 12, 2024
✨ (index.ts): create index file for builds-related queries
✨ (use-delete-builds.ts): implement useDeleteFLowPool hook for deleting builds
♻️ (chatView): refactor clearChat function to use mutateFlowPool for deletion
…s for clarity

♻️ (index.tsx): update import and usage of useDeleteFLowPool to useDeleteBuilds
✨ (PageComponent): integrate use-get-builds query for fetching builds
✨ (flowStore): add setters for inputs, outputs, and hasIO in flowStore
… outputs

🔥 (flowStore.ts): remove unused resetFlow function to clean up the codebase
…arams

✨ (PageComponent): add logic to handle flow state, inputs, outputs, and viewport
♻️ (flowStore): refactor and add resetFlow method to handle flow state reset
✅ (generalBugs-shard-3.spec.ts): add end-to-end test for playground button state
@Cristhianzl Cristhianzl removed the request for review from lucaseduoli July 29, 2024 22:34
@Cristhianzl Cristhianzl enabled auto-merge (squash) July 29, 2024 22:49
@Cristhianzl Cristhianzl merged commit a811834 into main Jul 29, 2024
49 checks passed
@Cristhianzl Cristhianzl deleted the refactor/deleteBuild branch July 29, 2024 22:56
nicoloboschi pushed a commit to datastax/ragstack-ai-langflow that referenced this pull request Jul 30, 2024
…#2622)

* ✨ (constants.ts): add BUILDS endpoint to URLs constants
✨ (index.ts): create index file for builds-related queries
✨ (use-delete-builds.ts): implement useDeleteFLowPool hook for deleting builds

* ✨ (chatView): integrate useDeleteFlowPool hook for deleting flow pool
♻️ (chatView): refactor clearChat function to use mutateFlowPool for deletion

* ♻️ (use-delete-builds.ts): rename useDeleteFLowPool to useDeleteBuilds for clarity
♻️ (index.tsx): update import and usage of useDeleteFLowPool to useDeleteBuilds

* ✨ (API): add use-get-builds query to fetch build data
✨ (PageComponent): integrate use-get-builds query for fetching builds
✨ (flowStore): add setters for inputs, outputs, and hasIO in flowStore

* ♻️ (flowStore.ts): refactor hasIO to derive its value from inputs and outputs
🔥 (flowStore.ts): remove unused resetFlow function to clean up the codebase

* ♻️ (use-get-builds.ts): refactor useGetBuildsQuery to remove unused params
✨ (PageComponent): add logic to handle flow state, inputs, outputs, and viewport
♻️ (flowStore): refactor and add resetFlow method to handle flow state reset

* ✅ (chatComponent): add data-testid attributes for better testability
✅ (generalBugs-shard-3.spec.ts): add end-to-end test for playground button state

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
(cherry picked from commit a811834)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer refactor Maintenance tasks and housekeeping size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants