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

Handle empty module titles on saving the course from the tour #7652

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

merkushin
Copy link
Member

Resolves #7625

The problem described in the issue happens when, while following the tour, the user doesn't set the module title.

The course structure can't be saved in this case, and it causes the issue that the expected “Edit Lesson” link doesn't appear in the toolbar.

Proposed Changes

  • Set default names for modules without titles when we initiate saving the course from the tour.
  • Adjust the text in the tour to instruct the user to set a title for the module.

Testing Instructions

  1. On a new website, create a course, and follow the next steps before saving/publishing the course.
  2. Take the tour and on the third step (“Adding a module”) make sure we mention the need to add the title for the module: “Then click the Module option and give it a name.”
  3. Add a few modules without setting titles for them.
  4. Follow the tour to the end.
  5. Make sure each module without a name got a title like “Module N” where N is an ordinal number towards the end of the tour.
  6. Make sure you see "Edit Lesson" in the toolbar for lessons when the tour says we should see it there.
CleanShot.2024-07-31.at.20.22.48.mp4

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

@merkushin merkushin added this to the 4.24.2 milestone Aug 1, 2024
@merkushin merkushin requested a review from a team August 1, 2024 02:25
@merkushin merkushin self-assigned this Aug 1, 2024
Copy link

github-actions bot commented Aug 1, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

github-actions bot commented Aug 1, 2024

WordPress Dependencies Report

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

Script Handle Added Dependencies Removed Dependencies Total Size Size Diff
admin/tour/course-tour/index.js 37 kB +1.18 kB ( +3.31% 🔼 )

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

Copy link

github-actions bot commented Aug 1, 2024

Test the previous changes of this PR with WordPress Playground.

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.

Copy link

github-actions bot commented Aug 2, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 51.91%. Comparing base (841c158) to head (fa1d39b).
Report is 118 commits behind head on trunk.

Files Patch % Lines
assets/admin/tour/course-tour/steps.js 0.00% 16 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7652      +/-   ##
============================================
+ Coverage     51.84%   51.91%   +0.06%     
- Complexity    11436    11456      +20     
============================================
  Files           652      652              
  Lines         48656    48721      +65     
  Branches        470      475       +5     
============================================
+ Hits          25228    25292      +64     
+ Misses        23047    23045       -2     
- Partials        381      384       +3     
Files Coverage Δ
assets/admin/tour/course-tour/steps.js 1.41% <0.00%> (-0.24%) ⬇️

... and 11 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 4272ec4...fa1d39b. Read the comment docs.

@merkushin
Copy link
Member Author

merkushin commented Aug 2, 2024

Thanks for testing @Imran92.

Unfortunately, the steps module doesn't have any existing tests.
The function I added makes sense only in the context of the module, so I don't even export it.
In current circumstances, I prioritize other work. I'll go ahead and merge the PR.

What do you think about adding a card for covering the whole steps module with tests, and address it next time we'll have time for that?

Update: I created an issue: #7656

@merkushin merkushin merged commit 80d3026 into trunk Aug 2, 2024
24 of 25 checks passed
@merkushin merkushin deleted the fix/handle-empty-module-on-save-frontend branch August 2, 2024 18:12
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.

"Edit Lesson" toolbar option not working with tour
2 participants