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: direct link to single block in library [FC-0062] #1392

Merged
merged 6 commits into from
Oct 23, 2024

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Oct 17, 2024

Description

Adds support for displaying single xblock in a library when passed a query param: usageKey. This is required for directing users to a specific block from course.

vokoscreenNG-2024-10-23_12-30-33.mp4

Supporting information

Testing instructions

@openedx-webhooks
Copy link

openedx-webhooks commented Oct 17, 2024

Thanks for the pull request, @navinkarkera!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/2u-tnl. Tag them in a comment and let them know that your changes are ready for review.

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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 17, 2024
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.15%. Comparing base (11470f2) to head (ddb24dc).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/editors/EditorContainer.tsx 93.75% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1392   +/-   ##
=======================================
  Coverage   93.15%   93.15%           
=======================================
  Files        1051     1051           
  Lines       20328    20355   +27     
  Branches     4335     4337    +2     
=======================================
+ Hits        18936    18962   +26     
+ Misses       1332     1330    -2     
- Partials       60       63    +3     

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

@navinkarkera navinkarkera changed the title feat: direct link to single block in library feat: direct link to single block in library [FC-0062] Oct 17, 2024
@navinkarkera navinkarkera marked this pull request as ready for review October 17, 2024 10:37
@navinkarkera navinkarkera requested a review from a team as a code owner October 17, 2024 10:37
@ChrisChV
Copy link
Contributor

@navinkarkera I got this error when adding a component in a library, could you check it?

image

@navinkarkera
Copy link
Contributor Author

navinkarkera commented Oct 18, 2024

@ChrisChV Yeah, adding component is in a tricky stage.

You need to checkout openedx/edx-platform#35636 first to add xblocks and then switch to my branch to test this PR.

OR you can test this PR in isolation by manually pasting usageKey param to components url, for example: https://apps.local.openedx.io:2001/course-authoring/library/lib:OpenedX:CSPROB3/components?usageKey=lb%3AOpenedX%3ACSPROB3%3Ahtml%3A843b4c73-1e2d-4ced-a0ff-24e503cdb3e4

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Oct 18, 2024

@navinkarkera @ChrisChV You can just copy a block from a library and paste it in to the course. Should be working fine on any recent-ish master version, and it will set up the upstream/downstream link correctly.

@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Oct 21, 2024
@ChrisChV
Copy link
Contributor

@navinkarkera I don't see the warning alert, I don't know what I'm missing. Could you create a PR of upstream-warning-alert and I'll try again, or maybe @bradenmacdonald can help me test this too?

@navinkarkera
Copy link
Contributor Author

@ChrisChV Will create a PR for edx-platform and update instructions soon.

@navinkarkera
Copy link
Contributor Author

@ChrisChV The edx-platform PR is ready. The alert was not displayed for xblocks using custom tabs in edit modal, fixed it now.

@DanielVZ96
Copy link
Contributor

@navinkarkera I also can't get to display the alert

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Oct 22, 2024

@navinkarkera What XBlock are you testing with? Because it looks like you added the alert to the edx-platform side, but for the blocks we currently support in libraries (text, html, video), the editor is implemented on the MFE side and doesn't display any platform UI at all.

e.g. I click Edit on a Text block and it takes me to http://apps.local.openedx.io:2001/authoring/course/course-v1:BradenX+CP200+23/editor/html/block-v1:BradenX+CP200+23+type@html+block@5579a1d881d74d34aeb0a7e68e935ec1

Edit: Ah, I see - somehow you have the new MFE editor disable for text blocks. That's not the default configuration we're going to ship for Sumac. We also don't need to support Drag and Drop because we don't currently allow them in libraries.

@ChrisChV
Copy link
Contributor

ChrisChV commented Oct 22, 2024

@bradenmacdonald I understood the same thing: the change in the legacy UI. Since the way to add library components and synchronize them is there (copy/paste). So, we don't merge these changes?

EDIT:

Ah, I see - somehow you have the new MFE editor disable for text blocks.

I see it now, I had it disabled too

@bradenmacdonald
Copy link
Contributor

@ChrisChV I guess we could still merge this, but since we try to encourage everyone to use the MFE editors and they're on by default, it's not really solving anything for the default experience which was the main goal. For example, on our sandbox (which is essentially the default configuration for Sumac), you wouldn't even be able to test this.

Default experience = legacy unit page but new MFE editors for Text/Video/Problem

@ChrisChV
Copy link
Contributor

Default experience = legacy unit page but new MFE editors for Text/Video/Problem

@bradenmacdonald Ok, I see it more clearly now. Thanks!

@navinkarkera
Copy link
Contributor Author

Edit: Ah, I see - somehow you have the new MFE editor disable for text blocks. That's not the default configuration we're going to ship for Sumac. We also don't need to support Drag and Drop because we don't currently allow them in libraries.

🤦 My bad, I don't have the new MFE editors enabled. I'll quickly add this warning to the new editors as well and keep the legacy as well since we already implemented it.

@bradenmacdonald
Copy link
Contributor

Hmm, are they not enabled by default in Tutor? If so, we need to fix that.

Adds support for displaying single xblock in a library when passed a
query param: usageKey. This is required for directing users to a
specific block from course.
Displays an alert when user attempts to edit a course block imported
from a library.
@navinkarkera
Copy link
Contributor Author

Not sure, I might have disabled it at some point.

@navinkarkera
Copy link
Contributor Author

Updated this PR to show warning when new editors are used for editing course blocks.

Copy link
Contributor

@ChrisChV ChrisChV 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 👍

  • I tested this: I tested on legacy UI and MFE with text, problem and video
  • I read through the code and considered the security, stability and performance implications of the changes.
  • I tested that the UI can be used with a keyboard only (tab order, keyboard controls).
  • Includes tests for bugfixes and/or features added.
  • Includes documentation
  • Includes fixtures that create objects required for manual testing.

@ChrisChV ChrisChV merged commit f67c3ff into openedx:master Oct 23, 2024
8 checks passed
@ChrisChV ChrisChV deleted the navin/link-to-block branch October 23, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants