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

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

Merged

Conversation

HrithikSampson
Copy link
Collaborator

@HrithikSampson HrithikSampson commented Oct 1, 2024

Reverts #4775

Summary by CodeRabbit

  • New Features

    • Enhanced localization support with updated translations for Catalan, Spanish, and English, improving user experience across the platform.
    • Refined eligibility messaging for donations, including clearer instructions and context for users regarding matching funds.
  • Bug Fixes

    • Improved clarity in toast messages and notifications related to donation eligibility and matching processes.
  • Documentation

    • Updated various labels and descriptions for better consistency and readability within the platform.

Copy link

vercel bot commented Oct 1, 2024

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

Name Status Preview Comments Updated (UTC)
giveth-dapps-v2 ❌ Failed (Inspect) Oct 1, 2024 10:32am

Copy link
Contributor

coderabbitai bot commented Oct 1, 2024

Walkthrough

The changes involve updates to localization files for the Giveth platform, enhancing translations for user interface elements in Catalan, English, and Spanish. The modifications include refining messages related to donations, eligibility for matching funds, and project descriptions. Additionally, adjustments were made to the GraphQL query structure and the QFToast component to improve the clarity of eligibility messaging and user interactions.

Changes

Files Change Summary
lang/ca.json, lang/en.json, lang/es.json Localization updates with refined translations for user-facing messages regarding donations and eligibility.
src/apollo/gql/gqlQF.ts Removed the minimumValidUsdValue field from the QF_ROUNDS_QUERY.
src/components/views/donate/QFToast.tsx Updated eligibility messaging and button functionality in the QFToast component.

Possibly related PRs

Suggested reviewers

  • MohammadPCh
  • Meriem-BM
  • kkatusic
  • RamRamez

🐇 In the fields where donations flow,
Translations bloom, and clarity grows.
With toasts that cheer and messages bright,
Giveth's spirit shines, a guiding light.
Let's hop along, with joy we embrace,
A platform of kindness, a warm, friendly space! 🌼


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: 1

🧹 Outside diff range and nitpick comments (2)
src/components/views/donate/QFToast.tsx (1)

Line range hint 78-90: LGTM: Well-implemented conditional button rendering

The conditional rendering of the eligibility check button for non-eligible users is well-implemented. The button's functionality and styling are appropriate for its purpose.

For consistency with the rest of the codebase, consider using object property shorthand for the onClick prop:

onClick={() => setShowModal(true)}

This minor change would align with modern JavaScript conventions and potentially with your project's style guide.

lang/ca.json (1)

Line range hint 1-3215: Overall, the translations appear to be comprehensive and well-structured.

The file contains a large number of translations for various UI elements, messages, and descriptions in Catalan. The structure of the JSON is correct, and there are no apparent syntax errors.

However, I have a few observations and suggestions:

  1. Consistency: The use of terminology seems consistent throughout the file. For example, "GIVbacks", "GIVstream", and "GIVpower" are consistently used without translation, which is good for maintaining brand identity.

  2. Placeholders: The use of placeholders (e.g., {count}, {percent}, {value}) is consistent and appears to be correct. This is important for dynamic content.

  3. HTML Tags: There are some HTML tags used in the translations (e.g., <strong>, <!--, -->). Ensure that these are intentional and properly handled in the application.

  4. Long Translations: Some translations are quite long. Consider breaking them into smaller, more manageable pieces if possible, to make maintenance easier.

  5. Untranslated Terms: Some technical terms are left in English (e.g., "Mainnet", "Gnosis Chain"). This is often acceptable for technical terms, but ensure it's intentional.

  6. Quotation Marks: There's inconsistent use of quotation marks. Some use straight quotes (") while others use curly quotes ("). It would be better to standardize this throughout the file.

  7. Capitalization: There's some inconsistency in capitalization, especially in titles. For example, "Què és Giveth?" vs "Què És Ethereum?". Consider standardizing the capitalization rules for titles.

Consider standardizing the use of quotation marks and capitalization rules throughout the file for better consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e0d4ab0 and 7190a01.

📒 Files selected for processing (5)
  • lang/ca.json (1 hunks)
  • lang/en.json (1 hunks)
  • lang/es.json (1 hunks)
  • src/apollo/gql/gqlQF.ts (0 hunks)
  • src/components/views/donate/QFToast.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • src/apollo/gql/gqlQF.ts
🔇 Additional comments (12)
src/components/views/donate/QFToast.tsx (2)

63-65: LGTM: Clean implementation of non-eligible description

The changes in this segment are well-implemented. The use of JSX fragments to combine the formatted message with the date span is appropriate and follows React best practices. The spacing is handled correctly, ensuring good readability of the final rendered text.


Line range hint 1-138: Summary: Changes align with PR objectives and improve user experience

The modifications to the QFToast component successfully revert the changes related to the display of QF information on the donation success page, as per the PR objectives. The updates improve the clarity of messaging for both eligible and non-eligible users, enhancing the overall user experience.

Key improvements include:

  1. More contextual information for eligible users, including the current round's name.
  2. Simplified date formatting for better readability.
  3. Appropriate conditional rendering of the eligibility check button for non-eligible users.

These changes are well-implemented and consistent with React and TypeScript best practices. The code is clean, readable, and maintainable.

This pull request appears ready for merging, pending any additional team-specific review processes or testing requirements.

lang/en.json (4)

1351-1352: Improved clarity on donation matching eligibility

The updated text provides more specific information about donation matching eligibility, which is helpful for users. This change improves the clarity of the message.


1353-1353: Clear call-to-action for non-eligible users

The updated text provides a clear instruction for users who are not currently eligible for donation matching. It encourages them to check their QF Eligibility, which is a good way to guide users towards becoming eligible.


1356-1356: Effective call-to-action for non-eligible users

The new title for non-eligible users creates a sense of urgency and encourages them to take action. This change is likely to increase user engagement with the donation matching feature.


1351-1356: Overall improvement in donation matching messaging

The changes in this file collectively enhance the messaging around donation matching eligibility. The new text provides clearer information, stronger calls-to-action, and creates a sense of urgency for users to engage with the feature. These improvements are consistent with the style and tone of the rest of the localization strings and should positively impact user engagement.

lang/es.json (4)

1351-1353: Improved clarity in donation eligibility descriptions

The changes in these lines enhance the clarity and accuracy of the passport toast descriptions for donation eligibility. The new wording provides more specific information about the donation matching process, including details about fraud protection review and the timing of complementary funds distribution.


1356-1356: More engaging title for non-eligible passport toast

The change in this line transforms the title of the non-eligible passport toast from a statement to a call-to-action. The new wording "¡No te pierdas la oportunidad!" (Don't miss the opportunity!) is more engaging and motivational, which could encourage users to take steps to become eligible for donation matching.


Line range hint 1357-1369: Enhanced clarity on donation processes and eligibility

These changes provide more detailed and specific information about donation processes and eligibility criteria. Key improvements include:

  1. Clear thresholds for donation amounts that make users eligible for GIVbacks or unlock matching funds.
  2. Explicit statements about project and network eligibility for quadratic funding and GIVbacks.
  3. New translations that clarify when donations will be matched.

These additions and modifications significantly improve the user's understanding of how their donations interact with various platform features.


Line range hint 1370-2037: Comprehensive update to Spanish translations

This extensive update to the Spanish translations significantly enhances the clarity and completeness of the language used throughout the platform. Key improvements include:

  1. More detailed explanations of project verification processes and statuses.
  2. Clearer descriptions of donor eligibility criteria and benefits.
  3. Updated terminology for various platform features and processes.
  4. New translations covering a wide range of topics, ensuring a more comprehensive Spanish language experience.

These changes will greatly improve the user experience for Spanish-speaking users, providing them with more accurate and detailed information about the platform's features and processes.

lang/ca.json (2)

Line range hint 3216-3216: The file ends properly with no trailing commas or characters.

The JSON file is properly closed, which is good practice.


Line range hint 1-3216: Overall, the Catalan translation file is well-structured and comprehensive.

The translations appear to cover a wide range of UI elements and messages, which is commendable. The use of placeholders for dynamic content is consistent, and brand-specific terms are maintained across translations.

However, there are some areas for improvement:

  1. Standardize the use of quotation marks (straight vs. curly).
  2. Ensure consistent capitalization rules, especially in titles.
  3. Consider breaking down very long translations into smaller, more manageable pieces.
  4. Review the intentional use of HTML tags within translations.

These improvements would enhance the overall quality and consistency of the translations. Great job on providing such a comprehensive Catalan language support!

Comment on lines +49 to +59
' ' +
currentRound?.name +
' ' +
formatMessage({
id: 'page.donate.passport_toast.description.eligible_2',
id: 'label.ends_on',
}) +
' ' +
currentRound?.name +
'.';
endDate +
formatMessage({
id: 'page.donate.passport_toast.description.eligible_2',
});
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider using template literals for improved readability

The current string concatenation could be made more readable and maintainable by using template literals. This would also help to avoid potential spacing issues.

Consider refactoring the description generation as follows:

description = `${formatMessage({
  id: 'page.donate.passport_toast.description.eligible',
})} ${currentRound?.name} ${formatMessage({
  id: 'label.ends_on',
})} ${endDate}${formatMessage({
  id: 'page.donate.passport_toast.description.eligible_2',
})}`;

This change would make the code more concise and easier to read while maintaining the same functionality.

Copy link
Collaborator

@MohammadPCh MohammadPCh left a comment

Choose a reason for hiding this comment

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

@MohammadPCh MohammadPCh merged commit a54076c into develop Oct 1, 2024
1 of 3 checks passed
@MohammadPCh MohammadPCh deleted the revert-4775-4539_user_donates_less_than_minimum_$ branch October 1, 2024 12:31
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