From 57242a51be081f65ef51b6007c71da0031ca88b3 Mon Sep 17 00:00:00 2001 From: Glen Horton Date: Wed, 17 May 2017 18:32:43 +0000 Subject: [PATCH] Fix visibility form collapse/expand for batches --- app/views/sufia/batch_uploads/_form.html.erb | 6 +++++- spec/views/sufia/batch_uploads/_form.html.erb_spec.rb | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/sufia/batch_uploads/_form.html.erb b/app/views/sufia/batch_uploads/_form.html.erb index 3ef3d866d2..589001714f 100644 --- a/app/views/sufia/batch_uploads/_form.html.erb +++ b/app/views/sufia/batch_uploads/_form.html.erb @@ -1,4 +1,8 @@ -<%= simple_form_for [sufia, @form], html: { multipart: true } do |f| %> +<%= simple_form_for [sufia, @form], + html: { + data: { behavior: 'work-form' }, + multipart: true + } do |f| %> <% content_for :files_tab do %>

To create a single work for all the files, go to <%= link_to "New Work", [:new, Sufia.primary_work_type.model_name.singular_route_key] %>

<%= t("sufia.batch_uploads.files.instructions") %>

diff --git a/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb b/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb index 9106dc14a9..9947c83c46 100644 --- a/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb +++ b/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb @@ -18,6 +18,7 @@ it "draws the page" do expect(page).to have_selector("form[action='/batch_uploads']") + expect(page).to have_selector("form[action='/batch_uploads'][data-behavior='work-form']") # No title, because it's captured per file (e.g. Display label) expect(page).not_to have_selector("input#generic_work_title") expect(view.content_for(:files_tab)).to have_link("New Work", href: "/concern/generic_works/new")