Skip to content

Conversation

asadali145
Copy link

@asadali145 asadali145 commented Aug 19, 2025

Description

Fixes the thumbnail to allow uploads if there is no existing thumbnail

Supporting information

  • Upload a video in a course and make sure you have no thumbnail set for the video.
  • Go to the Video page in Authoring MFE, and see that you cannot upload a thumbnail

Testing instructions

  • Upload a video in a course and make sure you have no thumbnail set for the video.
  • Go to the Video page in Authoring MFE, and see that you cannot upload a thumbnail
  • If you cannot upload video then add it through admin in edxval models.

Screenshots

Before:
https://github.com/user-attachments/assets/70cdea3e-1aa1-4035-8520-ee1e98a943cd

After:
https://github.com/user-attachments/assets/38ae3e74-b480-492b-b726-ec4aab782401

@openedx-webhooks
Copy link

Thanks for the pull request, @asadali145!

This repository is currently maintained by @bradenmacdonald.

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 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.


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 Aug 19, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Aug 19, 2025
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.63%. Comparing base (a7860b8) to head (086c0ff).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2388   +/-   ##
=======================================
  Coverage   94.63%   94.63%           
=======================================
  Files        1180     1180           
  Lines       26151    26154    +3     
  Branches     5836     5822   -14     
=======================================
+ Hits        24747    24751    +4     
- Misses       1333     1340    +7     
+ Partials       71       63    -8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@asadali145 asadali145 moved this from Needs Triage to Ready for Review in Contributions Aug 19, 2025
@bradenmacdonald
Copy link
Contributor

This seems to work, but when there's no thumbnail it displays a broken image placeholder. Do you think we can put a proper "no thumbnail" image/text instead of using the browser's "broken image" ?

Screenshot 2025-08-20 at 5 34 07 PM

@asadali145
Copy link
Author

This seems to work, but when there's no thumbnail it displays a broken image placeholder. Do you think we can put a proper "no thumbnail" image/text instead of using the browser's "broken image" ?

@bradenmacdonald Thanks for the review. I have updated the PR to keep the default SVG for the video icon and fix the upload. Can you please rereview this one?

Screenshot 2025-08-21 at 12 56 47 PM Screenshot 2025-08-21 at 12 56 54 PM

@bradenmacdonald
Copy link
Contributor

@asadali145 That looks better, thanks! But now there are a bunch of issues on systems where users are not allowed to upload thumbnails (allowThumbnailUpload is false) - it still shows the button but it doesn't work and even causes a crash:

Screen.Recording.2025-08-22.at.3.21.52.PM.mov

@bradenmacdonald bradenmacdonald removed the request for review from KristinAoki August 22, 2025 22:24
@asadali145 asadali145 force-pushed the asad/fix-thumbnail-when-no-thumbnail branch from 2489f7f to d6b9ae1 Compare August 27, 2025 09:27
@asadali145
Copy link
Author

@bradenmacdonald, thanks for identifying the issue. I have updated my implementation to respect the allowThumbnailUpload flag. Could you please re-review this?

@asadali145
Copy link
Author

@bradenmacdonald A reminder that this is ready for another look.

@bradenmacdonald
Copy link
Contributor

@asadali145 Sorry for the delay. I'll try to look again soon.

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Sep 4, 2025

@asadali145 OK, when I have allowThumbnailUpload set to false, it looks good, and doesn't allow upload and doesn't change when I hover over the missing thumbnail ✅

Side note: it does say "Unknown". Is it supposed to say "Unknown"? (That's the value of status - it may just be an issue with my system since I'm not really using VAL) This isn't an issue with your PR so not something to fix now necessarily; it does seem wrong though.

Screenshot 2025-09-03 at 6 49 58 PM

When I set allowThumbnailUpload to true, it no longer shows the "Upload" overlay for me and I can't upload a thumbnail. Am I missing something?

Screen.Recording.2025-09-03.at.6.51.29.PM.mov

@asadali145 asadali145 force-pushed the asad/fix-thumbnail-when-no-thumbnail branch from df70429 to 086c0ff Compare September 4, 2025 11:21
@asadali145
Copy link
Author

@bradenmacdonald, I am not sure about this behavior that you see. I have tested it again and recorded the attached video. Can you please make sure that you are on my branch and the flag is set properly?

Screen.Recording.2025-09-04.at.4.19.10.PM.mov

@asadali145
Copy link
Author

@bradenmacdonald Would you be able to look at this today? We have a planned teak release for one of our deployments on Tuesday and would love to bring this fix in teak.

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asadali145 OK, I figured out the difference.

If the video has imported status, it works fine as shown in your screenshot. But if the video has ready status, it doesn't work at all.

Video status is imported:

✅ looks good.

Screenshot 2025-09-05 at 4 30 10 PM

Video status is ready:

❌ Button to upload thumbnail does not appear, but the hover effect is still there.

Screenshot 2025-09-05 at 4 30 46 PM

To reproduce:

  1. Go to http://studio.local.openedx.io:8001/admin/edxval/video/ (or first http://studio.local.openedx.io:8001/admin/edxval/coursevideo/ if necessary), find the video, and change its status from imported to ready.
  2. Go back to the page and notice that it's not working.

>
<Icon src={VideoFile} style={{ height: '48px', width: '48px' }} />
</div>
)}
</div>
<div className="add-thumbnail" data-testid={`video-thumbnail-${id}`}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This add-thumbnail div with the button needs to be moved below, where the FileInput is. In other words, we should not hide this button when showThunbnail is false.

      {allowThumbnailUpload && (
        <>
          <div className="add-thumbnail" data-testid={`video-thumbnail-${id}`}>
            <Button
              variant="primary"
              size="sm"
              onClick={fileInputControl.click}
              tabIndex={0}
            >
              {addThumbnailMessage}
            </Button>
          </div>
          <FileInput
            key="video-thumbnail-upload"
            fileInput={fileInputControl}
            supportedFileFormats={supportedFiles}
            allowMultiple={false}
          />
        </>
      )}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

3 participants