fix: data refreshing on first render is restricted to avoid multiple api calls and optimised the handling of search query params - #1231
Merged
yoganandaness merged 7 commits intoNov 3, 2025
Conversation
…api calls and optimised the handling of search query params
yoganandaness
requested review from
TCMeldrum,
deepaksftc and
janosbabik
and removed request for
a team
October 20, 2025 11:18
deepaksftc
approved these changes
Oct 22, 2025
janosbabik
requested changes
Oct 30, 2025
janosbabik
left a comment
Contributor
There was a problem hiding this comment.
Hi @yoganandaness !
It looks good, just a small request from my side.
| <ReduceCapacityIcon data-cy="bulk-reassign-reviews" /> | ||
| ); | ||
|
|
||
| const [isFirstRender, setIsFirstRender] = useState(true); |
Contributor
There was a problem hiding this comment.
if we really need to track it, can we use useRef instead of useState?
| let isMounted = true; | ||
|
|
||
| if (isMounted) { | ||
| if (isMounted && !isFirstRender) { |
Contributor
There was a problem hiding this comment.
I think the original implementation was not correct, using isMounted here doesn’t make sense, it’s being used incorrectly.
We can simplify it like this:
useEffect(() => {
if (isFirstRender.current) {
isFirstRender.current = false;
return;
}
refreshTableData();
}, [proposalFilter]);
Contributor
Author
There was a problem hiding this comment.
Nice point. Yes, we dont need the isMounted
yoganandaness
enabled auto-merge (squash)
October 31, 2025 13:15
janosbabik
approved these changes
Nov 3, 2025
yoganandaness
deleted the
SWAP-4986-user-office-proposal-popup-does-not-show-up
branch
November 3, 2025 09:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Proposal table have few usability issues
The above have been fixed by ensuring that the refreshing of table happens only on filter changes and not on first rendering. Also the setting of search params have been optimised in such a way that it does not resets the other ones
Motivation and Context
Improve the usability of the the Proposal Table and ensuing persistence of the query params, so that the page refresh shows the same result
How Has This Been Tested
Manually
Fixes
Changes
In Proposal Table component, the search params handling and the refreshing data restriction has been done
Depends on
Tests included/Docs Updated?