Skip to content

Widget fix #11412

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Apr 8, 2025

What this PR does / why we need it: This PR fixes an issue and adds several improvements:

  • It addresses an issue with the original script where, as far as we can tell, it could be delayed in running until the page had additional loaded scripts and the original logic assuming that widgets.js was the last script on the page was faulty. The script now waits for the page to load and will either find the script by id (new) or will scan all scripts to find the one with widgets.js in the source (legacy support).
  • It updates outdated document.write calls with ones that append the iframe/text/scripts below the original script tag
  • It updates jquery to 3.6.0 as used in Dataverse (although jquery is not used in this script, it pre-loads it for widgets-host.js)
  • Various cleanup/reorg

Which issue(s) this PR closes:

  • Closes #

Special notes for your reviewer:

Suggestions on how to test this: Follow the instructions on the collection and dataset edit/theme and widgets panes to add a widget to some other website (I had good luck just using local html files, but any web page should work) and verify that the Dataverse content shows. For Harvard Dataverse, should be tested with the current challenges to verify that it either works or shows the "Max challenge attempts exceeded. Please refresh the page to try again!" message and doesn't silently fail.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

@qqmyers qqmyers moved this to Ready for Triage in IQSS Dataverse Project Apr 8, 2025
@qqmyers qqmyers added the Size: 3 A percentage of a sprint. 2.1 hours. label Apr 8, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Apr 15, 2025
@landreev landreev self-assigned this Apr 15, 2025
@landreev landreev self-requested a review April 15, 2025 15:30
@scolapasta scolapasta moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
Status: In Review 🔎
Development

Successfully merging this pull request may close these issues.

2 participants