Fixes #38591 - Api calls refactor#988
Conversation
32d0976 to
dbe8a11
Compare
5e5a4e9 to
c0053b6
Compare
c0053b6 to
22571d0
Compare
|
This makes it so if a users selects all hosts, and opens in a new tab, only the first page is opened, instead of the first 100 |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors API calls in the JobInvocationDetail component to remove duplicated useApi hooks and unify API call handling. The changes replace multiple useAPI hooks with a single dispatch-based approach using Redux APIActions, and reorganize the code structure for better maintainability.
Key changes:
- Replaced multiple
useAPIhooks with unified Redux dispatch approach usingAPIActions.get - Restructured component state management and API response handling
- Added new constant
JOB_INVOCATION_PAGEfor API key management
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| JobInvocationHostTable.js | Major refactor replacing useAPI hooks with Redux dispatch, restructuring state management and API call logic |
| JobInvocationConstants.js | Added new constant JOB_INVOCATION_PAGE for API key management |
|
Needs a rebase |
22571d0 to
02696f9
Compare
Can you please retest it now? Opening in new tabs has its own limit |
|
since nothing calls for the first 100 ( per_page = MAX_HOSTS_API_SIZE) it still only opens the first page instead of the first 100 |
|
also it auto sets per page to 20 instead of the user per_page |
|
changing per_page adds brackets around the search, and then every page change adds more brackets, searching by clicking on the chart doesnt work anymore |
02696f9 to
e77f3c5
Compare
Fixed
Fixed
I couldn't replicate this issue |
|
to replicate - have a job run on 21+ hosts, open the job details page, make sure per page is less than the amount of hosts (usually set to 20) click on the open all tab, the number shown in the modal is the per page number, and not all hosts number |
e77f3c5 to
ee2a4a9
Compare
Added old MAX_HOSTS const to load only first 100 |
ee2a4a9 to
8209cd4
Compare
8209cd4 to
f8459cf
Compare
|
After discussion with @MariaAga new behavior is:
|
Unable to reproduce not opening page if nothing selected, other fixed |
54ea3ed to
51dd9b9
Compare
Ad. refactored opening new tabs, now it should be working |
51dd9b9 to
c4013a6
Compare
c4013a6 to
ef0bc78
Compare
|
clicking the chart seems to add conditions instead of replacing them |
re fixed it, hopefully this will stop the circle of fixing something, and breaking something else :) |
ef0bc78 to
b9c61d5
Compare
b9c61d5 to
49a2cf1
Compare
49a2cf1 to
0baa83c
Compare
kmalyjur
left a comment
There was a problem hiding this comment.
Thank you for your edits! I'll be a bit annoying and leave one last comment, but after that, it should be ready to get merged. However, after yesterday's discussion on the planning, we'll need to wait a little before merging.
0baa83c to
6a7e3e8
Compare
6a7e3e8 to
3199f86
Compare
|
Rebase |
|
Thanks everyone! |

Remove useApi duplicates, unify calls