Skip to content

Commit

Permalink
Merge branch 'main' into nimmo-system-test-class-selector-adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed May 16, 2024
2 parents 3f18ffd + 4f69b78 commit d140e92
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/helpers/tabs/herbarium_records_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def herbarium_record_form_edit_tabs(back:, back_object:)
links << nonpersonal_herbaria_index_tab
end

def show_herbarium_record_tab(h_r, obs)
def herbarium_record_tab(h_r, obs)
# This is passed in to show_herbarium_record, allowing users to do prev,
# next and index from there to navigate through all the rest for this obs.
hr_query = Query.lookup(:HerbariumRecord, :all, observations: obs.id)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/tabs/sequences_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def sequence_form_tabs(obj:)
[object_return_tab(obj)]
end

def show_sequence_tab(seq, obs)
def sequence_tab(seq, obs)
# This is passed in to show_sequence, allowing users to do prev,
# next and index from there to navigate through all the rest for this obs.
sq_query = Query.lookup(:Sequence, :all, observations: obs.id)
Expand Down
8 changes: 4 additions & 4 deletions app/views/controllers/herbaria/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ nonpersonal = (@query&.flavor == :nonpersonal)
<% if !@merge || !@user %>
<%= link_with_query(
herbarium.name.t, herbarium_path(herbarium),
id: "show_herbarium_link_#{herbarium.id}"
class: "herbarium_link_#{herbarium.id}"
) %>
<% elsif @merge != herbarium %>
<%# Cannot POST from a link without js; Use buttons instead %>
<%= post_button(
name: herbarium.name.t,
path: herbaria_merges_path(src: @merge.id,
dest: herbarium.id),
id: "herbaria_merges_link_#{@merge.id}_#{herbarium.id}",
class: "herbaria_merges_link_#{@merge.id}_#{herbarium.id}",
confirm: :are_you_sure.t
) %>
<% else %>
Expand All @@ -62,9 +62,9 @@ nonpersonal = (@query&.flavor == :nonpersonal)
<% if @user && !@merge &&
(herbarium.can_edit? || in_admin_mode?) %>
[<%= link_with_query(:EDIT.t, edit_herbarium_path(herbarium),
id: "edit_herbarium_link_#{herbarium.id}") %> |
class: "edit_herbarium_link_#{herbarium.id}") %> |
<%= link_to(:MERGE.t, herbaria_path(merge: herbarium.id),
id: "merge_herbarium_link_#{herbarium.id}") %>]
class: "merge_herbarium_link_#{herbarium.id}") %>]
<% end %>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions app/views/controllers/herbaria/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ map = @herbarium.location ? true : false
count: @herbarium.herbarium_records.length
),
herbarium_records_path(herbarium_id: @herbarium.id),
id: "herbarium_records_for_herbarium_link") %>
class: "herbarium_records_for_herbarium_link") %>
</div>

<div class="mt-3">
Expand Down Expand Up @@ -43,7 +43,7 @@ map = @herbarium.location ? true : false
<%= link_with_query(
:show_herbarium_curator_request.t,
new_herbaria_curator_request_path(id: @herbarium.id),
id: "new_herbaria_curator_request_link"
class: "new_herbaria_curator_request_link"
) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ unless @user.try(&:hide_specimen_stuff?) || obs.user.try(&:hide_specimen_stuff?)
tag.ul(class: "tight-list") do
records.map do |record|
tag.li(id: "herbarium_record_#{record.id}") do
concat(link_to(*show_herbarium_record_tab(record, obs)))
concat(link_to(*herbarium_record_tab(record, obs)))
if record.can_edit? || in_admin_mode?
concat(
[
Expand All @@ -57,7 +57,7 @@ unless @user.try(&:hide_specimen_stuff?) || obs.user.try(&:hide_specimen_stuff?)
end,
tag.ul(class: "tight-list") do
records.map do |record|
tag.li { link_to(*show_herbarium_record_tab(record, obs)) }
tag.li { link_to(*herbarium_record_tab(record, obs)) }
end.safe_join
end
].safe_join(" ")
Expand Down
2 changes: 1 addition & 1 deletion app/views/controllers/observations/show/_sequences.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ can_edit = in_admin_mode? || obs.can_edit?
concat(tag.ul(class:"tight-list") do
sequences.each do |sequence|
concat(tag.li(id: "sequence_#{sequence.id}") do
concat(link_to(*show_sequence_tab(sequence, obs)))
concat(link_to(*sequence_tab(sequence, obs)))

links = []
if sequence.deposit?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_edit_herbarium_record_from_index
assert_selector(
"a[href*='#{herbarium_records_path(herbarium_id: rec.herbarium.id)}']"
)
click_on(id: "herbarium_records_for_herbarium_link")
first(class: "herbarium_records_for_herbarium_link").click

assert_selector("body.herbarium_records__index")
assert_selector("a[href*='#{edit_herbarium_record_path(id: rec.id)}']")
Expand Down Expand Up @@ -288,7 +288,7 @@ def test_curator_request
login!("mary")
visit(herbarium_path(nybg))

click_on(id: "new_herbaria_curator_request_link")
first(class: "new_herbaria_curator_request_link").click
assert_selector("#title", text: :show_herbarium_curator_request.l)

within("#herbarium_curator_request_form") do
Expand Down
2 changes: 1 addition & 1 deletion test/system/observation_show_system_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def test_add_and_edit_naming_and_comment
com = Comment.last
within("#comments_for_object") do
assert_text("A load of bollocks")
assert_selector(".show_user_link_#{rolf.id}")
assert_selector(".user_link_#{rolf.id}")
assert_selector(".edit_comment_link_#{com.id}")
assert_selector(".destroy_comment_link_#{com.id}")
find(:css, ".edit_comment_link_#{com.id}").trigger("click")
Expand Down

0 comments on commit d140e92

Please sign in to comment.