Skip to content

Commit

Permalink
show drag and drop on all items with iiif manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
dnoneill committed Jul 12, 2024
1 parent 24aba2e commit e7de743
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 e7de743

Please sign in to comment.