-
Notifications
You must be signed in to change notification settings - Fork 81
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: upload images from the TinyMCE in library editor #1458
feat: upload images from the TinyMCE in library editor #1458
Conversation
Thanks for the pull request, @dcoa! What's next?Please work through the following steps to get your changes 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. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by 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. |
b8d3291
to
f8a53ad
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1458 +/- ##
==========================================
- Coverage 93.01% 93.01% -0.01%
==========================================
Files 1048 1049 +1
Lines 20480 20518 +38
Branches 4402 4343 -59
==========================================
+ Hits 19049 19084 +35
- Misses 1361 1366 +5
+ Partials 70 68 -2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
e276e00
to
2ebb15c
Compare
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 tested this, and the upload worked well but the OLX is wrong:
The resulting OLX was:
<img src="http://studio.local.openedx.io:8001/library_assets/component_versions/f12c83a3-2aab-4599-a145-eab778cc62a4/static/XBlock%20Distribution.png" alt="Example" width="1294" height="837" />
The URL should be just /static/XBlock%20Distribution.png
} else { | ||
dispatch(module.fetchImages({ pageNumber: 0 })); | ||
} | ||
if (isLibraryKey(data.learningContextId)) { dispatch(actions.app.resetImages()); } |
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.
Why do we need to resetImages()
here, any why only for libraries?
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.
When I was testing the functionality I notice that closing the modal don't clean the state, so I can see the images of one component in the other one.
My assumption about why we can see that behavior in courses is not happening in courses because we have a change in the URL (from the legacy unit view to the MFE) that clean the state of the component.
locked: boolean, | ||
}; | ||
|
||
export type LibraryAssetResponse = { |
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.
It would be good to move this type into library-authoring/data.api.ts
and then share it between this file and this existing function:
export async function getXBlockAssets(usageKey: string): Promise<{ path: string; url: string; size: number }[]> { |
d33dc9b
to
ba437c9
Compare
Hi @bradenmacdonald, I made the changes, could you have a look? thanks :) |
The test failures are unrelated, and should be solved if you rebase this. |
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.
Thanks for those changes!
This is looking good to me, except that it's still setting the wrong path in the OLX.
It's setting a full URL like http://studio.local.openedx.io:8001/library_assets/component_versions/94d0c558-a5e3-40af-aafa-2ba731a6121c/static/kevin-mueller-e3fNaRz31Rs-unsplash.jpg
but it should only be /static/kevin-mueller-e3fNaRz31Rs-unsplash.jpg
ba437c9
to
93c20c9
Compare
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.
Sorry for the delay in reviewing. I ran into an unrelated bug: openedx/edx-platform#35853
Hi @bradenmacdonald thank you for the review, I don't have write access over this repo, do you mind merge the PR? |
@dcoa It looks like there is now a test failure on master after this merged. Can you please investigate and fix it? |
Description
This PR allows to upload images from the TinyMCE component.
The changes allows:
What is not cover?
Supporting information
See the issue for more context #1398.
Testing instructions
problem
ortext
from the content options2024-11-06.00-45-59.mov