-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Decentralized Verification: Moving from verified to vouches #4729
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request introduces enhancements to the localization of a software application, focusing on project verification and GIVbacks eligibility. It adds new labels and modifies existing ones across multiple language files, aiming to clarify project statuses and improve user experience related to donations and project visibility. Changes
Possibly related PRs
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (3)
Files skipped from review due to trivial changes (1)
Files skipped from review as they are similar to previous changes (2)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (3)
src/components/badges/GivBackBadge.tsx (1)
1-36
: Excellent work on the GivBackBadge component!The component is well-structured, uses styled-components for styling, and follows internationalization best practices. Great job!
Just a couple of suggestions to further improve the component:
Accessibility: Consider using a more semantically meaningful HTML element for the wrapper (e.g.,
<span>
or<div role="status">
), or add appropriate ARIA attributes to improve accessibility for screen readers.Prop Types: Consider adding prop types to the component to catch potential bugs and improve code maintainability. You can use the
PropTypes
package from theprop-types
library to define the expected types of the component's props.Other than that, the component looks great! Let me know if you have any questions or need further assistance.
src/components/project-card/ProjectCard.tsx (1)
65-65
: Nitpick: Remove the empty line.The empty line is unnecessary and can be removed to keep the code clean.
Apply this diff to remove the empty line:
-
lang/en.json (1)
1114-1114
: Consider using snake case for consistency.The addition of the
"label.isGivbackEligible"
label looks good and matches the summary of changes. However, the label name uses camel case, which is inconsistent with the snake case convention used for other labels in this file.I recommend updating the label name to use snake case:
"label.is_givback_eligible"
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (16)
- lang/ca.json (4 hunks)
- lang/en.json (3 hunks)
- lang/es.json (3 hunks)
- src/apollo/gql/gqlProjects.ts (4 hunks)
- src/apollo/types/types.ts (1 hunks)
- src/components/DonateSocialBox.tsx (1 hunks)
- src/components/badges/GivBackBadge.tsx (1 hunks)
- src/components/badges/VerifiedBadge.tsx (1 hunks)
- src/components/menu/FilterMenu.tsx (1 hunks)
- src/components/project-card/ProjectCard.tsx (5 hunks)
- src/components/views/donate/DonateIndex.tsx (1 hunks)
- src/components/views/donate/DonatePageProjectDescription.tsx (2 hunks)
- src/components/views/donate/OnTime/OneTimeDonationCard.tsx (2 hunks)
- src/components/views/donate/Recurring/RecurringDonationCard.tsx (1 hunks)
- src/components/views/project/ProjectBadges.tsx (3 hunks)
- src/components/views/project/ProjectGIVbackToast.tsx (5 hunks)
Files skipped from review due to trivial changes (1)
- src/components/DonateSocialBox.tsx
Additional comments not posted (31)
src/components/badges/VerifiedBadge.tsx (1)
15-15
: Verify the impact of the terminology change.The change from "verified" to "vouched" is straightforward and does not affect the functionality of the component. However, it's important to consider the following:
- Ensure that this change in terminology aligns with the overall design and messaging of the application.
- Verify that the new term "vouched" accurately reflects the intended meaning and functionality of the badge.
- Review this change with the product team to confirm that it supports the desired user experience and perception.
src/components/views/project/ProjectBadges.tsx (4)
8-8
: LGTM!The import statement for
IconGIVBack16
is correct and necessary for the new badge.
19-20
: LGTM!The destructuring assignment for
isGivbackEligible
is correct and matches the alteration mentioned in the summary.
39-48
: LGTM! Verify the localization key exists.The new badge for projects that are eligible for Givback is correctly implemented:
- The conditional rendering logic based on the
isGivbackEligible
property is correct.- The badge text and icon are correctly set.
- The badge styling is correct.
Run the following script to verify if the localization key exists:
Verification successful
Localization Key Verified
The localization key
label.isGivbackEligible
exists in the localization files:
- Found in
./lang/ca.json
- Found in
./lang/es.json
- Found in
./lang/en.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if the localization key `label.isGivbackEligible` exists in the localization files. # Test: Search for the localization key in the localization files. Expect: At least one occurrence. fd --extension json --exec rg --iglob '!node_modules' --json $'"label.isGivbackEligible"'Length of output: 332678
33-33
: Verify the localization key exists.The change in the localization key from
label.verified
tolabel.vouched
is correct and reflects a semantic shift in the badge's meaning as mentioned in the summary.Run the following script to verify if the localization key exists:
Verification successful
Localization key
label.vouched
exists and is correctly implemented.The localization key
label.vouched
is present in the localization files, confirming that it is correctly defined and available for use. This aligns with the change in the code snippet. No further action is required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if the localization key `label.vouched` exists in the localization files. # Test: Search for the localization key in the localization files. Expect: At least one occurrence. fd --extension json --exec rg --iglob '!node_modules' --json $'"label.vouched"'Length of output: 332574
src/components/views/donate/DonatePageProjectDescription.tsx (1)
52-56
: LGTM!The conditional rendering of the
GivBackBadge
component based on theisGivbackEligible
property is implemented correctly. Wrapping the badge inside aFlex
container ensures proper layout and alignment. This change aligns with the PR objective of moving from verified to vouches by adding a visual indicator for GivBack eligibility, thereby improving the user experience by providing relevant information to donors.src/components/views/project/ProjectGIVbackToast.tsx (5)
44-51
: LGTM!The new variables are clear, descriptive, and correctly derived from the
projectData
object and theisAdmin
flag. They are used to determine the display logic for the toast notification.
Line range hint
90-231
: LGTM!The code segment is correctly using the new variables introduced earlier to determine the display logic for the toast notification. It is using the
formatMessage
function from thereact-intl
library to localize the text, and theOutlineButton
andExternalLink
components from the@giveth/ui-design-system
library to render the button and external links. The code segment is correctly handling the different project statuses and verification statuses.
217-231
: LGTM!The code segment is correctly using the new
isPublicVerifiedNotEligible
variable to determine the display logic for the case where a project is verified but not eligible for Givback. It is using theformatMessage
function from thereact-intl
library to localize the text, and theOutlineButton
component from the@giveth/ui-design-system
library to render the button.
Line range hint
280-290
: LGTM!The code segment is correctly using the
isOwnerGivbackEligible
variable to determine whether to render the note for the case where the project owner is eligible for Givback. It is using theformatMessage
function from thereact-intl
library to localize the text.
Line range hint
293-302
: LGTM!The code segment is correctly using the
link
variable to determine the URL of the external link to learn more about the Givback program. It is using theExternalLink
component to render the link, and theformatMessage
function from thereact-intl
library to localize the text.src/components/views/donate/DonateIndex.tsx (1)
125-125
: LGTM!The change from
project.verified
toproject.isGivbackEligible
for determining Givback eligibility is more precise and aligns with the intended logic. This change potentially affects which projects are considered eligible for Givback based on their specific Givback status rather than just their verification status.src/apollo/types/types.ts (1)
51-51
: LGTM!The addition of the
isGivbackEligible
optional property to theIProject
interface is a valid change that aligns with the PR objective. The property name follows the naming convention, the type is appropriate, and marking it as optional is suitable since not all projects may have this property.src/apollo/gql/gqlProjects.ts (4)
11-11
: LGTM!The addition of the
isGivbackEligible
field to thePROJECT_CORE_FIELDS
fragment is consistent with the alterations mentioned in the summary. The Boolean type is appropriate for representing eligibility.
146-146
: LGTM!The addition of the
isGivbackEligible
field to theFETCH_PROJECT_BY_SLUG_DONATION
query is consistent with the alterations mentioned in the summary. Its inclusion in the donation-related query suggests that the Givback eligibility status is relevant for donation functionalities.
216-216
: LGTM!The addition of the
isGivbackEligible
field to theFETCH_PROJECT_BY_SLUG_SINGLE_PROJECT
query is consistent with the alterations mentioned in the summary. Its inclusion in the single project query suggests that the Givback eligibility status is relevant for displaying individual project details.
601-601
: LGTM!The addition of the
isGivbackEligible
field to theADD_RECIPIENT_ADDRESS_TO_PROJECT
mutation response is consistent with the alterations mentioned in the summary. Its inclusion in the mutation response suggests that the Givback eligibility status is relevant when adding a recipient address to a project.src/components/project-card/ProjectCard.tsx (3)
17-17
: LGTM!The import for
IconGIVBack16
is correctly added.
77-78
: LGTM!The
isGivbackEligible
property is correctly added to theProjectCard
component's props and is used to conditionally render a visual indicator for projects that are eligible for GIVbacks.
344-361
: LGTM!The code changes to conditionally render the GIVbacks eligibility indicator and update the verified status label are correctly implemented. The changes enhance the functionality of the
ProjectCard
component by providing users with clearer information regarding GIVbacks eligibility and the verified status.Also applies to: 440-443
src/components/views/donate/OnTime/OneTimeDonationCard.tsx (1)
142-142
: LGTM!The change in the assignment of
projectIsGivBackEligible
is consistent with the renaming ofverified
toisGivbackEligible
. Looks good!src/components/views/donate/Recurring/RecurringDonationCard.tsx (1)
170-170
: LGTM!The change to use the
isGivbackEligible
property instead of theverified
property for determining the project's eligibility for the "Giv Back" program looks good. It makes sense to use a more specific property that is directly related to the "Giv Back" program eligibility.lang/en.json (2)
1113-1113
: LGTM!The addition of the
"label.vouched"
label looks good and matches the summary of changes.
1638-1638
: LGTM!The addition of the
"project.givback_toast.description.verified_public_not_eligible"
label looks good and matches the summary of changes.lang/es.json (4)
1110-1110
: LGTM!The new label
"label.vouched": "Avalado"
looks good.
1111-1111
: Looks good!The new label
"label.isGivbackEligible": "Elegible para GIVbacks"
and its Spanish translation are appropriate.
1633-1633
: Looks good to me!The new label
"project.givback_toast.description.verified_public_not_eligible"
and its Spanish description translation are appropriate.
1642-1642
: LGTM!The new label
"project.givback_toast.title.verified_public_not_eligible": "Boostea este proyecto con GIVpower!"
looks good.lang/ca.json (3)
1111-1112
: Labels for verification status look good.The new labels
"label.vouched"
and"label.isGivbackEligible"
have been added with appropriate translations. They align with the mentioned updates in the summary.
Line range hint
1632-1646
: New toast messages for GIVbacks look great!The added toast messages provide valuable information to project owners and the public regarding the project's verification status, GIVbacks eligibility, and boosting. The messages are clear, informative, and align with the updates mentioned in the summary.
1307-1307
: Validation for project owner donations is a good addition.The new label
"label.project_owner_cant_donate_to_own_project"
provides a clear message to project owners that they cannot donate to their own projects. This validation helps prevent potential abuse of the system.
@@ -23,7 +23,7 @@ interface IFilterMenuProps { | |||
|
|||
const projectsFeatures = [ | |||
{ | |||
label: { id: 'label.verified' }, | |||
label: { id: 'label.vouched' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Inconsistent terminology change from "verified" to "vouched".
The terminology change from "verified" to "vouched" has not been consistently applied across the codebase. There are still numerous instances of "verified" in both TypeScript/JavaScript files and localization files. Please review the codebase to ensure that the terminology change is consistently applied to maintain a cohesive user experience.
- TypeScript/JavaScript files: Multiple occurrences of "verified" remain.
- Localization files: Numerous instances of "verified" are still present.
Analysis chain
Verify the consistency of the terminology change.
The change from "verified" to "vouched" aligns with the PR objective. However, please ensure that this terminology change is consistently applied across the codebase and user interface to maintain a cohesive user experience.
Run the following script to verify the consistency of the terminology change:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the consistency of the terminology change from "verified" to "vouched".
# Test 1: Search for the "verified" term usage in TypeScript/JavaScript files.
# Expect: Only occurrences related to the `EProjectsFilter.VERIFIED` enum value.
rg --type-add 'ts:*.ts,*.tsx' --type ts verified
# Test 2: Search for the "vouched" term usage in TypeScript/JavaScript files.
# Expect: Only occurrences related to the UI labels.
rg --type-add 'ts:*.ts,*.tsx' --type ts vouched
# Test 3: Search for the "verified" term usage in the localization files.
# Expect: No occurrences.
rg --type-add 'i18n:*.json' --type i18n verified
# Test 4: Search for the "vouched" term usage in the localization files.
# Expect: Only occurrences related to the UI labels.
rg --type-add 'i18n:*.json' --type i18n vouched
Length of output: 47611
@@ -80,7 +80,7 @@ const CryptoDonation: FC<{ | |||
const dispatch = useAppDispatch(); | |||
|
|||
const { | |||
verified, | |||
isGivbackEligible, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Inconsistent renaming of verified
to isGivbackEligible
.
The renaming of verified
to isGivbackEligible
has not been consistently applied throughout the codebase. The term verified
is still present in many files, which could lead to confusion or errors. Please review and update all relevant instances to ensure consistency.
- Files with remaining occurrences of
verified
:src/content/metatags.ts
src/content/FAQ.tsx
src/lib/constants/shareContent.ts
src/apollo/gql/gqlPowerBoosting.ts
src/components/project-card/ProjectCard.tsx
src/components/views/userProfile/projectsTab/ProjectActions.tsx
src/components/views/userProfile/projectsTab/ProjectItem.tsx
src/components/views/verification/SocialProfile.tsx
src/components/views/verification/VerificationStatusReport.tsx
src/components/views/verification/menu/MobileMenu.tsx
src/components/views/verification/EmailVerificationIndex.tsx
src/components/views/verification/menu/DesktopMenu.tsx
src/components/views/verification/Done.tsx
src/components/views/userProfile/ProfileOverviewTab.tsx
src/components/views/userProfile/boostedTab/BoostsTable.tsx
src/components/views/claim/cards/Donate.tsx
src/components/views/claim/cards/Connect.tsx
src/components/views/project/ProjectTabs.tsx
src/components/views/project/ProjectBadges.tsx
src/components/views/project/ProjectGIVbackToast.tsx
src/components/views/project/projectActionCard/AdminActions.tsx
src/components/views/project/projectActionCard/ProjectStats.tsx
src/components/modals/StakeLock/LockInfo.tsx
src/components/modals/StakeLock/Lock.tsx
src/components/views/landings/web3CryptoDonation/numberedItems.tsx
src/components/views/landings/publicGoods/PublicGoodsFunding.tsx
src/components/views/homepage/introBlock/index.tsx
src/components/views/homepage/aboutGiveconomy/index.tsx
src/components/views/create/proGuide/ProjectTips/DefaultTip.tsx
src/components/views/donate/DonatePageProjectDescription.tsx
src/components/views/landings/GIVBacks/HowGIVbacksWork.tsx
src/components/views/landings/GIVBacks/YouKnowHow.tsx
src/components/views/landings/GIVBacks/WhatMakesGIVbacks.tsx
src/components/views/landings/onboarding/project-owner/projectOwnerSteps.tsx
src/components/views/landings/GIVBacks/WhatCanYouDo.tsx
src/components/views/landings/onboarding/main/WhatIsGiveth.tsx
src/components/views/landings/onboarding/main/WhatIsGIV.tsx
src/components/views/landings/GIVBacks/WhatAreGIVbacks.tsx
src/components/views/landings/onboarding/GIVeconomy/GIVeconomySteps.tsx
src/components/modals/FirstWelcomeModal.tsx
src/components/project-card/ProjectCardBadgeButtons.tsx
src/components/project-card/ProjectCardAlt.tsx
src/components/cards/GivEconomyProjectCards.tsx
src/components/cards/StakingCards/BaseStakingCard/StakingCardHeader.tsx
src/components/GIVeconomyPages/GIVpower.tsx
src/components/GIVeconomyPages/GIVbacks.tsx
src/apollo/gql/gqlProjects.ts
src/apollo/types/types.ts
src/apollo/types/gqlEnums.ts
Analysis chain
Verify the consistency and impact of the variable renaming.
The renaming of verified
to isGivbackEligible
improves code readability. However, please ensure this change is consistently applied throughout the codebase and doesn't break any existing logic that relies on the previous name.
Run the following script to verify the consistency and impact:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the consistency and impact of renaming `verified` to `isGivbackEligible`.
# Test 1: Search for any remaining occurrences of `verified`. Expect: No results.
rg --type tsx --type ts --type js $'verified' -g '!yarn.lock'
# Test 2: Search for occurrences of `isGivbackEligible`. Expect: Only occurrences related to the Givback feature.
rg --type tsx --type ts --type js $'isGivbackEligible' -g '!yarn.lock' -A 5
Length of output: 191
Script:
#!/bin/bash
# Description: Verify the consistency and impact of renaming `verified` to `isGivbackEligible`.
# Test 1: Search for any remaining occurrences of `verified`. Expect: No results.
rg 'verified' --glob '*.tsx' --glob '*.ts' --glob '*.js' -g '!yarn.lock'
# Test 2: Search for occurrences of `isGivbackEligible`. Expect: Only occurrences related to the Givback feature.
rg 'isGivbackEligible' --glob '*.tsx' --glob '*.ts' --glob '*.js' -g '!yarn.lock' -A 5
Length of output: 23634
Summary by CodeRabbit
New Features
Bug Fixes
Style