Skip to content

Commit

Permalink
Merge pull request #1145 from sul-dlss/canvas-id
Browse files Browse the repository at this point in the history
canvas_index to canvas_id
  • Loading branch information
Jessie Keck authored Apr 5, 2018
2 parents bbc90d0 + 9db468a commit c7c5c8e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
### Security

## [1.17.3] - 2018-04-04

### Fixed
- Use the correct parameter that sul-embed expects for canvas id #1145


## [1.17.2] - 2018-04-04

### Security
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def render_viewer_in_context(document, block)
##
#
# @param [SolrDocument] document
# @param [Integer] canvas_index
def custom_render_oembed_tag_async(document, canvas_index)
# @param [Integer] canvas_id
def custom_render_oembed_tag_async(document, canvas_id)
url = context_specific_oembed_url(document)

content_tag :div, '', data: { embed_url: blacklight_oembed_engine.embed_url(url: url, canvas_index: canvas_index) }
content_tag :div, '', data: { embed_url: blacklight_oembed_engine.embed_url(url: url, canvas_id: canvas_id) }
end

##
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/blacklight_oembed.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Blacklight::Oembed::Engine.config.additional_params = [:canvas_index]
Blacklight::Oembed::Engine.config.additional_params = [:canvas_id]
4 changes: 2 additions & 2 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)
rendered = helper.custom_render_oembed_tag_async(document, 3)
expect(rendered).to have_css '[data-embed-url="http://test.host/oembed/e'\
'mbed?canvas_index=3&url=http%3A%2F%2Fexample.com%2Fstuff"]'
'mbed?canvas_id=3&url=http%3A%2F%2Fexample.com%2Fstuff"]'
end
end

Expand All @@ -41,7 +41,7 @@
)
rendered = helper.custom_render_oembed_tag_async(document, 3)
expect(rendered).to have_css '[data-embed-url="http://test.host/oembed/e'\
'mbed?canvas_index=3&url=https%3A%2F%2Fsul-purl-uat.stanford.edu%2Fabc123"]'
'mbed?canvas_id=3&url=https%3A%2F%2Fsul-purl-uat.stanford.edu%2Fabc123"]'
end
end
end
Expand Down

0 comments on commit c7c5c8e

Please sign in to comment.