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: update Chat section title to 'Chats' #3216

Conversation

Nivedita-Chhokar
Copy link

@Nivedita-Chhokar Nivedita-Chhokar commented Jan 8, 2025

What kind of change does this PR introduce?

Bugfix

Issue Number:

Fixes #3191

Did you add tests for your changes?

yes

Snapshots/Videos:

Before fix:
Screenshot 2025-01-07 175541

After Fix :
Screenshot 2025-01-07 175513

20250109093030.mp4

If relevant, did you update the documentation?

No

Summary

This PR fixes the issue where the Chat section was incorrectly displaying "Title" instead of "Chats." The title has been corrected, and tests have been added to ensure this behavior remains consistent.

Does this PR introduce a breaking change?

No

Other information

None

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • New Features

    • Added localized "Chats" titles for multiple languages (English, French, Hindi, Spanish, Chinese)
    • Implemented chat route mapping in the user screen
  • Tests

    • Added test case to verify chat title rendering in the user screen

Copy link
Contributor

coderabbitai bot commented Jan 8, 2025

Walkthrough

This pull request focuses on adding a localized "Chats" title for the user chat section across multiple language translation files. The changes include updating translation JSON files for English, French, Hindi, Spanish, and Chinese languages with a new "title": "Chats" entry in the userChat section. Additionally, the UserScreen component has been modified to include a new route mapping for the chat feature, and a corresponding test case has been added to verify the correct rendering of the chat section title.

Changes

File Change Summary
public/locales/*/translation.json Added "title": "Chats" (or localized equivalent) in the userChat section for English, French, Hindi, Spanish, and Chinese translations
src/screens/UserPortal/UserScreen/UserScreen.tsx Added chat: 'userChat' to the route mapping
src/screens/UserPortal/UserScreen/UserScreen.spec.tsx Added new test case to verify chat section title rendering

Assessment against linked issues

Objective Addressed Explanation
Fix incorrect chat section title [#3191]

Possibly related PRs

Poem

🐰 A rabbit's tale of chat delight,
Translations dancing, words so bright!
From English to Chinese with glee,
"Chats" now speaks in harmony
A linguistic hop, a coding flight! 🌐✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0acc11b and 7c7aa83.

📒 Files selected for processing (7)
  • public/locales/en/translation.json (1 hunks)
  • public/locales/fr/translation.json (1 hunks)
  • public/locales/hi/translation.json (1 hunks)
  • public/locales/sp/translation.json (1 hunks)
  • public/locales/zh/translation.json (1 hunks)
  • src/screens/UserPortal/UserScreen/UserScreen.spec.tsx (1 hunks)
  • src/screens/UserPortal/UserScreen/UserScreen.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Application
🔇 Additional comments (7)
src/screens/UserPortal/UserScreen/UserScreen.tsx (1)

20-20: LGTM! The chat route mapping is correctly implemented.

The addition of chat: 'userChat' mapping follows the existing pattern and properly integrates with the translation system.

src/screens/UserPortal/UserScreen/UserScreen.spec.tsx (1)

133-150: LGTM! Test coverage is properly added for the chat title.

The test case follows the existing pattern and verifies the correct rendering of the chat title.

public/locales/zh/translation.json (1)

1265-1265: LGTM! Chinese translation is correctly added.

The translation "聊天" is appropriate for "Chats" and is properly placed in the userChat section.

public/locales/en/translation.json (1)

1265-1265: LGTM! English translation matches the intended fix.

The translation "Chats" is properly added and uses the correct plural form as intended in the bug fix.

public/locales/hi/translation.json (1)

1265-1265: LGTM! Appropriate Hindi translation for "Chats"

The translation "चैट्स" is accurate and commonly used in Hindi for the English word "Chats".

public/locales/fr/translation.json (1)

1265-1265: LGTM! Appropriate French translation for "Chats"

The translation "Discussions" is accurate and commonly used in French for the English word "Chats".

public/locales/sp/translation.json (1)

1268-1268: LGTM! Appropriate Spanish translation for "Chats"

The translation "Chats" is accurate and commonly used in Spanish, as it's a widely adopted loanword.

Finishing Touches

  • 📝 Generate Docstrings

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.

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

github-actions bot commented Jan 8, 2025

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.96%. Comparing base (1bc3c5e) to head (7c7aa83).
Report is 81 commits behind head on develop-postgres.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #3216       +/-   ##
=====================================================
+ Coverage             26.46%   89.96%   +63.49%     
=====================================================
  Files                   300      329       +29     
  Lines                  7568     8526      +958     
  Branches               1652     1913      +261     
=====================================================
+ Hits                   2003     7670     +5667     
+ Misses                 5434      621     -4813     
- Partials                131      235      +104     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

Please add a video to prove that this works in all languages

@Nivedita-Chhokar
Copy link
Author

@palisadoes I have updated the comment with the video. Please kindly review it.

@palisadoes palisadoes merged commit 50cd26d into PalisadoesFoundation:develop-postgres Jan 9, 2025
18 checks passed
Dhiren-Mhatre pushed a commit to Dhiren-Mhatre/talawa-admin that referenced this pull request Jan 9, 2025
rishav-jha-mech pushed a commit that referenced this pull request Jan 9, 2025
* prevented unnecessary page reload with complementary test

* Update jest.config.js

* Fixes #2986 - Multiple UI Updates (#3165)

* UI fixes on organisation pages

* Added TSDoc for Truncated Text

* Added Debouncer

* Update src/components/OrgListCard/OrgListCard.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Added code rabbit suggestions

* Fixed test error

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* refactore src/screens/OrgList from jest to vitest (#3200)

* Improved Code Coverage in src/components/Venues/VenueModal.tsx (#3203)

* Improved Code Coverage in src/components/Venues/VenueModal.tsx

* removed the ignore statements from VenueModal.tsx

* Removed istanbul ignore lines. Code coverage remians 100% (#3207)

* refactored src/screens/FundCampaignPledge from jest to vitest (#3208)

* prettier formatting and disabled ts-specific rules for js in eslint (#3186)

* Improve Code Coverage in src/screens/UserPortal/Settings/Settings.tsx (#3189)

* Preventing Overflow of images in Advertisement and Venue Post modals (#3204)

* improve code coverage of src/screens/EventManagement (#3149)

* code coverage

* jest global coverage decreased

* global jest coverage

* rename file problem solved

* changes requested resolved

* fix: update Chat section title to 'Chats' (#3216)

* removed stale comment line

* Revert "removed stale comment line"

This reverts commit e0fa894.

* removed stale comment line

---------

Co-authored-by: Peter Harrison <[email protected]>
Co-authored-by: Mehul Aggarwal <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Syed Ali Ul Hasan <[email protected]>
Co-authored-by: harshk-89 <[email protected]>
Co-authored-by: Amaan ali <[email protected]>
Co-authored-by: Yugal Sadhwani <[email protected]>
Co-authored-by: Pranav Nathe <[email protected]>
Co-authored-by: prathmesh703 <[email protected]>
Co-authored-by: Nivedita <[email protected]>
@Nivedita-Chhokar Nivedita-Chhokar deleted the issue-3191 branch January 9, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants