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

refactor: update header text on the public profile sdg section. #2345

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

sunilsabatp
Copy link
Contributor

This PR updates the Sustainable Development Goals (SDG) header text on the public profile page

Copy link

vercel bot commented Dec 30, 2024

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

Name Status Preview Comments Updated (UTC)
planet-webapp-multi-tenancy-setup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 5:44am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
planet-webapp ⬜️ Ignored (Inspect) Jan 2, 2025 5:44am
planet-webapp-temp ⬜️ Ignored (Inspect) Jan 2, 2025 5:44am

Copy link
Contributor

coderabbitai bot commented Dec 30, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/eslint
npm error dev eslint@"^8.26.0" from the root project
npm error peer eslint@"6 || 7 || 8" from @emotion/[email protected]
npm error node_modules/@emotion/eslint-plugin
npm error dev @emotion/eslint-plugin@"^11.12.0" from the root project
npm error 15 more (@eslint-community/eslint-utils, ...)
npm error
npm error Could not resolve dependency:
npm error peer eslint@"^5.16.0 || ^6.8.0 || ^7.2.0" from [email protected]
npm error node_modules/eslint-config-airbnb
npm error dev eslint-config-airbnb@"^18.2.0" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/eslint
npm error peer eslint@"^5.16.0 || ^6.8.0 || ^7.2.0" from [email protected]
npm error node_modules/eslint-config-airbnb
npm error dev eslint-config-airbnb@"^18.2.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /root/.npm/_logs/2024-12-30T05_57_19_894Z-eresolve-report.txt
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-30T05_57_19_894Z-debug-0.log

Walkthrough

The pull request introduces a modification to the CarouselSlider component by changing the carouselTitle prop to carouselTitles, which is now an object with primary and secondary string properties. This change affects how titles are rendered in the carousel header. The SDGCardList component has been updated to use the new prop structure, passing translated title keys for both primary and secondary titles.

Changes

File Change Summary
src/features/common/CarouselSlider/index.tsx Updated CarouselSliderProps interface to replace single carouselTitle with carouselTitles object containing primary and secondary string properties
src/features/user/Profile/InfoAndCTA/SDGCardList/index.tsx Modified carousel title passing to use new carouselTitles prop with translated keys for primary and secondary titles

Possibly related PRs

Suggested labels

PR: reviewed-approved

Suggested reviewers

  • mohitb35

Poem

🐰 Carousel of Titles, Two by Two

Hopping through code with a rabbit's view
Primary, secondary, titles unfurl
A slider that makes our interface twirl
Transformation complete, with linguistic might
Our carousel dances with newfound delight! 🎠


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

🧹 Nitpick comments (1)
src/features/common/CarouselSlider/index.tsx (1)

111-112: Rendered titles for improved readability

Displaying both carouselTitles.primary and carouselTitles.secondary effectively conveys the enhanced SDG header text. Consider adjusting the typography or spacing between these two titles if you want a different visual emphasis.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b338449 and 698aa6a.

⛔ Files ignored due to path filters (1)
  • public/static/locales/en/profile.json is excluded by !**/*.json
📒 Files selected for processing (2)
  • src/features/common/CarouselSlider/index.tsx (3 hunks)
  • src/features/user/Profile/InfoAndCTA/SDGCardList/index.tsx (1 hunks)
🔇 Additional comments (2)
src/features/common/CarouselSlider/index.tsx (2)

41-44: Interface extension is consistent with usage

Defining the new carouselTitles property with primary and secondary fields aligns well with the multi-title requirement. This structure provides flexibility for future modifications (e.g., adding new title variants or metadata).


53-53: Prop rename matches the new interface

Renaming carouselTitle to carouselTitles and passing it as an object is consistent with the updated interface. Be sure to confirm that all invocations of CarouselSlider supply this new prop structure to prevent runtime errors.

✅ Verification successful

All invocations of CarouselSlider properly use the updated prop structure

Based on the search results, there is only one invocation of the CarouselSlider component in the codebase (in src/features/user/Profile/InfoAndCTA/SDGCardList/index.tsx), and it correctly uses the new carouselTitles prop with the expected object structure containing primary and secondary properties:

<CarouselSlider
  carouselData={sdgCardsDataArray}
  carouselTitles={{
    primary: t('infoAndCtaContainer.sdgSectionHeadingPrimary'),
    secondary: t('infoAndCtaContainer.sdgSectionHeadingSecondary'),
  }}
/>

This matches the interface defined in src/features/common/CarouselSlider/index.tsx:

interface CarouselSliderProps {
  carouselTitles: {
    primary: string;
    secondary: string;
  };
  // ...
}
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# This script verifies that all invocations of CarouselSlider specify `carouselTitles`.
rg -A 5 "CarouselSlider" 

Length of output: 3041

Comment on lines +109 to +112
carouselTitles={{
primary: t('infoAndCtaContainer.sdgSectionHeadingPrimary'),
secondary: t('infoAndCtaContainer.sdgSectionHeadingSecondary'),
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Translation key sdgSectionHeadingSecondary is missing in German locale

The English translation file has both required keys defined:

  • infoAndCtaContainer.sdgSectionHeadingPrimary
  • infoAndCtaContainer.sdgSectionHeadingSecondary

However, in the German translation file:

  • infoAndCtaContainer.sdgSectionHeadingPrimary is missing
  • infoAndCtaContainer.sdgSectionHeadingSecondary is missing
  • Instead, there's an older key infoAndCtaContainer.sdgCardsSectionHeading which seems to be outdated

Please add the following translations to the German locale file (public/static/locales/de/profile.json):

"sdgSectionHeadingPrimary": "Wiederherstellung von Ökosystemen & Bekämpfung der Klimakrise.",
"sdgSectionHeadingSecondary": "Beitrag zu den Zielen für nachhaltige Entwicklung."
🔗 Analysis chain

Ensure translation keys are defined and tested

These lines correctly introduce separate primary and secondary titles, improving clarity for the SDG section. However, please verify that both translation keys (infoAndCtaContainer.sdgSectionHeadingPrimary and infoAndCtaContainer.sdgSectionHeadingSecondary) are defined and correctly translated in all relevant language files so that you avoid runtime or UI text issues.

Below is a shell script to search for these translation keys in the repository’s translation files:


Let me try a different search strategy to locate the translation files and their content.


Let me try one more search strategy to locate the translation files, as they might be in a different location or format.


Let me check the content of the translation files we found to verify if these keys are defined.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# This script searches translation files for the new SDG section heading keys.
fd "\.json" | xargs rg "infoAndCtaContainer\.sdgSectionHeadingPrimary"
fd "\.json" | xargs rg "infoAndCtaContainer\.sdgSectionHeadingSecondary"

Length of output: 147


Script:

#!/bin/bash
# First, let's find all translation-related JSON files
fd -e json "translation|locale|i18n|lang"

# Then, let's try to find the parent key "infoAndCtaContainer" which might help us verify if we're looking in the right place
fd -e json "translation|locale|i18n|lang" | xargs rg "infoAndCtaContainer"

# Also search for any SDG-related translations to understand the structure
fd -e json "translation|locale|i18n|lang" | xargs rg "sdg" -i

Length of output: 253


Script:

#!/bin/bash
# Let's find all JSON files in the repository and check their content
fd -e json | xargs rg "infoAndCtaContainer" -l

# Also search for translation-related directories
fd -t d "translations|locales|i18n|lang"

# Let's also check for any TypeScript files that might import or define these translations
rg "infoAndCtaContainer" -t ts -A 2 -B 2

Length of output: 9104


Script:

#!/bin/bash
# Check the content of the English and German translation files for these specific keys
echo "=== English translations ==="
cat "public/static/locales/en/profile.json"

echo -e "\n=== German translations ==="
cat "public/static/locales/de/profile.json"

Length of output: 13453

Copy link
Collaborator

@mohitb35 mohitb35 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants