-
Notifications
You must be signed in to change notification settings - Fork 262
feat: Add slots to add tab links and add mechanism for plugin routes #1645
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @xitij2000! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1645 +/- ##
=========================================
Coverage ? 90.49%
=========================================
Files ? 347
Lines ? 5827
Branches ? 1398
=========================================
Hits ? 5273
Misses ? 535
Partials ? 19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
83693c3
to
b9df318
Compare
7245d96
to
e040882
Compare
d6afeb0
to
7affcf0
Compare
7affcf0
to
fd9df35
Compare
Description
This PR adds mechanisms to add course tabs using a frontend plugin.
It includes two plugin slots:
It also adds a new mechanism to add course routes using the
PLUGIN_ROUTES
config. This is a simple array that adds new routes for the MFE that can then be handled by plugins.The combination of the above will allow injecting a new course tab by:
PLUGIN_ROUTES
array.It is also possible to add the links anywhere else, to simply add new pages that are not tabs.
Other Information
Currently there is a single plugin slot for all pages and each plugin would need to check if the route matches and render itself. Another alternative is for the plugin routes to be a mapping of plugin name to the route, and the plugin name can be added to the slot ID. For example:
This would create slots like:
tab1_page_route_slot
andtab2_page_route_slot
etc.Or, it can just use the route itself in the slot name. While this will result in clumsy names like: "/course/:courseId/tab1_page_route_slot" there is not reason why that shouldn't work.