Skip to content

Provide a helper for linking to another app's route by role #317

Description

@arbrandes

Description

Apps that link to each other's pages currently call getUrlByRouteRole and then hand-roll the same logic: substitute the :courseId param, test whether the result is an internal path or an external URL (a scheme regex), and pick between a react-router Link and a plain anchor with a legacy fallback URL.

This exact pattern is now duplicated verbatim in two apps: frontend-app-gradebook's "Back to Dashboard" link (openedx/frontend-app-gradebook#627) and frontend-app-instructor-dashboard's "View Gradebook" button (openedx/frontend-app-instructor-dashboard#245). Any app that cross-links by role will need the same boilerplate, and the copies will drift.

frontend-base should own this. Options include an isAbsoluteUrl helper plus param substitution, a getUrlByRouteRole variant that also reports whether the result is internal or external, or a RoleLink component that takes a role, params, and a fallback URL and renders the right element. Once available, both apps above should be migrated to it.

Provided by #320, released in 2.0.0-alpha.15, and adopted in:

Activity

  1. added 2 commits that reference this issue on Sep 22, 2026
    45ee032
    83a1752
  2. openedx-semantic-release-bot commented on Sep 22, 2026

    @openedx-semantic-release-bot

    🎉 This issue has been resolved in version 2.0.0-alpha.15 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  3. moved this from Todo to Done in frontend-baseon Sep 22, 2026
  4. moved this from Done to In Progress in frontend-baseon Sep 22, 2026
  5. self-assigned this
    on Sep 22, 2026
  6. moved this from In Progress to In Review in frontend-baseon Sep 23, 2026
  7. moved this from In Review to No status in frontend-baseon Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions