-
Notifications
You must be signed in to change notification settings - Fork 156
fix: load sequences in unit page #1867
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
fix: load sequences in unit page #1867
Conversation
Thanks for the pull request, @ihor-romaniuk! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Thanks for the pull request, @ihor-romaniuk! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1867 +/- ##
==========================================
+ Coverage 93.98% 94.01% +0.03%
==========================================
Files 1155 1162 +7
Lines 24146 24434 +288
Branches 5116 5188 +72
==========================================
+ Hits 22693 22971 +278
- Misses 1385 1395 +10
Partials 68 68 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d83432e
to
a6892c0
Compare
a6892c0
to
ad1b589
Compare
ad1b589
to
a079913
Compare
I think you are missing the root cause here. When I open a unit page directly and then log in, without accessing other Authoring MFE pages first, I see this in the network logs:
The second request fails because the So really, I think we need to fix this properly - either:
It seems like there's also duplicate requests being made to each of these endpoints, so in the long term we really should be using React Query to load the data since it will de-duplicate the requests better. However, if you don't have time to fix this "properly" now, I'm fine with merging the fix you've made here - it is reasonable. But my big concern is that we're just going to get more errors like this until we fix the root cause, especially in code that's not using TypeScript so nobody has any idea if fields like |
const sequenceIds = useSelector(getSequenceIds); | ||
const sequenceIndex = sequenceIds.indexOf(currentSequenceId); | ||
const unitIndex = sequence.unitIds.indexOf(currentUnitId); | ||
const unitIndex = sequence.unitIds?.indexOf(currentUnitId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navinkarkera @rpenido @pomegranited FYI on this PR/error. |
What @bradenmacdonald said:
What I suggest is for a new issue to be created with the relevant info, and for us to merge this one as a workaround for Teak in the meantime. |
3629deb
to
ea6e13b
Compare
@arbrandes @bradenmacdonald Thanks for your feedback. I have replaced the old |
Sandbox deployment successful 🚀 |
@ihor-romaniuk, I still see the error (or an error) when I go to the unit page directly while logged out, then immediately log in: This is in this PR's sandbox, btw. |
7a3b305
to
ce05909
Compare
This is looking ready for CC review now -- @navinkarkera or @ChrisChV can you review? I'm not CC on this repo :) |
Hi @ihor-romaniuk , could you add a bit of test coverage to fix the code coverage? |
@arbrandes Would you be able to take another look at this soon? I think it's a pretty high priority bugfix. Or do you need someone else to take on the review? And yes, @ihor-romaniuk , we'll need the codecov check passing to be able to merge this. |
73cc156
to
c5cda97
Compare
Sandbox deployment successful 🚀 |
@pomegranited @bradenmacdonald @arbrandes Test coverage was updated and it's ready for review. |
Sandbox deployment successful 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! It's looking good and it fixes the bugs that I have seen. Since it's such a big refactor I'm not sure if we should backport it to Teak though. Perhaps just the
part, or some smaller bit like that is what we backport?
Edit: that's done - #2042
@arbrandes would you be able to take a quick look here too before we merge, or no? |
Sandbox deployment successful 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quickly looked through it, except for 1 minor comment LGTM! 💯
Sandbox deployment successful 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Let's get it in!
This handles loading errors when opening the course unit page via direct link as an unauthorized user.
This handles loading errors when opening the course unit page via direct link as an unauthorized user. Co-authored-by: Ihor Romaniuk <[email protected]>
* refactor: remove custom order function from course libraries list (openedx#1865) (openedx#1888) (cherry picked from commit bc18fff) * perf: use Library search results to populate container card preview [FC-0083] [TEAK] (openedx#1889) * fix: several library unit page UX bugs (openedx#1868) * fix: rename "Organize" tab to "Manage" * fix: duplicate key warnings * fix: uniform messages while adding to collection * fix: do not allow units be added to a unit (cherry picked from commit 0fdc460) * perf: use Library search results to populate container card preview (openedx#1820) * fix: use Library search results to populate container card preview * feat: show published children when showing only published Unit content * fix: nits (cherry picked from commit 24e4695) --------- Co-authored-by: Rômulo Penido <[email protected]> * fix: manage access modal on duplicated xblock (openedx#1874) * fix: unit pages ux bugs [FC-0083] (openedx#1884) (openedx#1916) This PR fixes some UX bugs related to the unit pages: * Sort for "recently modified" on unit tab does not update after adding new components to units * Change component delete warning message It's a backport of openedx#1884 * fix: UX issues in unit page (openedx#1913) (openedx#1923) Fixes the following issues: * Selection behavior * Component selection is by header click only * Newly created blocks within a unit should be selected on creation/save, appear selected, and have their sidebar open * Some long text components seem to display at the default height rather than a longer height * Within the full-page unit view, the "add to collection" overflow menu item on components does not seem to work/only opens the sidebar. * Draft status indicator text is not vertically centered with icon * When reordering, dragging a short component past a long component often causes a strange stutter effect. * When dragging to reorder a component, moving quickly or scrolling often causes the drag handle to be lost / causes the block to jump somewhere else * Reordering may not consistently support a keyboard-accessible option to change order, like in course authoring * Tag button on component header opens the old tag side pane (cherry picked from commit 8c3fab3) * fix: invalidate search results when publishing all changes in library (openedx#1925) (openedx#1927) (cherry picked from commit cdb8016) Co-authored-by: Braden MacDonald <[email protected]> * fix: improve focus/selected style on library authoring (openedx#1918) (openedx#1930) Improves the focus and selected styles from the LibraryPage and UnitPage. * fix: review/sync bugs [FC-0083] (openedx#1905) (openedx#1941) Fixes issues related to component libraries' review/sync flow * Inconsistent sync pane title versions * Library content shown in preview warning only appears in review changes modal when that modal is opened from the review tab * Some new changes only appear within library review tab on scroll at top of list * Vertically misaligned sync icon in review changes message on course outline * Show available updates whenever content is updated, regardless of number of updates available * fix: Issue with read-only units in libraries & published version of units in library units picker (openedx#1940) Fixes the issues from openedx#1633 (comment) * In successfully added units, the "add new component" widget appears sometimes * In the "add existing unit" modal, the preview shows draft versions of units * fix: search modal refresh on typing (openedx#1938) (openedx#1948) * [Teak] backport openedx#1949, openedx#1999 and openedx#2002 (openedx#2006) * feat: select component and show sidebar on edit (openedx#1949) Select component that is being edited in library and show its sidebar. Also fixes issue with children component listing in library unit page (cherry picked from commit 08ac1c0) * fix: search text flickering (openedx#1999) Fix flickering issue in search field. (cherry picked from commit 6f3b7ab) * feat: open collection or unit page on double click only (openedx#2002) Opens collection or unit page only on double click. (cherry picked from commit 503642b) * fix: change InplaceTextEditor style and add optimistic update (openedx#1953) (openedx#2014) * Optimistic update for renaming Components, Collections and Containers * Change the InplaceTextEditor to show the new text until the onSave promise resolves * Change the InplaceTextEditor style to: Always show the rename button * fix: rename library publish button (openedx#2015) * fix: do open editor of new xblock when duplicating (openedx#2017) * feat: display editors as modals (openedx#1838) * fix: do open editor of new xblock when duplicating (openedx#1887) Fixes bug where after duplicating an xblock, the editor modal of the old xblock is being open instead of the new copied xblock. * [Teak] fix: Inconsistent publish status filter menu placement & fix: Remove never published filter from component picker (openedx#2021) * fix: Inconsistent publish status filter menu placement (openedx#1966) * fix: Remove never published filter from component picker (openedx#1947) Removes the never-published filter option from the component picker and unit picker. * fix: refresh xblock inline after accepting/rejecting library sync (openedx#2022) (openedx#2028) Instead of reloading the entire Unit after syncing changes from the library, just reload the xblock that was changed. (cherry picked from commit ac5574d) * fix: set maxHeight on TextEditor TinyMce widget [FC-0090] (openedx#2024) (openedx#2030) Sets a max_height=500px for the TinyMCE editor when editing a Text/Html component. This prevents the autoresize plugin from expanding the editor textarea beyond the bounds of the editor modal.⚠️ Because the max height can only be a numeric pixel value, we can't use clever settings like vh or %, and so we're forced to limit the height of the editor to a fixed size for all screen sizes in order to address this issue. (cherry picked from commit c5f7d0c) * fix: upstreamInfo is not always provided (openedx#2041) (openedx#2042) (cherry picked from commit 3fc0f27) * fix: selection card wiggle (openedx#2047) * fix: set unit preview readonly on sidebar (openedx#2008) (openedx#2059) Make the unit preview on the sidebar read-only and add `Truncate` to the `InplaceTextEditor` * fix: backport changes for html button in text component markdown editor (openedx#2065) * fix: markdown editor issues in modal (openedx#2076) This PR resolves rendering issues with the Markdown editor inside the modal. The problem began after a PR [1] introduced the use of modals for the editor. The EditorPage [2] component expects a `isMarkdownEditorEnabledForCourse` prop, which was missing in that implementation. [1] openedx#1838 [2] https://github.com/openedx/frontend-app-authoring/pull/1838/files#diff-147218ef88726880178ea895988a5d3feaf2c0c4459086a8de7a4080cbe37de7R226 Backports openedx#2074 * fix: Expand all now expands subsections (openedx#2085) * fix: files & uploads menu was truncated due to overflow-x (openedx#2071) (openedx#2077) * fix: (backport) remove an extra editing xblock modal on unit page (openedx#2111) (openedx#2130) * fix: (backport) enable markdown editor in libraries (openedx#2098) * fix: enable markdown editor for problems in libraries too This fix is also achieved on master via 5991fd3 / openedx#2068 but this is a simpler fix, not a direct backport of that refactor. * fix: remove duplicate markdown_edited save request (openedx#2127) Removes the unnecessary duplicate save request of markdown_edited value to the backend. Part of: openedx#2099 Backports: 62589ae --------- Co-authored-by: Muhammad Anas <[email protected]> * fix: remove icon and empty breadcrumb from libraries (openedx#2129) (openedx#2133) * fix: (backport) text truncate issue in the search modal (openedx#2151) * [Teak] fix: published name in unit sidebar in container picker & Issues on Inplace Editor (openedx#2140) Backport of fix: show unit published name in sidebar on content picker [FC-0090] openedx#2100 Backport of fix: Issue on the Inplace editor [FC-0090] openedx#2101 * feat: add `v2` `CourseAuthoringUnitSidebarSlot` (openedx#2000) * fix: advanced-settings api should not camel-case return value (backport) (openedx#2087) * fix: advanced-settings api should not camel-case return value (openedx#1581) * fix: update advanced module list not working (openedx#2189) Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}` Follow up to openedx#1581 --------- Co-authored-by: Muhammad Faraz Maqsood <[email protected]> * fix: clear selection on files & uploads page after deleting (backport) (openedx#2228) * refactor: remove selected rows when deleting or adding elements * refactor: ensure unique asset IDs when adding new ones * refactor: remove unnecessary loading checks in mockStore function * test: add unit tests for TableActions component * fix: loading unit page directly from link after logging in in Teak (openedx#2246) This is a simple version of the fix for Teak; on master it was fixed with openedx#1867 * fix: pages and resources plugins not rendered (openedx#1885) * docs: (backport) adding comprehensive readme documentation for plugin slots (openedx#2340) * fix: publish btn doesn't show after component edit When we edit & save the component, publish button doesn't show up until we refresh the page manualy or open this unit by opening previous unit and coming back to this unit again. In this commit, we are dispatching a storage event whenever we edit the component, it'll refresh the page & show the publish button as expected. --------- Co-authored-by: Navin Karkera <[email protected]> Co-authored-by: Jillian <[email protected]> Co-authored-by: Rômulo Penido <[email protected]> Co-authored-by: Ihor Romaniuk <[email protected]> Co-authored-by: Braden MacDonald <[email protected]> Co-authored-by: Chris Chávez <[email protected]> Co-authored-by: Daniel Valenzuela <[email protected]> Co-authored-by: Tony Busa <[email protected]> Co-authored-by: Muhammad Anas <[email protected]> Co-authored-by: Victor Navarro <[email protected]> Co-authored-by: diana-villalvazo-wgu <[email protected]> Co-authored-by: bydawen <[email protected]> Co-authored-by: Arunmozhi <[email protected]> Co-authored-by: José Ignacio Palma <[email protected]> Co-authored-by: Muhammad Faraz Maqsood <[email protected]> Co-authored-by: Brayan Cerón <[email protected]> Co-authored-by: Jansen Kantor <[email protected]> Co-authored-by: Jacobo Dominguez <[email protected]> Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
Description
Handle loading errors when opening the course unit page via direct link as an unauthorized user.
Backport:
Screenshots
Case 1: Open course unit page

Case 2: Open Split Test xblock content

Testing instructions
-- Verify that the course unit page loads correctly after authentication.
-- Add Split Test xBlock
-- Open Split Test xBlock content page
-- Verify that the Split Test xBlock content page loads correctly.
Other information
Settings