Class: Presenters::SubmissionPlatePresenter

Inherits:
PlatePresenter show all
Includes:
StateChangeless, Presenters::Statemachine::DoesNotAllowLibraryPassing, Presenters::Statemachine::Submission
Defined in:
app/models/presenters/submission_plate_presenter.rb

Overview

The SubmissionPlatePresenter is used when plates enter the process with no assigned pipeline. It presents the user with a selection of workflows, and allows them to generate corresponding Sequencescape submissions. Once these submissions are passed, the plate behaves like a standard stock plate.

Submission options are defined by the submission_options config in the purposes/*.yml file. Structure is: <button text>:

template_name: <submission template name>
request_options:
  <request_option_key>: <request_option_value>
  ...

Instance Method Summary collapse

Instance Method Details

#control_state_changeObject Originally defined in module StateChangeless

#default_state_changeObject Originally defined in module StateChangeless

#each_submission_optionObject



35
36
37
38
39
40
41
42
# File 'app/models/presenters/submission_plate_presenter.rb', line 35

def each_submission_option
  purpose_config.submission_options.each do |button_text, options|
    submission_options = options.to_hash
    submission_options[:asset_groups] = asset_groups
    submission_options[:labware_barcode] = labware.labware_barcode.human
    yield button_text, SequencescapeSubmission.new(submission_options)
  end
end

#pending_submissions?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'app/models/presenters/submission_plate_presenter.rb', line 44

def pending_submissions?
  submissions.any? { |submission| submission.building_in_progress?(ready_buffer: 20.seconds) }
end

#submissionsObject



48
49
50
# File 'app/models/presenters/submission_plate_presenter.rb', line 48

def submissions
  labware.direct_submissions
end