Skip to content

Commit

Permalink
[wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgriffiniii committed Nov 3, 2022
1 parent 85a06f0 commit 795fdf1
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 31 deletions.
20 changes: 0 additions & 20 deletions app/views/works/_additional_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
<div class="section-title">
<div class="field">
Publisher:<span class="required-field">*</span><br>
<input type="text" id="publisher" name="publisher" class="input-text-long" value="<%= @work.resource.publisher %>" />
</div>

<div class="field">
Publication Year:<span class="required-field">*</span><br>
<input type="text" id="publication_year" name="publication_year" class="input-text-year" value="<%= @work.resource.publication_year %>" />
</div>

<!-- Collection field -->
<div class="field">
Collection: <span class="required-field">*</span><br>
<select id="collection_id" name="collection_id" class="input-text-long" >
<% current_user.submitter_collections.each do |collection| %>
<option value="<%=collection.id%>" <%= @work.collection_id == collection.id ? "selected" : "" %>><%=collection.title%></option>
<% end %>
</select>
</div>

<!-- Keywords field -->
<div class="field">
Keywords: <span class="text-muted field-hint">(enter keywords, e.g. Humanities, Life Sciences)</span><br>
Expand Down
20 changes: 20 additions & 0 deletions app/views/works/_curator_controlled_display.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<div class="section-title">
<!-- Publisher field -->
<div class="field">
Publisher:<span class="required-field">*</span><br>
<input type="text" id="publisher" name="publisher" class="input-text-long" value="<%= @work.resource.publisher %>" readonly />
</div>

<!-- Publication year field -->
<div class="field">
Publication Year:<span class="required-field">*</span><br>
<input type="text" id="publication_year" name="publication_year" class="input-text-year" value="<%= @work.resource.publication_year %>" readonly />
</div>

<!-- DOI field -->
<div class="field">
DOI:<br>
Expand Down Expand Up @@ -29,6 +41,14 @@
<input id="version_number" name="version_number" class="input-text-long" value="<%= @work.resource.version_number %>" readonly/>
</div>

<!-- Collection field -->
<div class="field">
Collections: <span class="required-field">*</span><br>
<% current_user.submitter_collections.each do |collection| %>
<input id="collection" name="collection" class="input-text-long" value="<%= collection.title %>" readonly/>
<% end %>
</div>

<!-- Collection Tags -->
<div class="field">
Collection Tags:<br>
Expand Down
21 changes: 20 additions & 1 deletion app/views/works/_curator_controlled_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<div class="section-title">
<div class="field">
Publisher:<span class="required-field">*</span><br>
<input type="text" id="publisher" name="publisher" class="input-text-long" value="<%= @work.resource.publisher %>" />
</div>

<div class="field">
Publication Year:<span class="required-field">*</span><br>
<input type="text" id="publication_year" name="publication_year" class="input-text-year" value="<%= @work.resource.publication_year %>" />
</div>

<!-- DOI field (mostly for legacy DSpace works) -->
<div class="field">
<% if @wizard_mode || @work.persisted? %>
Expand Down Expand Up @@ -43,10 +53,19 @@
</select>
</div>

<!-- Collection field -->
<div class="field">
Collection: <span class="required-field">*</span><br>
<select id="collection_id" name="collection_id" class="input-text-long" >
<% current_user.submitter_collections.each do |collection| %>
<option value="<%=collection.id%>" <%= @work.collection_id == collection.id ? "selected" : "" %>><%=collection.title%></option>
<% end %>
</select>
</div>

<!-- Collection Tags field -->
<div class="field">
Collection Tags: <span class="text-muted field-hint">(enter tags that identify the collect in a comma separated list, e.g. Humanities, Life Sciences)</span><br>
<input type="text" id="collection_tags" name="collection_tags" class="input-text-long" value="<%= @work.resource.collection_tags.join(', ') %>" />
</div>

</div>
3 changes: 1 addition & 2 deletions spec/system/attention_form_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@
click_on "Add Another Creator"
fill_in "given_name_5", with: "Michael"
fill_in "family_name_5", with: "Graziano"
click_on "v-pills-additional-tab"
click_on "v-pills-curator-controlled-tab"
fill_in "publisher", with: publisher
fill_in "publication_year", with: 2020
find("#collection_id").find(:xpath, "option[1]").select_option
click_on "v-pills-curator-controlled-tab"
fill_in "doi", with: doi
fill_in "ark", with: ark
click_on "Create"
Expand Down
2 changes: 1 addition & 1 deletion spec/system/bitklavier_form_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
click_on "Add Another Creator"
fill_in "given_name_5", with: "Christien"
fill_in "family_name_5", with: "Ayres"
click_on "v-pills-additional-tab"
click_on "v-pills-curator-controlled-tab"
fill_in "publisher", with: publisher
fill_in "publication_year", with: 2021
find("#collection_id").find(:xpath, "option[1]").select_option
Expand Down
4 changes: 2 additions & 2 deletions spec/system/cklibrary_form_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
click_on "Add Another Creator"
fill_in "given_name_2", with: "National Science Foundation"
click_on "v-pills-additional-tab"
fill_in "keywords", with: keywords
click_on "v-pills-curator-controlled-tab"
fill_in "publisher", with: publisher
fill_in "publication_year", with: 2020
find("#collection_id").find(:xpath, "option[1]").select_option
fill_in "keywords", with: keywords
click_on "v-pills-curator-controlled-tab"
fill_in "doi", with: doi
fill_in "ark", with: ark
click_on "Create"
Expand Down
2 changes: 1 addition & 1 deletion spec/system/cytoskeletal_form_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
click_on "Add Another Creator"
fill_in "given_name_14", with: "Nina R"
fill_in "family_name_14", with: "Salama"
click_on "v-pills-additional-tab"
click_on "v-pills-curation-tab"
fill_in "publisher", with: publisher
fill_in "publication_year", with: 2019
find("#collection_id").find(:xpath, "option[1]").select_option
Expand Down
2 changes: 1 addition & 1 deletion spec/system/femtosecond_form_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
click_on "Add Another Creator"
fill_in "given_name_19", with: "Thomas S"
fill_in "family_name_19", with: "Duffy"
click_on "v-pills-additional-tab"
click_on "v-pills-curator-controlled-tab"
fill_in "publisher", with: publisher
fill_in "publication_year", with: 2020
find("#collection_id").find(:xpath, "option[1]").select_option
Expand Down
2 changes: 1 addition & 1 deletion spec/system/form_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
click_on "Create New"
fill_in "description", with: description
find("#rights_identifier").find(:xpath, "option[2]").select_option
click_on "Additional Metadata"
click_on "Curator Controlled"
fill_in "publication_year", with: issue_date
click_on "Save Work"
page.find(:xpath, "//input[@value='file_other']").choose
Expand Down
2 changes: 0 additions & 2 deletions spec/system/migrate_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
click_on "Curator Controlled"
fill_in "doi", with: doi
fill_in "ark", with: ark
click_on "Additional Metadata"
fill_in "publication_year", with: issue_date
click_on "Create"
click_on "Complete"
Expand Down Expand Up @@ -91,7 +90,6 @@
click_on "Curator Controlled"
fill_in "doi", with: doi
fill_in "ark", with: ark
click_on "Additional Metadata"
fill_in "publication_year", with: issue_date
click_on "Create"
expect(page).to have_content "Must provide a title"
Expand Down

0 comments on commit 795fdf1

Please sign in to comment.