Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/presenters/plate_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def display_manual_transfer_button?
can_be_enabled?(purpose_config.dig(:manual_transfer, :states))
end

def disable_workflow_creation?
false
end

private

def libraries_passable?
Expand Down
36 changes: 36 additions & 0 deletions app/models/presenters/stock_plate_with_submission_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

module Presenters
#
# Presenters::StockPlateWithSubmissionPresenter is used for stock plates
# which have a submission sidebar when passed.
# This is used for the LCM Triomics pipeline, where the stock plate is used as
# the input plate for the submission, and the user should be able to create
# the submission when the plate is passed.
#
class StockPlateWithSubmissionPresenter < SubmissionPlatePresenter
include Presenters::StockBehaviour
include Presenters::Statemachine::SubmissionWhenPassed

validates_with Validators::SuboptimalValidator
validates_with Validators::ActiveRequestValidator

def allow_new_submission?
true
end

def submission_in_progress?
labware.requests_in_progress.any?
end

def requests_pending?
labware.all_requests.any?(&:pending?)
end

def disable_workflow_creation?
return true if pending_submissions? || requests_pending?

false
end
end
end
2 changes: 1 addition & 1 deletion app/views/plates/_choose_workflow.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<% end %>
<% end %>

<%= submit_tag name, class: 'create-submission-button' %>
<%= submit_tag name, class: 'create-submission-button', disabled: presenter.disable_workflow_creation? %>
<% end %>
<% end %>
<% end %>
Expand Down
17 changes: 16 additions & 1 deletion config/purposes/lcm_triomics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,23 @@ LCMT Lysate:
:stock_plate: true
:cherrypickable_target: false
:input_plate: true
:presenter_class: Presenters::StockPlatePresenter
:presenter_class: Presenters::StockPlateWithSubmissionPresenter
:creator_class: LabwareCreators::Uncreatable
:submission_options:
EM-seq (+ WGS) Branch - Automated Submission:
template_name: 'Limber-Htp - LCM Triomics EMSeq'
allowed_extra_barcodes: false
request_options:
library_type: 'emSEQ'
fragment_size_required_from: '450'
fragment_size_required_to: '450'
RNA-Seq Branch - Automated Submission:
template_name: 'Limber-Htp - LCM Triomics RNASeq'
allowed_extra_barcodes: false
request_options:
library_type: 'Combined LCM RNA'
fragment_size_required_from: '100'
fragment_size_required_to: '500'
:size: 96
LCMT DNA Frag:
:asset_type: plate
Expand Down
Loading