Skip to content

feat: add frontend-plugin-framework slots - #545

Merged
brian-smith-tcril merged 1 commit into
openedx:masterfrom
brian-smith-tcril:fpf-slots
Oct 22, 2024
Merged

brian-smith-tcril merged 1 commit into
openedx:masterfrom
brian-smith-tcril:fpf-slots

Conversation

@brian-smith-tcril

@brian-smith-tcril brian-smith-tcril commented Oct 21, 2024 •

Copy link
Copy Markdown
Contributor

Add the following frontend-plugin-framework slots:

  • 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

To see the documentation in non-diff form go here: https://github.com/brian-smith-tcril/frontend-component-header/tree/fpf-slots/src/plugin-slots

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`
@codecov

codecov Bot commented Oct 21, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 74.82993% with 37 lines in your changes missing coverage. Please review.

Project coverage is 68.67%. Comparing base (c64a201) to head (8e39d9e).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/mobile-header/MobileHeaderMainMenu.jsx 23.07% 10 Missing ⚠️
src/desktop-header/DesktopHeaderUserMenu.jsx 33.33% 6 Missing ⚠️
src/mobile-header/MobileHeaderUserMenu.jsx 42.85% 4 Missing ⚠️
...esktop-header/DesktopHeaderMainOrSecondaryMenu.jsx 76.92% 3 Missing ⚠️
src/learning-header/AnonymousUserMenu.jsx 33.33% 2 Missing ⚠️
src/learning-header/LearningLoggedOutButtons.jsx 60.00% 2 Missing ⚠️
src/mobile-header/MobileLoggedOutItems.jsx 60.00% 2 Missing ⚠️
src/learning-header/AuthenticatedUserDropdown.jsx 66.66% 0 Missing and 1 partial ⚠️
...rc/learning-header/LearningHeaderUserMenuItems.jsx 75.00% 1 Missing ⚠️
src/plugin-slots/DesktopUserMenuSlot/index.jsx 66.66% 1 Missing ⚠️
... and 5 more
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.
📢 Have feedback on the report? Share it here.

@brian-smith-tcril
brian-smith-tcril marked this pull request as ready for review October 21, 2024 15:19
Comment on lines +125 to +134
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,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 arbrandes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I tested it against Learner Dashboard, and it works fine! No regressions, and I was able to customize the header as documented. 👍🏼

Comment on lines +125 to +134
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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants