You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented infinite scrolling and search functionality on table modal search inputs on the Team Permissions page.
Changes Made
Added infinite scrolling and search functionality to the Autocomplete component for members, projects, and engine in the modal
Added limit, offset, searchTerm data fields to the getNonTeamUsers, getUnassignedTeamProjects, and getUnassignedTeamEngines pixel calls.
Added ID to the project and engine dropdown labels
How to Test
Steps to reproduce/test the behavior
On the Team Permissions page, when you click "Add Members", "Add Projects", or "Add Engines", it brings up a modal with a search input.
Test the infinite scroll functionality within the autocomplete search component.
When typing in the search input, check the network console to ensure that the search triggers a query to the back-end.
Expected outcomes
As you scroll near the bottom of the search component, a query gets called to grab the next set of 10 items.
When typing in the search input, the search triggers a query to the back-end.
feat(client): implemented infinite scrolling on table modals in Team …
User description
Description
Implemented infinite scrolling and search functionality on table modal search inputs on the Team Permissions page.
Changes Made
Added infinite scrolling functionality to the Autocomplete component for members, projects, and engine in the modal
Added limit, offset, searchTerm data fields to the getNonTeamUsers, getUnassignedTeamProjects, and getUnassignedTeamEngines pixel calls.
How to Test
Steps to reproduce/test the behavior
On the Team Permissions page, when you click "Add Members", "Add Projects", or "Add Engines", it brings up a modal with a search input.
Test the infinite scroll functionality within the autocomplete search component.
When typing in the search input, check the network console to ensure that the search triggers a query to the back-end.
Expected outcomes
Notes
PR Type
Enhancement
Description
Added infinite scroll and search in team modals.
Integrated offset, limit, and loading state management.
Updated Autocomplete for engines, members, and projects.
Extended API calls with new pagination parameters.
Changes walkthrough 📝
Relevant files
Enhancement
TeamEnginesTable.tsx
Infinite scroll and search integration for engines table
The new additions for API calls include parameters (limit, offset, searchTerm) that are conditionally added based on truthiness. Since a value of 0 or an empty string is falsy in JavaScript, these checks might unintentionally skip valid values. Consider using explicit checks (e.g., comparing to undefined) to ensure proper parameter passing.
The implementation for infinite scrolling and search (including state resets in onInputChange and useEffect dependency on offset and searchEngineInput) should be closely validated to ensure that data isn’t accidentally cleared or fetched multiple times. Verify that scroll detection via nearBottom and state updates (e.g., offset increments) work together as expected.
Similar infinite scrolling and debounced search logic have been applied here. Double-check that resetting of nonCredentialedUsers and managing of loading states do not lead to race conditions or unexpected behavior when rapidly changing the search input.
const[teamMembers,setTeamMembers]=useState(null);const[memberCount,setMemberCount]=useState(null);const[hasMembers,setHasMembers]=useState(false);constlimit=5;const[searchMemberInput,setSearchMemberInput]=useState<string>('');const[offset,setOffset]=useState(AUTOCOMPLETE_OFFSET);const[isScrollBottom,setIsScrollBottom]=useState(false);const[canCollect,setCanCollect]=useState<boolean>(true);const[isLoading,setIsLoading]=useState<boolean>(false);const[searchLoading,setSearchLoading]=useState(false);constnearBottom=(target: {scrollHeight?: number;scrollTop?: number;clientHeight?: number;}={},)=>{constdiff=Math.round(target.scrollHeight-target.scrollTop);returndiff-25<=target.clientHeight;};/** * @name getAdditionalUsersNonGroup */constgetAdditionalUsersNonGroup=()=>{setOffset(offset+AUTOCOMPLETE_LIMIT);};constmemberSearchRef=useRef(undefined);const{ watch, setValue }=useForm<{SEARCH_FILTER: string;}>({defaultValues: {// Filters for Members tableSEARCH_FILTER: '',},});constsearchFilter=watch('SEARCH_FILTER');/** * @name useEffect * @desc - sets members in react hook form */useEffect(()=>{monolithStore.getTeamUsers(groupId,limit,membersPage*limit-limit,// offsetsearchFilter,).then((data)=>{setTeamMembers(data);setHasMembers(true);});},[]);useEffect(()=>{if(isScrollBottom){if(canCollect){getAdditionalUsersNonGroup();}}},[isScrollBottom]);useEffect(()=>{if(searchMemberInput){setSearchLoading(true);}consttimer=setTimeout(()=>{if(!offset){getUsersNonGroup(false);}else{if(canCollect){getUsersNonGroup(false);}else{getUsersNonGroup(true);}}},500);return()=>clearTimeout(timer);},[offset,searchMemberInput]);
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
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
Implemented infinite scrolling and search functionality on table modal search inputs on the Team Permissions page.
Changes Made
How to Test
On the Team Permissions page, when you click "Add Members", "Add Projects", or "Add Engines", it brings up a modal with a search input.
As you scroll near the bottom of the search component, a query gets called to grab the next set of 10 items.
When typing in the search input, the search triggers a query to the back-end.
Notes