Skip to content

Fixes for embedded Mirador viewer#3648

Closed
mspalti wants to merge 4 commits into
DSpace:mainfrom
mspalti:iiif-viewer-fixes
Closed

Fixes for embedded Mirador viewer#3648
mspalti wants to merge 4 commits into
DSpace:mainfrom
mspalti:iiif-viewer-fixes

Conversation

@mspalti
Copy link
Copy Markdown
Member

@mspalti mspalti commented Nov 12, 2024

Description

Fixes a few minor bugs involving the embedded Mirador viewer.

Instructions for Reviewers

Bug 1: Currently you can remove or add the mirador viewer by only removing or adding the dspace.iiif.enabled field from the Item. Toggling the value to true or false has no effect. This PR makes it possible to show/hide the viewer by updating the field value.

Bug 2: For sites that support the IIIF Content Search API it's extremely useful to pass the DSpace query to the viewer. The query is obtained from the Angular route history. The current implementation doesn't work for searches executed from new community and collection pages and is updated here to support all route paths that include a query parameter.

Bug 3: When embedding the viewer we see errors in console. This PR should eliminate those errors.

You can test by adding dspace.iiif.enabled to an item and toggling the value to true and false to verify that the viewer is correctly enabled and disabled.

IIIF Content Search can't be tested directly, but if you view an IIIF-enabled item from a list of search results on a community page you should see the query term in the iframe URL. (If you also add iiif.search.enabled to the item metadata the query term will appear in the viewer.)

Console should be clear of errors.

List of changes in this PR:

  • iiif-item-utils is updated to address the first two bugs listed above
  • The mirador component and template are modified to use the DsSafeUrl pipe when adding the URL to the Mirador iframe. This fixes the unsafe resource url error in console that was triggered when using an observable.
  • A minor change to the mirador config.default.js fixes a second console error

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge integration: IIIF Related to International Image Interoperability Framework (IIIF) support port to dspace-7_x port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Nov 12, 2024
@github-actions
Copy link
Copy Markdown

Hi @mspalti,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release May 19, 2025
@EikLoe
Copy link
Copy Markdown
Member

EikLoe commented Sep 18, 2025

Hi @mspalti ,
thanks for the PR. Could you remove the merge conflicts, so I can test it?

@mspalti
Copy link
Copy Markdown
Member Author

mspalti commented Sep 30, 2025

Hi @EikLoe ,
I think this is ready for review. Sorry not to get to it sooner.

@mspalti
Copy link
Copy Markdown
Member Author

mspalti commented Sep 30, 2025

Just a quick on testing the search query.

To verify it is working the item metadata must include iiif.search.enabled=true. I was mistaken above when I said that the query will appear in the iframe url even if search is not enabled.

@tdonohue tdonohue added the port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release label Oct 1, 2025
@EikLoe EikLoe self-requested a review October 16, 2025 11:04
@EikLoe EikLoe moved this from 🙋 Needs Reviewers Assigned to 👀 Under Review in DSpace 10.0 Release Oct 16, 2025
@github-actions
Copy link
Copy Markdown

Hi @mspalti,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@lgeggleston lgeggleston moved this to 👀 Under Review in DSpace 11.0 Release Jun 1, 2026
@lgeggleston lgeggleston added port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release and removed port to dspace-7_x labels Jun 1, 2026
@mspalti
Copy link
Copy Markdown
Member Author

mspalti commented Jun 4, 2026

The important bug appears to be resolved by #5541

I'll submit another PR for two other minor issues mentioned above.

@mspalti mspalti closed this Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from 👀 Under Review to ✅ Done in DSpace 11.0 Release Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug integration: IIIF Related to International Image Interoperability Framework (IIIF) support merge conflict port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants