Repository navigation
feat: add frontend-plugin-framework slots - #545
Conversation
Add the following `frontend-plugin-framework` slots: * `logo_slot` * `desktop_main_menu_slot` * `desktop_secondary_menu_slot` * `mobile_main_menu_slot` * `course_info_slot` * `learning_help_slot` * `desktop_logged_out_items_slot` * `mobile_logged_out_items_slot` * `mobile_user_menu_slot` * `desktop_user_menu_slot` * `learning_user_menu_slot` * `learning_logged_out_items_slot` * `desktop_header_slot`
ff1f991 to
8e39d9e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #545 +/- ##
==========================================
- Coverage 70.55% 68.67% -1.88%
==========================================
Files 25 48 +23
Lines 360 431 +71
Branches 95 96 +1
==========================================
+ Hits 254 296 +42
- Misses 104 132 +28
- Partials 2 3 +1 ☔ View full report in Codecov by Sentry. |
| mainMenu: desktopHeaderDataShape.mainMenu, | ||
| secondaryMenu: desktopHeaderDataShape.secondaryMenumainMenu, | ||
| userMenu: desktopHeaderDataShape.userMenumainMenu, | ||
| loggedOutItems: desktopHeaderDataShape.loggedOutItemsmainMenu, | ||
| logo: desktopHeaderDataShape.logomainMenu, | ||
| logoAltText: desktopHeaderDataShape.logoAltTextmainMenu, | ||
| logoDestination: desktopHeaderDataShape.logoDestinationmainMenu, | ||
| avatar: desktopHeaderDataShape.avatarmainMenu, | ||
| username: desktopHeaderDataShape.usernamemainMenu, | ||
| loggedIn: desktopHeaderDataShape.loggedInmainMenu, |
There was a problem hiding this comment.
I ended up using this pattern in a couple spots. At first I tried doing ...desktopHeaderDataShape but I ran into "has no corresponding propTypes declaration" lint errors so I just did this to work around them. I'm more than open to any suggestions.
There was a problem hiding this comment.
It's either this or tacking on some linter exception (if there even is one). Either way, I'm usually in favor of the more explicit solution, so... I'd keep it like you have it now.
arbrandes
left a comment
There was a problem hiding this comment.
Nice work! I tested it against Learner Dashboard, and it works fine! No regressions, and I was able to customize the header as documented. 👍🏼
| mainMenu: desktopHeaderDataShape.mainMenu, | ||
| secondaryMenu: desktopHeaderDataShape.secondaryMenumainMenu, | ||
| userMenu: desktopHeaderDataShape.userMenumainMenu, | ||
| loggedOutItems: desktopHeaderDataShape.loggedOutItemsmainMenu, | ||
| logo: desktopHeaderDataShape.logomainMenu, | ||
| logoAltText: desktopHeaderDataShape.logoAltTextmainMenu, | ||
| logoDestination: desktopHeaderDataShape.logoDestinationmainMenu, | ||
| avatar: desktopHeaderDataShape.avatarmainMenu, | ||
| username: desktopHeaderDataShape.usernamemainMenu, | ||
| loggedIn: desktopHeaderDataShape.loggedInmainMenu, |
There was a problem hiding this comment.
It's either this or tacking on some linter exception (if there even is one). Either way, I'm usually in favor of the more explicit solution, so... I'd keep it like you have it now.
Add the following
frontend-plugin-frameworkslots:desktop_main_menu_slotdesktop_secondary_menu_slotmobile_main_menu_slotcourse_info_slotlearning_help_slotdesktop_logged_out_items_slotmobile_logged_out_items_slotmobile_user_menu_slotdesktop_user_menu_slotlearning_user_menu_slotlearning_logged_out_items_slotdesktop_header_slotTo see the documentation in non-diff form go here: https://github.com/brian-smith-tcril/frontend-component-header/tree/fpf-slots/src/plugin-slots