Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue 4539, qf shown in donation success page for estimated matching amount #4775

Merged
merged 6 commits into from
Sep 30, 2024

Conversation

HrithikSampson
Copy link
Collaborator

@HrithikSampson HrithikSampson commented Sep 25, 2024

relates to #4539

Summary by CodeRabbit

  • New Features

    • Enhanced messaging for donation eligibility and matching funds across English, Spanish, and Catalan languages.
    • Added a new link for users to navigate back to project listings.
    • Introduced new toast notifications for matching funds, improving user engagement.
  • Bug Fixes

    • Clarified conditions for donation matching eligibility to improve user understanding.

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giveth-dapps-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 6:34am

Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

The pull request introduces changes focused on updating text strings related to donation eligibility and matching notifications across multiple language files. The updates clarify the conditions for quadratic funding eligibility, including a minimum donation requirement. The modifications simplify titles and enhance the clarity of messaging, aiming to improve user engagement.

Changes

File Change Summary
lang/ca.json, lang/en.json, lang/es.json Updates to text strings related to donation eligibility and matching notifications, clarifying conditions and simplifying titles.

Possibly related PRs

Suggested labels

Code Review

Suggested reviewers

  • Meriem-BM
  • MohammadPCh

Poem

🐰 In the world of gifts so grand,
We share our joy, we take a stand.
With clearer words, the path is bright,
For matching funds, let’s unite!
So hop along, dear friends, and cheer,
Together we’ll make giving dear! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 00459c3 and 2527b3f.

📒 Files selected for processing (3)
  • lang/ca.json (1 hunks)
  • lang/en.json (2 hunks)
  • lang/es.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • lang/ca.json
  • lang/en.json
  • lang/es.json

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
src/apollo/gql/gqlQF.ts (1)

21-21: LGTM! Consider adding a comment for clarity.

The addition of the minimumValidUsdValue field to the QF_ROUNDS_QUERY is appropriate and aligns with the query's purpose. This change will allow fetching the minimum valid USD value for QF rounds, which is likely related to donation eligibility as mentioned in the PR objectives.

Consider adding a brief comment above this field to explain its purpose, e.g.:

 allocatedTokenSymbol
+// Minimum USD value for a valid donation in this QF round
 minimumValidUsdValue

This would enhance code readability and make it easier for other developers to understand the significance of this field.

src/components/views/donate/QFToast.tsx (3)

15-15: Reorder imports for consistency

The new import for useRouter should be placed before the import of local modules for better organization and consistency with best practices.

Consider reordering the imports as follows:

+import { useRouter } from 'next/router';
import { EQFElegibilityState, usePassport } from '@/hooks/usePassport';
import PassportModal from '@/components/modals/PassportModal';
-import { useRouter } from 'next/router';
🧰 Tools
GitHub Check: build

[failure] 15-15:
next/router import should occur before import of @/hooks/usePassport


51-58: Approve logic changes and address formatting

The updates to the description logic for both eligible and non-eligible users improve the clarity of the messages by including specific values. This aligns well with the PR objectives of enhancing user experience.

However, there are some minor formatting issues that should be addressed:

  1. Add a semicolon at the end of line 58.
  2. Adjust the formatting of the object passed to formatMessage on lines 64-65 for consistency:
 description = (
   <>
     {formatMessage({
       id: 'page.donate.passport_toast.description.non_eligible',
-    },{
-      usd_value: currentRound?.minimumValidUsdValue,
+    }, {
+      usd_value: currentRound?.minimumValidUsdValue
     })}{' '}
     <span>{endDate}</span>
   </>
 );

Also applies to: 64-65

🧰 Tools
GitHub Check: build

[failure] 58-58:
Insert ;


79-90: Approve new navigation feature with suggestions

The addition of a navigation button for eligible users is a great improvement to the user experience, aligning well with the PR objectives.

Consider the following improvements:

  1. Use a constant or configuration value for the "/qf" route to make it easier to update if the route changes in the future.
  2. Use single quotes for consistency with the rest of the codebase:
-onClick={() => router.push("/qf")}
+onClick={() => router.push('/qf')}
  1. Consider extracting the button component to a separate variable to improve readability:
const EligibleButton = (
  <Button
    label={formatMessage({
      id: 'qf_donor_eligibility.banner.link.back_to_project',
    })}
    buttonType='primary'
    size='small'
    icon={<IconExternalLink16 />}
    onClick={() => router.push('/qf')}
  />
);

// Then in the JSX:
{isEligible ? (
  <FlexCenter>
    {EligibleButton}
  </FlexCenter>
) : (
  // ... existing non-eligible button
)}
🧰 Tools
GitHub Check: build

[failure] 88-88:
Replace "/qf" with '/qf'

lang/es.json (1)

Line range hint 1-2078: LGTM! Comprehensive Spanish translations for Giveth.

The file contains a thorough set of Spanish translations for the Giveth application. The JSON structure is valid, and the use of placeholders for dynamic content is appropriate.

Consider adding comments or grouping related translations to improve maintainability for future updates. For example:

{
  // User-related translations
  "label.user_donations": "Donaciones de {userName}",
  "label.user_projects": "Proyectos de {userName}",
  
  // Project-related translations
  "label.project_name": "Nombre del Proyecto",
  "label.project_details": "Detalles del Proyecto"
}

This organization can help developers quickly locate and update specific sections of the translations.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between afa3732 and 241dbb1.

📒 Files selected for processing (5)
  • lang/ca.json (1 hunks)
  • lang/en.json (2 hunks)
  • lang/es.json (1 hunks)
  • src/apollo/gql/gqlQF.ts (1 hunks)
  • src/components/views/donate/QFToast.tsx (4 hunks)
🧰 Additional context used
GitHub Check: build
src/components/views/donate/QFToast.tsx

[failure] 15-15:
next/router import should occur before import of @/hooks/usePassport


[failure] 58-58:
Insert ;


[failure] 62-62:
Insert ⏎↹↹↹↹↹


[failure] 63-63:
Insert


[failure] 64-64:
Replace }, with ↹},⏎↹↹↹↹↹


[failure] 65-65:
Insert


[failure] 88-88:
Replace "/qf" with '/qf'

🔇 Additional comments not posted (11)
src/apollo/gql/gqlQF.ts (1)

21-21: Verify usage of the new field in components

The addition of minimumValidUsdValue to the QF_ROUNDS_QUERY is correct. To ensure full implementation:

Please run the following script to check if the new field is being used in components:

This will help identify any components that might need updating to handle the new field.

✅ Verification successful

Usage of minimumValidUsdValue Verified

All components correctly utilize the new minimumValidUsdValue field.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of minimumValidUsdValue in component files

# Search for minimumValidUsdValue in TypeScript and JavaScript files
echo "Searching for minimumValidUsdValue usage:"
rg --type-add 'frontend:*.{ts,tsx,js,jsx}' -t frontend 'minimumValidUsdValue'

# Search for QF_ROUNDS_QUERY usage to identify potentially affected components
echo "\nComponents potentially needing updates for minimumValidUsdValue:"
rg --type-add 'frontend:*.{ts,tsx,js,jsx}' -t frontend 'QF_ROUNDS_QUERY'

Length of output: 1572

src/components/views/donate/QFToast.tsx (2)

24-27: LGTM: Improved component logic

The addition of the router constant and the isEligible check enhances the component's functionality and readability. These changes align well with the PR objectives of improving the user experience related to donation eligibility.


Line range hint 1-158: Overall approval with minor suggestions

The changes made to the QFToast component significantly improve the user experience related to donation eligibility, which aligns perfectly with the PR objectives. The addition of the navigation button for eligible users, the improved clarity in eligibility messages, and the overall restructuring of the component logic are all positive changes.

The suggestions provided in the previous comments (import reordering, formatting fixes, and refactoring the button component) are minor and do not detract from the overall quality of the changes. Once these small adjustments are made, this PR will be ready for merge.

Great work on enhancing the functionality and user experience of the donation success page!

🧰 Tools
GitHub Check: build

[failure] 58-58:
Insert ;


[failure] 62-62:
Insert ⏎↹↹↹↹↹


[failure] 63-63:
Insert


[failure] 64-64:
Replace }, with ↹},⏎↹↹↹↹↹


[failure] 65-65:
Insert


[failure] 66-66:
Replace } with ↹},⏎↹↹↹↹

lang/en.json (3)

1342-1344: Improved clarity in passport eligibility messages

The updates to the passport eligibility messages provide more specific information about the donation matching process. This change enhances user understanding of the eligibility criteria and the potential for matched donations.


1347-1347: Simplified title for non-eligible donors

The title for non-eligible donors has been updated to a more concise and impactful message: "Don't miss out!". This change improves the user experience by providing a clear and engaging call-to-action.


1695-1695: New translation added for QF donor eligibility banner

A new translation has been added for the "Back to projects" link in the QF donor eligibility banner. This improves navigation for users checking their eligibility status.

To ensure completeness, let's check if there are any other related translations that might be missing:

✅ Verification successful

Verification of QF Donor Eligibility Translations

All related translations for "qf_donor_eligibility" have been verified. The new "Back to projects" link is consistent with existing entries.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other qf_donor_eligibility related keys
grep -n "qf_donor_eligibility" lang/en.json

Length of output: 1783

lang/ca.json (5)

1344-1347: New translations for QF donor eligibility look good!

The added translations for Quadratic Funding donor eligibility messages are clear and consistent. They provide appropriate instructions for users to verify their eligibility and increase their Gitcoin Passport score if needed.


Line range hint 2190-2205: Profile QF donor eligibility translations are well-implemented!

The new and modified translations for the profile QF (Quadratic Funding) donor eligibility section are clear, consistent, and informative. They effectively guide users through the process of checking their eligibility, connecting their Gitcoin Passport, and understanding the required passport score. The translations maintain consistency with the English versions while providing appropriate Catalan language expressions.


Line range hint 2206-2248: Project GIVback toast translations are comprehensive and clear!

The new and modified translations for project GIVback toast messages cover a wide range of scenarios and project states. They provide clear and detailed information for both project owners and donors regarding GIVback eligibility, project status, and next steps. The translations are consistent with the context and offer appropriate guidance for various situations, from draft projects to verified and boosted projects.


Line range hint 2598-2607: Stream balance toast and tooltip translations are accurate and helpful!

The new translations for stream balance related toasts and tooltips effectively communicate important information about depositing, withdrawing, and managing stream balances. They provide clear warnings about the potential impact on recurring donations and offer helpful guidance to users. The translations are consistent with the context and accurately convey the necessary information to help users manage their stream balances effectively.


Line range hint 1-2607: Overall, excellent additions and modifications to the Catalan translations!

The changes made to this file significantly improve the Catalan language support for various features of the platform. The new translations for Quadratic Funding donor eligibility, profile QF eligibility, project GIVback toasts, and stream balance management are clear, consistent, and informative. They provide users with accurate guidance and information across different scenarios and features. These updates will enhance the user experience for Catalan-speaking users of the platform.

…_user_donates_less_than_minimum_$

Update Branch
…_user_donates_less_than_minimum_$

Update Branch
Copy link
Collaborator

@RamRamez RamRamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HrithikSampson HrithikSampson merged commit 3b54119 into develop Sep 30, 2024
3 checks passed
@HrithikSampson HrithikSampson deleted the 4539_user_donates_less_than_minimum_$ branch September 30, 2024 10:53
@coderabbitai coderabbitai bot mentioned this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: QA
Development

Successfully merging this pull request may close these issues.

2 participants