Skip to content
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

feat: update next unit button plugin for left sidebar navigation usage #1578

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

KristinAoki
Copy link
Member

This PR makes the following changes:

  1. Renames the next_button_slot to next_unit_top_nav_trigger_slot to better capture its role
  2. Moves the plugin to the central plugin folder to make it less hidden in the code
  3. Add the plugin to UnitNavigation when the buttons appear at the top of the unit page. This happens when using left sidebar navigation.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.93%. Comparing base (7865fad) to head (b4cf866).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1578      +/-   ##
==========================================
+ Coverage   89.92%   89.93%   +0.01%     
==========================================
  Files         332      333       +1     
  Lines        5647     5654       +7     
  Branches     1360     1399      +39     
==========================================
+ Hits         5078     5085       +7     
  Misses        554      554              
  Partials       15       15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KristinAoki KristinAoki force-pushed the KristinAoki/update-next-button-plugin branch from ecfe564 to b4cf866 Compare January 27, 2025 21:10
Copy link
Member

@BrandonHBodine BrandonHBodine left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -38,13 +38,33 @@ const UnitNavigation = ({
const { exitActive, exitText } = GetCourseExitNavigation(courseId, intl);
const buttonText = (isLastUnit && exitText) ? exitText : intl.formatMessage(messages.nextButton);
const disabled = isLastUnit && !exitActive;
const variant = 'outline-primary';
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Pulling these out into variables is a little weird to me. I prefer the text being included in the props. Is this a normal practice in this codebase?

Copy link
Member Author

Choose a reason for hiding this comment

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

I put them into a variable because they are being used in two spots and want to guarantee that their values always stay in sync

@KristinAoki KristinAoki merged commit 8823cfa into master Jan 28, 2025
7 checks passed
@KristinAoki KristinAoki deleted the KristinAoki/update-next-button-plugin branch January 28, 2025 18:01
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