Skip to content

fixed issue #965 Corrected Link Redirection of recent issues, updated tests and UI change.#1001

Merged
arkid15r merged 11 commits intoOWASP:mainfrom
KaranNegi20Feb:fixing-links-and-tests
Mar 6, 2025
Merged

fixed issue #965 Corrected Link Redirection of recent issues, updated tests and UI change.#1001
arkid15r merged 11 commits intoOWASP:mainfrom
KaranNegi20Feb:fixing-links-and-tests

Conversation

@KaranNegi20Feb
Copy link
Contributor

@KaranNegi20Feb KaranNegi20Feb commented Mar 4, 2025

Fixes Issue
Issue: #965

Describe the bug
Buttons don't link to the github issue, user profile and design changes.

Result
Desktop view:
Screenshot 2025-03-03 at 1 36 06 AM

Mobile view:
Screenshot 2025-03-03 at 3 11 00 PM

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

Summary by CodeRabbit

  • New Features
    • Project data now includes additional link details for issues and contributor profiles, enabling more direct navigation.
  • Style
    • Enhanced item displays with updated layouts and navigation links.
    • Improved detail views by conditionally showing comment counts only when available for a cleaner interface.

Walkthrough

This pull request updates several test cases and UI components. In multiple end-to-end and unit tests, assertions checking for the presence of specific author or contributor names in recent issues and releases have been removed. The GraphQL query for project data is enhanced by adding a new url field in the recentIssues section and within the associated author object. Additionally, two UI components have been updated: one now conditionally renders the comments count, and the other has structural and link modifications for item cards. No changes were made to exported public entities.

Changes

File(s) Change Summary
frontend/__tests__/e2e/pages/Home.spec.ts, frontend/__tests__/e2e/pages/ProjectDetails.spec.ts, frontend/__tests__/e2e/pages/RepositoryDetails.spec.ts Removed specific text assertions (e.g., 'Author 1', 'Dave Debugger', 'Charlie Dev', 'Test User 2') from recent issues and releases tests.
frontend/__tests__/unit/pages/ProjectDetails.test.tsx, frontend/__tests__/unit/pages/RepositoryDetails.test.tsx Removed assertions verifying the presence of the author's name in the rendered output for recent issues.
frontend/src/api/queries/projectQueries.ts Updated the GET_PROJECT_DATA GraphQL query by adding the url field in both the recentIssues section and its nested author object.
frontend/src/components/CardDetailsPage.tsx Introduced conditional rendering of the comments count using optional chaining (item?.commentsCount).
frontend/src/components/ItemCardList.tsx Modified the layout structure of item cards, updated the author profile link to a new URL format, and adjusted nested elements for improved presentation.

Possibly related PRs

Suggested labels

docs

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 5a00d41 and cb5cb4e.

📒 Files selected for processing (1)
  • frontend/src/components/ItemCardList.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/ItemCardList.tsx
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: CodeQL (python)
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: CodeQL (javascript-typescript)
  • 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.

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/components/CardDetailsPage.tsx (1)

99-104: Improved UI rendering with conditional comments display.

This enhancement properly implements optional chaining to conditionally render the comments count only when it exists. This prevents displaying empty comment sections when there are no comments available.

While the implementation is good, consider enhancing it to handle zero comments explicitly:

-  {item?.commentsCount ? (
+  {item?.commentsCount > 0 ? (

This way, it won't show "0 comments" which might be redundant information.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 76b9347 and 9e58cc4.

📒 Files selected for processing (8)
  • frontend/__tests__/e2e/pages/Home.spec.ts (0 hunks)
  • frontend/__tests__/e2e/pages/ProjectDetails.spec.ts (0 hunks)
  • frontend/__tests__/e2e/pages/RepositoryDetails.spec.ts (0 hunks)
  • frontend/__tests__/unit/pages/ProjectDetails.test.tsx (0 hunks)
  • frontend/__tests__/unit/pages/RepositoryDetails.test.tsx (0 hunks)
  • frontend/src/api/queries/projectQueries.ts (1 hunks)
  • frontend/src/components/CardDetailsPage.tsx (1 hunks)
  • frontend/src/components/ItemCardList.tsx (1 hunks)
💤 Files with no reviewable changes (5)
  • frontend/tests/e2e/pages/Home.spec.ts
  • frontend/tests/unit/pages/ProjectDetails.test.tsx
  • frontend/tests/unit/pages/RepositoryDetails.test.tsx
  • frontend/tests/e2e/pages/RepositoryDetails.spec.ts
  • frontend/tests/e2e/pages/ProjectDetails.spec.ts
🔇 Additional comments (3)
frontend/src/api/queries/projectQueries.ts (2)

19-19: URL field added to recentIssues - good enhancement.

Adding the url field to recentIssues is a good improvement that enables direct linking to issues, which addresses part of the problem mentioned in issue #965 about buttons not functioning correctly.


24-24: URL field added to author object - good enhancement.

Adding the url field to the author object within recentIssues allows proper linking to user profiles, addressing the issue mentioned in #965 about buttons not linking to user profiles correctly.

frontend/src/components/ItemCardList.tsx (1)

23-43:

Details

✅ Verification successful

Fixed item card structure and links to address issue #965.

The improved structure of item cards now properly links to both GitHub issues and user profiles, addressing the core issue reported in #965. The layout changes also improve the design consistency.

Key improvements:

  1. The user avatar now correctly links to the user profile
  2. The issue/release title now properly links to its URL
  3. Better layout structure with proper width constraints

Let's verify that the user profile URL format follows the expected pattern:


🏁 Script executed:

#!/bin/bash
# Check if there are other references to user profile URLs in the codebase 
# to ensure the new format is consistent

echo "Checking for user profile URL patterns in the codebase..."
rg -g "*.tsx" -g "*.ts" --no-filename "/community/users/" | grep -v "ItemCardList.tsx"

Length of output: 868


Fixed Item Card Structure and URL Linking for Issue #965

The updated code now correctly links user avatars to their profiles using the consistent /community/users/{user} format – a pattern that was verified against other instances in the codebase. Additionally, the issue/release title correctly links to its URL, and the layout adjustments improve the overall design consistency.

Key improvements:

  • The user avatar now correctly links to the user profile (verified with consistent pattern usage).
  • The issue/release title now properly links to its associated URL.
  • The layout has been refined with better width constraints for improved readability.

@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya and @arkid15r please review the PR. Thank you

@KaranNegi20Feb KaranNegi20Feb changed the title fixed issue #965 Resolved merge conflicts, updated tests and code fixed issue #965 Corrected Link Redirection, updated tests and code Mar 4, 2025
@KaranNegi20Feb KaranNegi20Feb changed the title fixed issue #965 Corrected Link Redirection, updated tests and code fixed issue #965 Corrected Link Redirection of recent issues, updated tests and UI change. Mar 4, 2025
@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya and @arkid15r please review the PR. Thank you

Hey @kasya and @arkid15r this is a followup regarding this PR's review. Thank you.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2025

@arkid15r arkid15r enabled auto-merge March 6, 2025 17:16
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 👍

It looks better now, thank you!

@arkid15r arkid15r added this pull request to the merge queue Mar 6, 2025
Merged via the queue into OWASP:main with commit 62dd05c Mar 6, 2025
18 checks passed
shdwcodr pushed a commit to shdwcodr/Nest that referenced this pull request Jun 5, 2025
…dated tests and UI change. (OWASP#1001)

* Resolved merge conflicts and updated code

* Update code

---------

Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
@coderabbitai coderabbitai bot mentioned this pull request Feb 2, 2026
4 tasks
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.

Buttons don't link to the Github issues page in the Recent Issues section of Projects.

2 participants