Skip to content

Commit

Permalink
Merge branch 'develop' into sh51/handle-js-missing-pools-index-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHulme committed Oct 22, 2024
2 parents d8b7b29 + 40ef006 commit 60b4bba
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/helpers/page_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def jumbotron(jumbotron_id = nil, options = {}, &)

# eg. state_badge('pending')
# <span class="state-badge-pending">Pending</span>
def state_badge(state)
tag.span(state.titleize, class: "state-badge #{state}", title: 'Labware State', data: { toggle: 'tooltip' })
def state_badge(state, title: 'Labware State')
tag.span(state.titleize, class: "state-badge #{state}", title: title, data: { toggle: 'tooltip' })
end

# eg. count_badge(0)
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_submission_item.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<li>
<%= state_badge(submission_item.state) %> <%= submission_item.name %>
<%= state_badge(submission_item.state, title: 'Submission State') %> <%= submission_item.name %>
</li>
3 changes: 2 additions & 1 deletion config/pipelines/bespoke_pcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ Bespoke PCR MX:
request_type_key:
- limber_multiplexing
relationships:
LBB Lib PCR-XP: LBB Lib Pool Stock
LBB Lib PCR-XP: LBB Lib PCR-XP Norm
LBB Lib PCR-XP Norm: LBB Lib Pool Stock
LBB Lib Pool Stock: LB Lib Pool Norm
2 changes: 2 additions & 0 deletions config/purposes/bespoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ LBB Lib PCR-XP:
:asset_type: plate
:presenter_class: Presenters::PcrPresenter
:creator_class: LabwareCreators::CustomTaggedPlate
LBB Lib PCR-XP Norm:
:asset_type: plate
LBB Ligation Tagged:
:asset_type: plate
:presenter_class: Presenters::PcrPresenter
Expand Down
14 changes: 14 additions & 0 deletions spec/helpers/page_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,18 @@
expect(count_badge(0, 'test')).to eq('<span class="badge badge-pill badge-secondary" id="test">0</span>')
end
end

describe '::state_badge' do
it 'returns a badge with the given state and default title' do
expect(state_badge('pending')).to eq(
'<span class="state-badge pending" title="Labware State" data-toggle="tooltip">Pending</span>'
)
end

it 'returns a badge with the given state and title' do
expect(state_badge('passed', title: 'Submission State')).to eq(
'<span class="state-badge passed" title="Submission State" data-toggle="tooltip">Passed</span>'
)
end
end
end

0 comments on commit 60b4bba

Please sign in to comment.