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: add functionality to see unit draft preview #1501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KristinAoki
Copy link
Member

Description

This PR adds a new route that supports unit preview and updates the iframe url to include a param to tell the backend that the content should be from the draft branch of the unit.

Supporting information

JIRA Ticket: AU-1067 🔒

The Preview environment has drifted a bit away from the live view. The particular thing I spotted was that all the unit content is in an iframe, and preview doesn’t. There are some visual differences too, like the size of navigation elements, the placement of the bottom-of-page Previous/Next buttons, etc.

Things still look fairly accurate, but if you’re testing javascript, it can be a big difference.

Testing instructions

  1. Open a course in Studio
  2. Publish an existing unit
  3. Make a change to the unit so that it is showing a draft version in Studio
  4. Click "View live"
  5. Confirm that the published version of unit is visible
  6. Confirm that preview is not in the URL
  7. Go back to the Studio page
  8. Click "Preview"
  9. Confirm that the draft version of the unit is visible
  10. Confirm that "preview" is at the beginning of the URL

Other information

This PR is dependent on edx-platform PR #35687

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

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

Project coverage is 88.66%. Comparing base (2a58ad2) to head (9916625).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/courseware/CoursewareContainer.jsx 60.86% 18 Missing ⚠️
src/courseware/course/Course.jsx 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1501      +/-   ##
==========================================
- Coverage   88.69%   88.66%   -0.04%     
==========================================
  Files         312      314       +2     
  Lines        5501     5538      +37     
  Branches     1365     1336      -29     
==========================================
+ Hits         4879     4910      +31     
- Misses        605      611       +6     
  Partials       17       17              

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

@nsprenkle nsprenkle self-requested a review October 22, 2024 17:51
Copy link

@nsprenkle nsprenkle 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 (with the obvious caveat that several changed lines are missing unit tests) and have verified behavior locally 👍

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