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

Add toggle to pre-publish panel to publish lessons when course is published #7536

Merged
merged 13 commits into from Mar 14, 2024

Conversation

donnapep
Copy link
Collaborator

@donnapep donnapep commented Mar 12, 2024

Resolves #7457.

Proposed Changes

Add a Publish lessons toggle to the pre-publish panel. When enabled, any lessons associated with the course are published when the course is published.

Screenshot 2024-03-13 at 2 45 42 PM

Testing Instructions

  1. Create a course with some lessons
  2. Click the Publish button.
  3. On the pre-publish panel, ensure Publish lessons is selected.
  4. Click the Publish button.
  5. Check that the lessons are published.
  6. Create another course with some lessons.
  7. Click the Publish button.
  8. On the pre-publish panel, deselect the Publish lessons toggle.
  9. Check that the lessons are NOT published.
  10. Switch the course back to Draft status.
  11. Check that the Publish lessons toggle is still deselected.
  12. Select Publish lessons.
  13. Click the Publish button.
  14. Check that the lessons are published.
  15. Check that the Sensei icon for opening the Course Settings is still the Sensei green color.

Known Issue

The first time the course is viewed on the frontend, the following notice appears:

Screenshot 2024-03-13 at 2 37 45 PM

@renatho I know you did some work on notices not that long ago, including adding this one. Do you know of a simple way to solve this? If not, then I think I'll leave this as a known issue since the notice goes away on a refresh.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Legacy courses (course without blocks) are tested
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@donnapep donnapep added this to the 4.21.1 milestone Mar 12, 2024
@donnapep donnapep self-assigned this Mar 12, 2024
@donnapep donnapep added the [Status] Needs Documentation Requires documentation updates label Mar 12, 2024
Copy link

github-actions bot commented Mar 12, 2024

WordPress Dependencies Report

The github-action-wordpress-dependencies-report action has detected some script changes between the commit 2c5b426 and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Dependencies Removed Dependencies Total Size Size Diff
js/admin/course-edit.js 10.2 kB -13 B ( -0.13% ⬇️ )
setup-wizard/index.js 16.7 kB +5 B ( +0.03% 🔼 )
home/index.js 21.1 kB +8 B ( +0.04% 🔼 )
blocks/single-page.js 15.8 kB +7 B ( +0.05% 🔼 )
blocks/single-course.js 29.1 kB +8 B ( +0.03% 🔼 )
blocks/single-lesson.js 8.05 kB +1 B ( +0.02% 🔼 )
blocks/lesson-action-blocks.js 13.6 kB +8 B ( +0.06% 🔼 )
blocks/global-blocks.js 20.5 kB +7 B ( +0.04% 🔼 )
blocks/quiz/index.js 31.2 kB +9 B ( +0.03% 🔼 )
blocks/shared.js 14 kB -2 B ( -0.02% ⬇️ )
blocks/core-pattern-polyfill/core-pattern-polyfill.js 5.02 kB -2 B ( -0.04% ⬇️ )
admin/course-pre-publish-panel/index.js react, wp-components, wp-core-data, wp-edit-post, wp-element, wp-i18n, wp-plugins, wp-polyfill 4.87 kB +4.87 kB ( +100% 🔼 )
admin/editor-wizard/index.js 13 kB +8 B ( +0.07% 🔼 )
course-theme/blocks/index.js 13.9 kB +4 B ( +0.03% 🔼 )

This comment was automatically generated by the github-action-wordpress-dependencies-report action.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 35.89744% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 51.93%. Comparing base (9c9bcae) to head (2c5b426).
Report is 24 commits behind head on trunk.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7536      +/-   ##
============================================
- Coverage     51.93%   51.93%   -0.01%     
- Complexity    11267    11277      +10     
============================================
  Files           630      631       +1     
  Lines         47665    47710      +45     
  Branches        420      421       +1     
============================================
+ Hits          24756    24779      +23     
- Misses        22572    22594      +22     
  Partials        337      337              
Files Coverage Δ
includes/class-sensei-data-cleaner.php 87.75% <ø> (ø)
includes/class-sensei.php 24.94% <0.00%> (-0.06%) ⬇️
includes/class-sensei-course.php 38.72% <0.00%> (-0.23%) ⬇️
...es/admin/class-sensei-course-pre-publish-panel.php 51.85% <51.85%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 790e451...2c5b426. Read the comment docs.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

Test the previous changes of this PR with WordPress Playground.

Copy link

Test the previous changes of this PR with WordPress Playground.

@donnapep donnapep marked this pull request as ready for review March 13, 2024 18:43
@donnapep donnapep requested a review from a team March 13, 2024 18:46
Imran92
Imran92 previously approved these changes Mar 14, 2024
Copy link
Contributor

@Imran92 Imran92 left a comment

Choose a reason for hiding this comment

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

Looks good and works well. Just left a couple of small comments about doc tags.

Copy link

Test the previous changes of this PR with WordPress Playground.

@donnapep donnapep merged commit 28db587 into trunk Mar 14, 2024
24 of 25 checks passed
@donnapep donnapep deleted the update/save-lessons-on-course-save branch March 14, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Documentation Requires documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish lessons when course is published
2 participants