164 dev camila/make my grants match to the current users email #177
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.
164 dev ℹ️ make my grants match to the current users email
Closes
📝 Description
Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.
Briefly list the changes made to the code:
Added support for viewing a personalized “My Grants” page that filters and displays only the grants where the logged-in user is the BCAN POC. The functionality filters the existing grants page and avoids redundant use of code duplication and maintains consistent styling. This is important so that users are able to more easily see their grants, which improves usability.
Code changes:
-Updated GrantPage.tsx to accept a new prop showOnlyMyGrants, which controls whether the page filters the grants based on the user’s email
-Modified GrantList.tsx to conditionally filter grants by comparing each grant’s bcan_poc.POC_email to the logged-in user’s email when showOnlyMyGrants is true
-Integrated useAuthContext() in GrantPage.tsx to retrieve the current user’s information for filtering
For Ben: The user object is accessed in GrantPage.tsx via useAuthContext(), and the user’s email is passed down to GrantList as currentUserEmail.
✔️ Verification
What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.
Provide screenshots of any new components, styling changes, or pages.
Since the user object isn't being passed in yet from the backend, I ensured there were no errors in VSCode, confirmed that the new my-grants route correctly renders the same UI as the my-grants-route by running locally, and reviewed the filtering logic. I did not add a mock user since it would just need to be removed later, and we don't test frontend features normally.
Test Changes
If your new feature required some test to be changed or added to fit the new functionality or changes please document these changes here.
🏕️ (Optional) Future Work / Notes
Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!