fix: auto-refresh job and queue list after successful creation#247
fix: auto-refresh job and queue list after successful creation#247gautamsidhwani29 wants to merge 2 commits into
Conversation
Signed-off-by: gautamsidhwani29 <gautamsidhwani405@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @gautamsidhwani29! It looks like this is your first PR to volcano-sh/dashboard 🎉 |
There was a problem hiding this comment.
Code Review
This pull request ensures that the UI stays in sync by triggering data refreshes after successfully creating jobs or queues. Feedback suggests awaiting the asynchronous fetch calls to prevent premature loading state termination, resetting pagination to the first page for better visibility of new items, and cleaning up a trailing space.
| } | ||
|
|
||
| alert("Job created successfully!"); | ||
| fetchJobs(); |
There was a problem hiding this comment.
| } | ||
|
|
||
| alert("Queue created successfully!"); | ||
| fetchQueues(); |
There was a problem hiding this comment.
The fetchQueues() call should be awaited. Currently, because it is an asynchronous call and not awaited, the finally block at line 80 will execute immediately after the fetch starts, setting loading to false while the data is still being retrieved. This causes the loading indicator to disappear prematurely. Additionally, resetting the pagination to the first page ensures the user sees the newly created queue.
| fetchQueues(); | |
| setPagination((prev) => ({ ...prev, page: 1 })); | |
| await fetchQueues(); |
Signed-off-by: gautamsidhwani29 <gautamsidhwani405@gmail.com>
Problem
When a user creates a new Job or Queue via the dashboard UI, the data grid does not automatically refresh to show the newly created resource. The user must manually click the "Refresh" button.
Fixes:
#236
Fix
fetchJobs()call after successful job creation inJobs.jsxfetchQueues()call after successful queue creation inQueues.jsxTesting