-
Notifications
You must be signed in to change notification settings - Fork 244
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. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1645 +/- ##
=======================================
Coverage 90.08% 90.09%
=======================================
Files 338 338
Lines 5782 5793 +11
Branches 1410 1372 -38
=======================================
+ Hits 5209 5219 +10
- Misses 556 558 +2
+ Partials 17 16 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.