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

Added docs and changelog to main menu #947

Merged
merged 4 commits into from
Oct 13, 2024

Conversation

Abhi-m-anue
Copy link
Contributor

output.compress-video-online.com.mp4

#942

Copy link

coderabbitai bot commented Oct 12, 2024

Walkthrough

The changes in the Sidebar component involve the addition of two new icons and corresponding menu items for "Docs" and "Changelog". The navigation logic for the ListItemButton has been updated to open specific external pages based on the selected item, enhancing user access to documentation and changelog resources.

Changes

File Change Summary
Client/src/Components/Sidebar/index.jsx - Imported new icons: ChangeLog, Docs
- Added new menu items: "Docs" and "Changelog"
- Updated click handler for navigation based on selected item

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Sidebar
    participant Navigation

    User->>Sidebar: Click on "Docs"
    Sidebar->>Navigation: Open GitBook documentation page

    User->>Sidebar: Click on "Changelog"
    Sidebar->>Navigation: Open GitHub releases page

    User->>Sidebar: Click on "Support"
    Sidebar->>Navigation: Open GitHub issues page

    User->>Sidebar: Click on other item
    Sidebar->>Navigation: Navigate to specified path
Loading

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 684f92a and bb5a195.

📒 Files selected for processing (1)
  • Client/src/Components/Sidebar/index.jsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Client/src/Components/Sidebar/index.jsx

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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

@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

🧹 Outside diff range and nitpick comments (2)
Client/src/Components/Sidebar/index.jsx (2)

76-77: Yo, we're droppin' some knowledge bombs in this menu!

These new menu items for Docs and Changelog are comin' in clutch, just like when you're nervous but on the surface you look calm and ready. They're fittin' right in with the rest of the crew.

But yo, I got a little somethin' to add. We might wanna consider sortin' these menu items alphabetically. It ain't a big deal, but it could make it easier for users to find what they're lookin' for, you feel me?

Here's how we could sort it:

 const other = [
+  { name: "Changelog", path: "changelog", icon: <ChangeLog /> },
+  { name: "Docs", path: "docs", icon: <Docs /> },
   { name: "Settings", path: "settings", icon: <Settings /> },
   { name: "Support", path: "support", icon: <Support /> },
-  { name: "Docs", path: "docs", icon: <Docs /> },
-  { name: "Changelog", path: "changelog", icon: <ChangeLog /> },
 ];

505-531: Yo, this click handler's got more branches than Eminem's got rhymes!

I see what you're doin' here, openin' up them external links for docs and changelog. That's dope, givin' users quick access to the good stuff. But check it, this function's startin' to look like a plate of mom's spaghetti - all tangled up.

How about we clean it up a bit? We could use a switch statement or maybe even a lookup object to make it cleaner than Eminem's closet. Here's a idea to chew on:

const externalLinks = {
  support: "https://github.com/bluewave-labs/bluewave-uptime/issues",
  docs: "https://bluewavelabs.gitbook.io/uptime-manager",
  changelog: "https://github.com/bluewave-labs/bluewave-uptime/releases"
};

const handleClick = (path) => {
  if (externalLinks[path]) {
    window.open(externalLinks[path], "_blank", "noreferrer");
  } else {
    navigate(`/${path}`);
  }
};

Then you can use it like this in your onClick:

onClick={() => handleClick(item.path)}

This way, it's easier to add new external links in the future without makin' your onClick look like a rap battle. What do you think? Ready to drop this mic?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d3659d3 and 684f92a.

⛔ Files ignored due to path filters (2)
  • Client/src/assets/icons/changeLog.svg is excluded by !**/*.svg
  • Client/src/assets/icons/docs.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • Client/src/Components/Sidebar/index.jsx (3 hunks)
🧰 Additional context used
🔇 Additional comments (1)
Client/src/Components/Sidebar/index.jsx (1)

44-45: Yo, these new imports are straight fire!

Them new icons for ChangeLog and Docs are comin' in hot, just like mom's spaghetti. They're followin' the same flow as the other imports, so we're keepin' it real consistent. That's what I'm talkin' about!

@gorkem-bwl gorkem-bwl requested review from ajhollid and jennifer-gan and removed request for ajhollid October 13, 2024 01:47
Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

Nice work 👍 I think we can do some minor refactoring to make the code a bit more maintainable and readable, and it would be nice to have the Settings link be the first in the list. Please see comments for details.

Thanks for your hard work and contribution, much appreciated!

Client/src/Components/Sidebar/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Sidebar/index.jsx Show resolved Hide resolved
@Abhi-m-anue
Copy link
Contributor Author

Thanks for the feedback. That looks cleaner.
I have updated the code please check

Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

Awesome, looks good now 👍 Thanks for making the changes!

@ajhollid
Copy link
Collaborator

Thanks for the feedback. That looks cleaner. I have updated the code please check

My pleasure, looks good to me now 🚀

@ajhollid ajhollid merged commit 4f7f1b3 into bluewave-labs:develop Oct 13, 2024
1 check passed
This was referenced Oct 14, 2024
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.

2 participants