Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show drag and drop on all items with iiif manifest
Browse files Browse the repository at this point in the history
dnoneill committed Jul 12, 2024
1 parent 24aba2e commit 9a1fbd5
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/components/geoblacklight/iiif_drag_drop_component.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@ module Geoblacklight
class IiifDragDropComponent < ViewComponent::Base
def initialize(document:)
super
@manifest = document.viewer_endpoint || ""
@manifest_ref = document.item_viewer&.iiif_manifest
@manifest = @manifest_ref&.endpoint || ""
@href_link = Settings.IIIF_DRAG_DROP_LINK&.gsub("@manifest", @manifest)
end

Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
<%= render Geoblacklight::ItemMapViewerComponent.new(@document) %>

<!-- IIIF drag and drop component -->
<%= render Geoblacklight::IiifDragDropComponent.new(document:@document) if helpers.iiif_manifest_container? %>
<%= render Geoblacklight::IiifDragDropComponent.new(document:@document) %>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -4,7 +4,9 @@

RSpec.describe Geoblacklight::IiifDragDropComponent, type: :component do
describe "#iiifdragdropcomponet" do
let(:document) { instance_double(SolrDocument, id: 123, viewer_endpoint: endpoint) }
let(:reference) { instance_double(Geoblacklight::Reference, endpoint: endpoint) }
let(:item_viewer) { instance_double(Geoblacklight::ItemViewer, iiif_manifest: reference) }
let(:document) { instance_double(SolrDocument, id: 123, item_viewer: item_viewer) }
let(:component) { described_class.new(document: document) }
let(:rendered) { render_inline_to_capybara_node(component) }

0 comments on commit 9a1fbd5

Please sign in to comment.