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 sub-route for projects #1202

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

mulengawilfred
Copy link
Contributor

@mulengawilfred mulengawilfred commented Oct 28, 2024

Overview

Updated the sub-route for projects to align with RESTful route naming convention

What I've done

What I haven't done

How I tested

Tested by navigating to the pages leading to the projects page and individual project settings page.

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features

    • Updated URL paths for project settings and related components to reflect a pluralized structure, enhancing navigation consistency.
  • Bug Fixes

    • Corrected path inconsistencies across various components related to project settings and plugins.
  • Documentation

    • Improved clarity in routing configurations to align with the new URL structure for accessing project settings.

Copy link

coderabbitai bot commented Oct 28, 2024

Walkthrough

This pull request introduces modifications to the URL paths related to project settings across several components in the application. The primary change involves updating paths from singular to plural forms, such as from /settings/project/${project.id} to /settings/projects/${project.id}. These changes affect various components, including the PopupMenuItem, LeftSection, ProjectSettings, PublicSettings, and routing configurations. The overall functionality and control flow remain intact, with no additional logic or error handling changes.

Changes

File Path Change Summary
web/src/beta/features/Dashboard/ContentsContainer/Projects/Project/hooks.ts Updated "Project Setting" path from /settings/project/${project.id} to /settings/projects/${project.id}.
web/src/beta/features/Navbar/LeftSection/index.tsx Updated paths for "Project settings" and "Plugin" from singular to plural forms.
web/src/beta/features/ProjectSettings/index.tsx Updated tab paths from /settings/project/${projectId} to /settings/projects/${projectId}.
web/src/beta/features/ProjectSettings/innerPages/PublicSettings/index.tsx Updated paths in PublicSettings from singular to plural for project settings and individual stories.
web/src/beta/hooks/navigationHooks.ts Updated navigate function path from /settings/project/${projectId} to /settings/projects/${projectId}.
web/src/services/routing/index.tsx Updated route path in AppRoutes from "settings/project/:projectId" to "settings/projects/:projectId".

Possibly related PRs

Suggested labels

web

Suggested reviewers

  • mkumbobeaty
  • airslice

Poem

In the land of projects, where settings reside,
We’ve changed the paths, let’s take a ride!
From singular to plural, our URLs grow,
Hop along, dear friends, to where the settings flow!
With every click, a new path we’ll find,
A journey of projects, all neatly aligned! 🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3d4c50f and 76213e4.

📒 Files selected for processing (6)
  • web/src/beta/features/Dashboard/ContentsContainer/Projects/Project/hooks.ts (1 hunks)
  • web/src/beta/features/Navbar/LeftSection/index.tsx (1 hunks)
  • web/src/beta/features/ProjectSettings/index.tsx (1 hunks)
  • web/src/beta/features/ProjectSettings/innerPages/PublicSettings/index.tsx (1 hunks)
  • web/src/beta/hooks/navigationHooks.ts (1 hunks)
  • web/src/services/routing/index.tsx (1 hunks)
🔇 Additional comments (10)
web/src/beta/hooks/navigationHooks.ts (2)

30-30: LGTM! URL path update follows RESTful conventions.

The change from /settings/project/ to /settings/projects/ properly reflects the RESTful convention of using plural nouns for resource collections.


30-30: Verify URL pattern consistency across the codebase.

Let's ensure this URL pattern change is consistently applied to prevent any navigation issues.

✅ Verification successful

URL pattern is consistently using the plural form /settings/projects/ across the codebase

The verification shows that all instances of the settings URL pattern consistently use the plural form /settings/projects/ in:

  • Navigation hooks
  • Project settings components
  • Navbar components
  • Dashboard components

No instances of the old singular form /settings/project/ were found, confirming the pattern is uniform throughout the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of the old URL pattern and verify the new pattern is used consistently

# Test 1: Search for old pattern. Expect: No matches for the old singular form
echo "Checking for old singular form URLs..."
rg -l '/settings/project/[^s]'

# Test 2: Verify new plural form is used consistently
echo "Verifying new plural form usage..."
rg -l '/settings/projects/'

# Test 3: Check for any route definitions that might need updating
echo "Checking route definitions..."
rg -l "path.*settings/project[^s]"

Length of output: 619


Script:

#!/bin/bash
# Let's examine the actual URL patterns in these files to ensure consistency

echo "Checking URL patterns in the identified files..."
rg -A 2 -B 2 '/settings/projects/' web/src/beta/hooks/navigationHooks.ts web/src/beta/features/ProjectSettings/index.tsx web/src/beta/features/ProjectSettings/innerPages/PublicSettings/index.tsx web/src/beta/features/Navbar/LeftSection/index.tsx web/src/beta/features/Dashboard/ContentsContainer/Projects/Project/hooks.ts

echo -e "\nChecking for any route definitions in router configuration..."
fd -e tsx -e ts | xargs rg "Route.*settings.*projects?"

Length of output: 3835

web/src/services/routing/index.tsx (1)

41-41: LGTM! Route path updated to follow RESTful conventions.

The change from settings/project/:projectId/:tab?/:subId? to settings/projects/:projectId/:tab?/:subId? aligns with RESTful conventions where resource collections are represented using plural nouns.

Let's verify that all references to the old path have been updated:

✅ Verification successful

All references to project settings path have been updated correctly

The verification results show that:

  1. No instances of the old path pattern settings/project/ were found
  2. All components consistently use the new path pattern settings/projects/
    • Navigation hooks in beta/hooks/navigationHooks.ts
    • Navbar components in beta/features/Navbar/LeftSection/index.tsx
    • Project settings components in beta/features/ProjectSettings/
    • Dashboard components in beta/features/Dashboard/
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining references to the old path pattern
# Test: Search for "settings/project/". Expect: No matches (excluding test files)
rg -g '!{*.test.*,*.spec.*}' "settings/project/"

# Test: Search for references to new path pattern. Expect: Matches in components using this route
rg -g '!{*.test.*,*.spec.*}' "settings/projects/"

Length of output: 1053

web/src/beta/features/Navbar/LeftSection/index.tsx (2)

44-46: LGTM! Path update follows RESTful conventions.

The URL path change from project to projects aligns with RESTful naming conventions for resource collections.


53-53: LGTM! Verify route updates across the application.

The URL path change is consistent with RESTful conventions.

Let's verify that all route consumers have been updated:

✅ Verification successful

Based on the search results, I can generate the final response:

Route changes have been consistently updated across the codebase

The verification shows that:

  • No instances of the old /settings/project/ pattern were found
  • All route definitions consistently use the new /settings/projects/ pattern across different components
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of the old route pattern
# Description: Look for potentially missed route updates that might cause navigation issues

# Test 1: Search for old route pattern
echo "Checking for old route patterns..."
rg "/settings/project/[^s]"

# Test 2: Search for route definitions to ensure consistency
echo "Checking route definitions..."
rg "path.*settings/(project|projects)/.*"

Length of output: 843

web/src/beta/features/ProjectSettings/innerPages/PublicSettings/index.tsx (2)

93-93: LGTM! Path update follows RESTful conventions

The change from project to projects in the path aligns with RESTful conventions where resource collections are typically pluralized.


100-100: LGTM! Verify path consistency across the codebase

The path update maintains consistency with RESTful conventions and matches the previous change.

Let's verify that all project-related paths have been updated consistently:

✅ Verification successful

All project settings paths consistently use the updated format /settings/projects/

The verification shows that all project settings related paths in the codebase have been updated to use the plural form projects. No instances of the old format /settings/project/ were found, and all occurrences consistently use /settings/projects/. The change maintains uniformity across the entire codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of '/project/' in path strings
# that might have been missed in the update

# Look for React router paths or string literals containing '/project/'
rg -g '*.{ts,tsx,js,jsx}' "(/|['\"])settings/project/.*?['\"]"

# Look for potential inconsistencies where both old and new formats might exist
echo "Checking for mixed usage of 'settings/project' and 'settings/projects':"
rg -g '*.{ts,tsx,js,jsx}' -C 2 "settings/projects?/"

Length of output: 3789

web/src/beta/features/ProjectSettings/index.tsx (2)

72-72: LGTM! Path update follows RESTful conventions.

The change from /settings/project/ to /settings/projects/ properly follows RESTful naming conventions where resource names should be plural.


72-72: Verify route configuration and consuming components.

Let's ensure the route configuration and all components using this path have been updated consistently.

✅ Verification successful

Route configuration and path references are consistent

The verification shows that all project settings routes and path references are using the plural form settings/projects consistently across the codebase:

  • Route configuration in web/src/services/routing/index.tsx uses plural form
  • All component references in navigation hooks, navbar, project settings, and dashboard use the plural form
  • No instances of singular form /settings/project were found
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all project settings routes and path references have been updated to use plural form

# Test 1: Check route configuration
echo "Checking route configuration..."
rg -l "settings/project/?" web/src/services/routing/

# Test 2: Check component references
echo "Checking component references to project settings paths..."
rg -l "settings/project/" web/src/beta/features/

# Test 3: Check for any remaining singular form usage
echo "Checking for any remaining singular form usage..."
rg -l "/settings/project[^s]" .

Length of output: 481


Script:

#!/bin/bash
# Let's check the actual content of the routing configuration and any references to project settings paths

# Check routing configuration content
echo "=== Routing Configuration Content ==="
rg -A 5 -B 5 "settings/project" web/src/services/routing/index.tsx

# Check for any paths using settings/projects (plural form)
echo -e "\n=== Checking Plural Form Usage ==="
rg -A 2 -B 2 "settings/projects" .

# Check for any route definitions or path constants
echo -e "\n=== Checking Route Definitions ==="
ast-grep --pattern 'const $_ = $$$"/settings/project$$$"'
ast-grep --pattern 'const $_ = $$$"/settings/projects$$$"'

Length of output: 4314

web/src/beta/features/Dashboard/ContentsContainer/Projects/Project/hooks.ts (1)

100-100: LGTM! Path update aligns with RESTful conventions.

The change from /settings/project/${project.id} to /settings/projects/${project.id} correctly follows RESTful naming conventions by using plural form for resource collections.

Let's verify that this path change is consistent across the codebase:

✅ Verification successful

The search results show that the path /settings/projects/ is consistently used across the beta features, which aligns with the RESTful convention. The only occurrences of settings/project/ are in comments within extensions.ts referring to classic components, which are likely documentation and don't affect the actual routing.

Path update is consistent with RESTful conventions across the beta codebase

The change from singular to plural form (/settings/projects/${project.id}) is correctly implemented and used consistently across all beta features. The only singular form occurrences are in documentation comments referring to legacy classic components, which don't affect the routing.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining singular form paths that might need updating
# and verify the new plural form is used consistently

# Search for any remaining singular form paths
echo "Checking for any remaining singular 'project' paths:"
rg -i "settings/project/[^s]"

# Verify the new plural form is used consistently
echo "Verifying plural 'projects' path usage:"
rg -i "settings/projects/"

Length of output: 1769


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 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

netlify bot commented Oct 28, 2024

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 76213e4
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/671f711e0f649c0008ff67c8
😎 Deploy Preview https://deploy-preview-1202--reearth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the web label Oct 28, 2024
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.

2 participants