Fix DAF contribution display in Recent Activity sidebar#706
Open
TylerDiorio wants to merge 2 commits intomainfrom
Open
Fix DAF contribution display in Recent Activity sidebar#706TylerDiorio wants to merge 2 commits intomainfrom
TylerDiorio wants to merge 2 commits intomainfrom
Conversation
- Add 'contributed to' action label for USDFUNDRAISECONTRIBUTION posts - Handle USDFUNDRAISECONTRIBUTION as a specific post type in ActivityCard - Add specific transformation logic for USDFUNDRAISECONTRIBUTION in feed.ts - Use fundraise post title and link when available for better UX Co-authored-by: Tyler Diorio <TylerDiorio@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…ling - Remove duplicate transformation block for USDFUNDRAISECONTRIBUTION - Handle DAF contributions in existing POST transformation logic - Use conditional checks for title/image from fundraise data - Reduce code duplication from 59.3% to minimal This fixes SonarCloud duplication warning while maintaining same functionality. Co-authored-by: Tyler Diorio <TylerDiorio@users.noreply.github.com>
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.


Problem
DAF (Donor-Advised Fund) contributions were displaying incorrectly in the Recent Activity sidebar on the
/fundpage. Instead of showing a properly formatted entry like "Tyler Diorio contributed to [Fundraise Name]", they were showing the raw content type: "Tyler Diorio posted discussion USDFUNDRAISECONTRIBUTION #8".Root Cause
The
USDFUNDRAISECONTRIBUTIONcontent type from the backend API was not being handled explicitly in the frontend code. It was falling through to the default case in the feed transformation logic, which generated a generic title using the raw content_type string.Solution
Added specific handling for
USDFUNDRAISECONTRIBUTIONposts in three places:1. ActivityCard Component (
components/Funding/ActivityCard.tsx)'contributed to'action label for USDFUNDRAISECONTRIBUTION postsgetActionLabel()to check for USDFUNDRAISECONTRIBUTION post typegetEntryMeta()to use the associated fundraise's title and link when available2. Feed Transformation (
types/feed.ts)transformFeedEntry()functionTesting
Impact
Fixes #[issue-number-if-available]
Relates to feedback from Slack: https://researchhub.slack.com/archives/[channel-id]/p[timestamp]
Slack Thread