Skip to content

Commit

Permalink
Merge branch 'develop' into develop-Y24-190
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjmchattie committed Oct 24, 2024
2 parents 9a6765e + 859dd00 commit a868e2e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
5 changes: 4 additions & 1 deletion app/frontend/javascript/legacy_scripts_a.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ let limberPlateView = function (defaultTab) {
control.find('a[href="' + defaultTab + '"]').tab('show')

plateElement.on('click', '.aliquot', function (event) {
control.find('a[data-plate-view="pools-view"]').tab('show')

let pool = $(event.currentTarget).data('pool')

control.find('a[data-plate-view="pools-view"]').tab('show')
// Handle cases where pool is not defined to prevent errors
if (pool === undefined || pool === '') return

plateElement
.find('.aliquot[data-pool!=' + pool + ']')
Expand Down
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: 1 addition & 2 deletions config/pipelines/bespoke_pcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,5 @@ Bespoke PCR MX:
request_type_key:
- limber_multiplexing
relationships:
LBB Lib PCR-XP: LBB Lib PCR-XP Norm
LBB Lib PCR-XP Norm: LBB Lib Pool Stock
LBB Lib PCR-XP: LBB Lib Pool Stock
LBB Lib Pool Stock: LB Lib Pool Norm
2 changes: 0 additions & 2 deletions config/purposes/bespoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ 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 a868e2e

Please sign in to comment.