Skip to content

Issue resolved : #1068 Correction to overflow of name in usercard #1070

Merged
arkid15r merged 6 commits intoOWASP:mainfrom
KaranNegi20Feb:username-fix
Mar 10, 2025
Merged

Issue resolved : #1068 Correction to overflow of name in usercard #1070
arkid15r merged 6 commits intoOWASP:mainfrom
KaranNegi20Feb:username-fix

Conversation

@KaranNegi20Feb
Copy link
Contributor

Resolves #1068 UI Improvement: The name overflows the div container.
Here's the corrected version of the usercard:

Screenshot 2025-03-10 at 10 34 34 PM

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2025

Summary by CodeRabbit

  • New Features
    • User cards now display additional details including email and location.
    • The card’s information now shows company data, but if unavailable, it falls back to showing location or email.
  • Style
    • Updated text display properties for headings to enforce a maximum width and truncation for improved readability.

Walkthrough

The pull request updates the UserCard component by adding email and location properties to its function signature. The content of the paragraph element now displays the company name, or if that is not available, it falls back to displaying the email or location. Additionally, the class name for the <h3> element has been changed to allow for a maximum width of 250 pixels with text truncation. The Users page has also been updated to pass the new properties to the UserCard.

Changes

File Change Summary
frontend/src/components/UserCard.tsx Added email and location to UserCardProps, modified paragraph content to display company or email or location, and changed <h3> class from line-clamp-1 to max-w-[250px] truncate.
frontend/src/pages/Users.tsx Added email and location properties to the UserCard component in the renderUserCard function, populated from the user object.
frontend/src/types/card.ts Added email: string and location: string properties to the UserCardProps interface.

Suggested labels

frontend-tests

Suggested reviewers

  • kasya

📜 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 dd5a3db and b2a7f83.

📒 Files selected for processing (3)
  • frontend/src/components/UserCard.tsx (2 hunks)
  • frontend/src/pages/Users.tsx (1 hunks)
  • frontend/src/types/card.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • frontend/src/types/card.ts
  • frontend/src/pages/Users.tsx
  • frontend/src/components/UserCard.tsx
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: CodeQL (python)
  • GitHub Check: CodeQL (javascript-typescript)
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run frontend unit tests
  • GitHub Check: Run backend tests

🪧 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.
  • @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.

@KaranNegi20Feb
Copy link
Contributor Author

Hey @arkid15r i have made the required changes please go through those, Thank you 😊.

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

Looks good, could you improve it a bit?

@KaranNegi20Feb KaranNegi20Feb requested a review from arkid15r March 10, 2025 18:08
@KaranNegi20Feb
Copy link
Contributor Author

KaranNegi20Feb commented Mar 10, 2025

Hey @arkid15r thanks for the suggestions, Now the PR is ready for review, please go through the changes, Thank you😊.

@KaranNegi20Feb KaranNegi20Feb marked this pull request as draft March 10, 2025 18:29
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

🧹 Nitpick comments (1)
frontend/src/types/card.ts (1)

47-54: Interface expansion looks good, but consider optional properties

The addition of email and location properties to the UserCardProps interface aligns well with the PR objective to address the overflow issue. According to the AI summary, these properties are used as fallbacks when company information isn't available.

However, consider making these new properties optional with the ? operator since they might not always be available for every user, which would improve flexibility:

export interface UserCardProps {
  avatar: string
  button: ButtonType
  company: string
  name: string
- email: string
- location: string
+ email?: string
+ location?: string
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b113dd7 and dd5a3db.

📒 Files selected for processing (1)
  • frontend/src/types/card.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: CodeQL (python)
  • GitHub Check: CodeQL (javascript-typescript)
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run frontend unit tests

@KaranNegi20Feb KaranNegi20Feb marked this pull request as ready for review March 10, 2025 18:36
@sonarqubecloud
Copy link

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM

@arkid15r arkid15r enabled auto-merge March 10, 2025 18:49
@arkid15r arkid15r added this pull request to the merge queue Mar 10, 2025
Merged via the queue into OWASP:main with commit a6644aa Mar 10, 2025
18 checks passed
arkid15r added a commit to Yashgupta9330/Nest that referenced this pull request Mar 11, 2025
OWASP#1070)

* correction to overflow of name in usercard

* review resolved

* review resolved new

* company or email or location added

* company or email or location added and interface change

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
@coderabbitai coderabbitai bot mentioned this pull request Mar 24, 2025
shdwcodr pushed a commit to shdwcodr/Nest that referenced this pull request Jun 5, 2025
OWASP#1070)

* correction to overflow of name in usercard

* review resolved

* review resolved new

* company or email or location added

* company or email or location added and interface change

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI Improvement: The name overflows the div container

2 participants

Comments