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

Add setAjaxHeaders method to Viewer and TiledImage #2346

Merged
merged 10 commits into from
May 19, 2023

Conversation

uschmidt83
Copy link
Contributor

@uschmidt83 uschmidt83 commented May 3, 2023

See #1748 for background.

  • I haven't yet tested this at all.
  • There is a breaking change for those who directly use new TiledImage(...) (instead of the recommended Viewer.open(...) or Viewer.addTiledImage(...)) and set ajaxHeaders options for both Viewer and TiledImage. Previously, new TiledImage(options) didn't merge options.ajaxHeaders with Viewer.ajaxHeaders, but now it does.

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

This is looking good! You've done a great job of tracking down lots of details here.

Just a few thoughts...

src/viewer.js Outdated Show resolved Hide resolved
src/viewer.js Show resolved Hide resolved
src/viewer.js Outdated Show resolved Hide resolved
src/tiledimage.js Outdated Show resolved Hide resolved
src/tiledimage.js Outdated Show resolved Hide resolved
src/tiledimage.js Outdated Show resolved Hide resolved
- Allow null to clear headers (same as empty object)
- Add TiledImage._updateAjaxHeaders
- Add error message in case of invalid headers
@uschmidt83 uschmidt83 marked this pull request as ready for review May 4, 2023 23:16
test/modules/ajax-tiles.js Outdated Show resolved Hide resolved
src/viewer.js Show resolved Hide resolved
Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

Coming along nicely! Thank you for adding the tests!

Looks like just a few items left :)

@uschmidt83 uschmidt83 requested a review from iangilman May 12, 2023 21:52
Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

This whole time I was confused about what the "pass falsey to override" is supposed to do... Re-reading the doc, I see it's referring to a single header in the headers object... I was thinking it was for the entire headers object! Yeah, it seems fine.

src/tiledimage.js Outdated Show resolved Hide resolved
src/tilesource.js Outdated Show resolved Hide resolved
src/tiledimage.js Outdated Show resolved Hide resolved
@uschmidt83
Copy link
Contributor Author

Unless you object, I think this PR is ready to be merged.

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

Wonderful, thank you! I agree... Let's merge it! Thank you for working through all the issues... I know it can be a pain, but it's worth making sure everything is solid.

@@ -115,7 +115,7 @@ $.ButtonGroup.prototype = {
/**
* Adds the given button to this button group.
*
* @functions
* @function
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for fixing these, BTW!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants