Skip to content

Optimize 'course' category + add resource hub to patches url#8180

Open
Chaboi45 wants to merge 1 commit intomasterfrom
pending-patches-links
Open

Optimize 'course' category + add resource hub to patches url#8180
Chaboi45 wants to merge 1 commit intomasterfrom
pending-patches-links

Conversation

@Chaboi45
Copy link
Copy Markdown
Contributor

@Chaboi45 Chaboi45 commented Jan 4, 2026

Small patch to put course under the generic /collection_name/slug format, and added resource hub to URL to allow easier access to patches from the patches list.

Summary by CodeRabbit

  • New Features

    • Added support for a new resource type in patch administration and URL routing.
  • Bug Fixes

    • Improved URL generation logic to eliminate redundant handling while maintaining existing functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

Small patch to put course under the generic /collection_name/slug format, and added resource hub to URL to allow easier access to patches from the patches list.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

Modified URL generation logic for patch targets in the admin view, adding support for 'resource_hub_resource' routing to resource/${slug} and removing a redundant explicit 'course' case while preserving equivalent behavior through existing grouping logic.

Changes

Cohort / File(s) Summary
URL routing refactoring
app/views/admin/PendingPatchesView.js
Added switch case for 'resource_hub_resource' patch target directing to resource/${slug}. Removed redundant explicit 'course' case; 'course' target behavior remains intact via existing collection grouping that still covers it.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A new path springs forth through the switch,
Resource hub hops in, without a glitch,
Course kept its way, no need to fret,
Simpler code, cleaner set!
Thump thump 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: optimizing course category handling and adding resource hub support to the patches URL generation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e5c5a43 and 68e4303.

📒 Files selected for processing (1)
  • app/views/admin/PendingPatchesView.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ESLint CI
  • GitHub Check: Node.js CI (20.19.2)
🔇 Additional comments (2)
app/views/admin/PendingPatchesView.js (2)

73-74: Route handler for resource editor patches is properly configured.

The new 'resource_hub_resource' case correctly maps to resource/${patch.slug}, which resolves to /editor/resource/:resourceID. This follows the established pattern of custom URL mappings (like 'thang_type' → 'thang' on line 70) where collection names differ intentionally from URL segments. The route is fully configured in app/core/Router.js and handled by ResourceEditView, which properly loads and manages ResourceHubResource models.


67-68: Both changes are correct and properly routed.

The consolidation of 'course' into the grouped case at line 67 reduces duplication for collections following the standard /editor/{collection}/{slug} pattern. The new 'resource_hub_resource' case at lines 73-74 correctly maps to /editor/resource/{slug}, with routes already defined in Router.js ('editor/course/:courseID' and 'editor/resource/:resourceID') and corresponding views registered.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant