From 340081bd4d5c9a23f37c0eccf849564d34d0f300 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Mon, 9 Feb 2026 12:33:45 +0000 Subject: [PATCH 01/17] add RNA Seq branch --- config/purposes/lcm_triomics.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index 3154f8001b..31d9d7c80c 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -37,6 +37,13 @@ LCMT DNA Adp Lig: library_type: 'LCMB' fragment_size_required_from: '450' fragment_size_required_to: '450' + RNA-Seq Branch - Automated Submission: + template_name: 'Limber-Htp - LCM Triomics RNA-Seq' + allowed_extra_barcodes: false + request_options: + library_type: 'LCMB' + fragment_size_required_from: '450' + fragment_size_required_to: '450' :size: 96 # EM Branch From 095bf26182884d283c2d2e0cf88d3970f5bd1b18 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Tue, 10 Feb 2026 21:50:38 +0000 Subject: [PATCH 02/17] check in changes --- .../multi_submission_plate_presenter.rb | 14 +++++++++++ config/purposes/lcm_triomics.yml | 24 ++++++++++++------- 2 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 app/models/presenters/multi_submission_plate_presenter.rb diff --git a/app/models/presenters/multi_submission_plate_presenter.rb b/app/models/presenters/multi_submission_plate_presenter.rb new file mode 100644 index 0000000000..4406a640bb --- /dev/null +++ b/app/models/presenters/multi_submission_plate_presenter.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Presenters + # + # Class PermissivePresenter provides a presenter which allows plate creation + # even when the plate is pending + # + class MultiSubmissionPlatePresenter < PlatePresenter + # include Presenters::Statemachine::Permissive + + # validates_with Validators::SuboptimalValidator + # validates_with Validators::ActiveRequestValidator + end +end diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index 31d9d7c80c..99f75dbf26 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -5,8 +5,21 @@ LCMT Lysate: :stock_plate: true :cherrypickable_target: false :input_plate: true - :presenter_class: Presenters::StockPlatePresenter - :creator_class: LabwareCreators::Uncreatable + :presenter_class: Presenters::SubmissionWhenPassedPlatePresenter + # :creator_class: LabwareCreators::Uncreatable + :submission_options: + EM-seq (+ WGS) Branch - Automated Submission: + template_name: 'Limber-Htp - LCM Triomics - EM-seq' + 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 RNA-Seq' + allowed_extra_barcodes: false + request_options: + library_type: 'Combined LCM RNA' :size: 96 LCMT DNA Frag: :asset_type: plate @@ -37,13 +50,6 @@ LCMT DNA Adp Lig: library_type: 'LCMB' fragment_size_required_from: '450' fragment_size_required_to: '450' - RNA-Seq Branch - Automated Submission: - template_name: 'Limber-Htp - LCM Triomics RNA-Seq' - allowed_extra_barcodes: false - request_options: - library_type: 'LCMB' - fragment_size_required_from: '450' - fragment_size_required_to: '450' :size: 96 # EM Branch From e536e4385a40725fb59b3cba4476d38648c5828f Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Tue, 17 Feb 2026 10:32:35 +0000 Subject: [PATCH 03/17] save changes --- .../stock_plate_with_submission_presenter.rb | 17 +++++++++++++++++ config/purposes/lcm_triomics.yml | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 app/models/presenters/stock_plate_with_submission_presenter.rb diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb new file mode 100644 index 0000000000..00fd7a3cb9 --- /dev/null +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Presenters + + class StockPlateWithSubmissionPresenter < PlatePresenter + include Presenters::Statemachine::Submission + include Presenters::SubmissionBehaviour + include Presenters::StockBehaviour + include Presenters::StateChangeless + + self.allow_well_failure_in_states = [] + self.style_class = 'stock' + + validates_with Validators::SuboptimalValidator + validates_with Validators::ActiveRequestValidator + end +end \ No newline at end of file diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index 99f75dbf26..567088b42b 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -5,18 +5,19 @@ LCMT Lysate: :stock_plate: true :cherrypickable_target: false :input_plate: true - :presenter_class: Presenters::SubmissionWhenPassedPlatePresenter - # :creator_class: LabwareCreators::Uncreatable + :presenter_class: Presenters::StockPlateWithSubmissionPresenter + # :presenter_class: Presenters::StockPlatePresenter + :creator_class: LabwareCreators::Uncreatable :submission_options: EM-seq (+ WGS) Branch - Automated Submission: - template_name: 'Limber-Htp - LCM Triomics - EM-seq' + template_name: 'Limber-Htp - LCM Triomics' 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 RNA-Seq' + template_name: 'Limber-Htp - LCM Triomics - RNA-Seq' allowed_extra_barcodes: false request_options: library_type: 'Combined LCM RNA' From 24e80f1d1372064a2610fc1fca18a7bb7668bdc8 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Fri, 20 Feb 2026 09:21:44 +0000 Subject: [PATCH 04/17] update the template name --- config/purposes/lcm_triomics.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index 567088b42b..a3b28c973e 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -10,14 +10,14 @@ LCMT Lysate: :creator_class: LabwareCreators::Uncreatable :submission_options: EM-seq (+ WGS) Branch - Automated Submission: - template_name: 'Limber-Htp - LCM Triomics' + 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 - RNA-Seq' + template_name: 'Limber-Htp - LCM Triomics RNASeq' allowed_extra_barcodes: false request_options: library_type: 'Combined LCM RNA' From 5250430221c988194ea654765324671c8862fa33 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Fri, 20 Feb 2026 16:15:12 +0000 Subject: [PATCH 05/17] update the config file --- config/purposes/lcm_triomics.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index a3b28c973e..2ec3aac021 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -12,6 +12,8 @@ LCMT Lysate: EM-seq (+ WGS) Branch - Automated Submission: template_name: 'Limber-Htp - LCM Triomics EMSeq' allowed_extra_barcodes: false + # autodetect_studies: true + # autodetect_projects: false request_options: library_type: 'emSEQ' fragment_size_required_from: '450' @@ -19,8 +21,12 @@ LCMT Lysate: RNA-Seq Branch - Automated Submission: template_name: 'Limber-Htp - LCM Triomics RNASeq' allowed_extra_barcodes: false + # autodetect_studies: true + # autodetect_projects: false request_options: library_type: 'Combined LCM RNA' + fragment_size_required_from: '450' + fragment_size_required_to: '450' :size: 96 LCMT DNA Frag: :asset_type: plate From 7dbbb93e4c2b6a26a27f15c5ed1182c981a7c22a Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Fri, 20 Feb 2026 16:27:12 +0000 Subject: [PATCH 06/17] update the presenter --- .../concerns/presenters/submission_behaviour.rb | 2 +- .../stock_plate_with_submission_presenter.rb | 17 +++++++++-------- app/models/sequencescape_submission.rb | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/models/concerns/presenters/submission_behaviour.rb b/app/models/concerns/presenters/submission_behaviour.rb index a5bc29a341..49635c1ce6 100644 --- a/app/models/concerns/presenters/submission_behaviour.rb +++ b/app/models/concerns/presenters/submission_behaviour.rb @@ -33,7 +33,7 @@ def allow_new_submission? def asset_groups @asset_groups ||= if labware.type == 'tubes' - [{ assets: [labware.uuid], autodetect_studies: true, autodetect_projects: true }] + [{ assets: [labware.uuid], autodetect_studies: false, autodetect_projects: false }] else labware .wells diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index 00fd7a3cb9..06c6f488fe 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -3,15 +3,16 @@ module Presenters class StockPlateWithSubmissionPresenter < PlatePresenter - include Presenters::Statemachine::Submission - include Presenters::SubmissionBehaviour - include Presenters::StockBehaviour - include Presenters::StateChangeless + include Presenters::Statemachine::Submission + include Presenters::SubmissionBehaviour + include Presenters::StockBehaviour + include Presenters::StateChangeless + include Presenters::Statemachine::DoesNotAllowLibraryPassing - self.allow_well_failure_in_states = [] - self.style_class = 'stock' + self.allow_well_failure_in_states = [] + self.style_class = 'stock' - validates_with Validators::SuboptimalValidator - validates_with Validators::ActiveRequestValidator + validates_with Validators::SuboptimalValidator + validates_with Validators::ActiveRequestValidator end end \ No newline at end of file diff --git a/app/models/sequencescape_submission.rb b/app/models/sequencescape_submission.rb index 5e6fb19034..fd360e9173 100644 --- a/app/models/sequencescape_submission.rb +++ b/app/models/sequencescape_submission.rb @@ -111,7 +111,7 @@ def asset_groups=(asset_groups) def asset_groups_for_orders_creation return asset_groups unless (asset_groups.length == 1) && extra_barcodes - [{ asset_uuids: [assets, extra_assets].flatten.compact, autodetect_studies: true, autodetect_projects: true }] + [{ asset_uuids: [assets, extra_assets].flatten.compact, autodetect_studies: false, autodetect_projects: false }] end private From 188f07a78ddd3b3418f6cdde5b6340d621f3d4a4 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Fri, 20 Feb 2026 16:40:02 +0000 Subject: [PATCH 07/17] revert autodetect_project/study flag --- app/models/concerns/presenters/submission_behaviour.rb | 2 +- app/models/sequencescape_submission.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/presenters/submission_behaviour.rb b/app/models/concerns/presenters/submission_behaviour.rb index 49635c1ce6..a5bc29a341 100644 --- a/app/models/concerns/presenters/submission_behaviour.rb +++ b/app/models/concerns/presenters/submission_behaviour.rb @@ -33,7 +33,7 @@ def allow_new_submission? def asset_groups @asset_groups ||= if labware.type == 'tubes' - [{ assets: [labware.uuid], autodetect_studies: false, autodetect_projects: false }] + [{ assets: [labware.uuid], autodetect_studies: true, autodetect_projects: true }] else labware .wells diff --git a/app/models/sequencescape_submission.rb b/app/models/sequencescape_submission.rb index fd360e9173..5e6fb19034 100644 --- a/app/models/sequencescape_submission.rb +++ b/app/models/sequencescape_submission.rb @@ -111,7 +111,7 @@ def asset_groups=(asset_groups) def asset_groups_for_orders_creation return asset_groups unless (asset_groups.length == 1) && extra_barcodes - [{ asset_uuids: [assets, extra_assets].flatten.compact, autodetect_studies: false, autodetect_projects: false }] + [{ asset_uuids: [assets, extra_assets].flatten.compact, autodetect_studies: true, autodetect_projects: true }] end private From b8cad204c86d5a6db60d703112359ec5e858d853 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Mon, 23 Feb 2026 11:13:23 +0000 Subject: [PATCH 08/17] save changes --- app/models/presenters/stock_plate_with_submission_presenter.rb | 2 +- config/purposes/lcm_triomics.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index 06c6f488fe..9a0a20e7f4 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -6,7 +6,7 @@ class StockPlateWithSubmissionPresenter < PlatePresenter include Presenters::Statemachine::Submission include Presenters::SubmissionBehaviour include Presenters::StockBehaviour - include Presenters::StateChangeless + # include Presenters::StateChangeless include Presenters::Statemachine::DoesNotAllowLibraryPassing self.allow_well_failure_in_states = [] diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index 2ec3aac021..37f0f629de 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -6,7 +6,6 @@ LCMT Lysate: :cherrypickable_target: false :input_plate: true :presenter_class: Presenters::StockPlateWithSubmissionPresenter - # :presenter_class: Presenters::StockPlatePresenter :creator_class: LabwareCreators::Uncreatable :submission_options: EM-seq (+ WGS) Branch - Automated Submission: From 2ed3a513d6cc422b25ccc99a7f1064ed63ca25ef Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Mon, 23 Feb 2026 21:29:27 +0000 Subject: [PATCH 09/17] add submissionWhenPassed statemachine to presenter --- .../presenters/stock_plate_with_submission_presenter.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index 9a0a20e7f4..861fbddccc 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -6,13 +6,19 @@ class StockPlateWithSubmissionPresenter < PlatePresenter include Presenters::Statemachine::Submission include Presenters::SubmissionBehaviour include Presenters::StockBehaviour - # include Presenters::StateChangeless + include Presenters::StateChangeless include Presenters::Statemachine::DoesNotAllowLibraryPassing + include Presenters::Statemachine::SubmissionWhenPassed self.allow_well_failure_in_states = [] self.style_class = 'stock' validates_with Validators::SuboptimalValidator validates_with Validators::ActiveRequestValidator + + def allow_new_submission? + Rails.logger.warn "===============ALLOW_NEW_SUBMISSION CALLED" + true + end end end \ No newline at end of file From df2071660fcc7d0faa09ccf2c8590699fff73da6 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Wed, 25 Feb 2026 18:20:35 +0000 Subject: [PATCH 10/17] fix linting --- .../multi_submission_plate_presenter.rb | 14 ------- .../stock_plate_with_submission_presenter.rb | 39 +++++++++++-------- 2 files changed, 22 insertions(+), 31 deletions(-) delete mode 100644 app/models/presenters/multi_submission_plate_presenter.rb diff --git a/app/models/presenters/multi_submission_plate_presenter.rb b/app/models/presenters/multi_submission_plate_presenter.rb deleted file mode 100644 index 4406a640bb..0000000000 --- a/app/models/presenters/multi_submission_plate_presenter.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module Presenters - # - # Class PermissivePresenter provides a presenter which allows plate creation - # even when the plate is pending - # - class MultiSubmissionPlatePresenter < PlatePresenter - # include Presenters::Statemachine::Permissive - - # validates_with Validators::SuboptimalValidator - # validates_with Validators::ActiveRequestValidator - end -end diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index 861fbddccc..fc1f0be908 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -1,24 +1,29 @@ # 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 < PlatePresenter + include Presenters::Statemachine::Submission + include Presenters::SubmissionBehaviour + include Presenters::StockBehaviour + include Presenters::StateChangeless + include Presenters::Statemachine::DoesNotAllowLibraryPassing + include Presenters::Statemachine::SubmissionWhenPassed - class StockPlateWithSubmissionPresenter < PlatePresenter - include Presenters::Statemachine::Submission - include Presenters::SubmissionBehaviour - include Presenters::StockBehaviour - include Presenters::StateChangeless - include Presenters::Statemachine::DoesNotAllowLibraryPassing - include Presenters::Statemachine::SubmissionWhenPassed + self.allow_well_failure_in_states = [] + self.style_class = 'stock' - self.allow_well_failure_in_states = [] - self.style_class = 'stock' + validates_with Validators::SuboptimalValidator + validates_with Validators::ActiveRequestValidator - validates_with Validators::SuboptimalValidator - validates_with Validators::ActiveRequestValidator - - def allow_new_submission? - Rails.logger.warn "===============ALLOW_NEW_SUBMISSION CALLED" - true - end + def allow_new_submission? + true end -end \ No newline at end of file + end +end From 5bfe0a31ff1362e6211681eda65eef3bde895ecf Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Wed, 25 Feb 2026 21:43:28 +0000 Subject: [PATCH 11/17] remove comment out codes --- config/purposes/lcm_triomics.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index 37f0f629de..962028fb98 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -11,8 +11,6 @@ LCMT Lysate: EM-seq (+ WGS) Branch - Automated Submission: template_name: 'Limber-Htp - LCM Triomics EMSeq' allowed_extra_barcodes: false - # autodetect_studies: true - # autodetect_projects: false request_options: library_type: 'emSEQ' fragment_size_required_from: '450' @@ -20,8 +18,6 @@ LCMT Lysate: RNA-Seq Branch - Automated Submission: template_name: 'Limber-Htp - LCM Triomics RNASeq' allowed_extra_barcodes: false - # autodetect_studies: true - # autodetect_projects: false request_options: library_type: 'Combined LCM RNA' fragment_size_required_from: '450' From eadf66ed7f22f07133a0bc9c2d424882943a6cf1 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Mon, 2 Mar 2026 11:59:53 +0000 Subject: [PATCH 12/17] refactor StockPlateWithSubmissionPresenter by inherit SubmissionPlatePresente --- .../presenters/stock_plate_with_submission_presenter.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index fc1f0be908..026899d5e5 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -8,17 +8,10 @@ module Presenters # the input plate for the submission, and the user should be able to create # the submission when the plate is passed. # - class StockPlateWithSubmissionPresenter < PlatePresenter - include Presenters::Statemachine::Submission - include Presenters::SubmissionBehaviour + class StockPlateWithSubmissionPresenter < SubmissionPlatePresenter include Presenters::StockBehaviour - include Presenters::StateChangeless - include Presenters::Statemachine::DoesNotAllowLibraryPassing include Presenters::Statemachine::SubmissionWhenPassed - self.allow_well_failure_in_states = [] - self.style_class = 'stock' - validates_with Validators::SuboptimalValidator validates_with Validators::ActiveRequestValidator From 0bd96d3ceff22f2337f710274ee2bcee12aef254 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Mon, 2 Mar 2026 16:42:51 +0000 Subject: [PATCH 13/17] uodate the request options value --- config/purposes/lcm_triomics.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/purposes/lcm_triomics.yml b/config/purposes/lcm_triomics.yml index 962028fb98..b27a1d8f80 100644 --- a/config/purposes/lcm_triomics.yml +++ b/config/purposes/lcm_triomics.yml @@ -20,8 +20,8 @@ LCMT Lysate: allowed_extra_barcodes: false request_options: library_type: 'Combined LCM RNA' - fragment_size_required_from: '450' - fragment_size_required_to: '450' + fragment_size_required_from: '100' + fragment_size_required_to: '500' :size: 96 LCMT DNA Frag: :asset_type: plate From 0198c20f6fb4ca8bc612266eff4fe0fd8df1bd26 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Mon, 2 Mar 2026 18:24:20 +0000 Subject: [PATCH 14/17] disable submission when request is active --- .../stock_plate_with_submission_presenter.rb | 13 +++++++++++++ app/views/plates/_choose_workflow.html.erb | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index 026899d5e5..2c1488de5f 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -18,5 +18,18 @@ class StockPlateWithSubmissionPresenter < SubmissionPlatePresenter 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 allow_workflow_creation? + return false if (submission_in_progress? || requests_pending?) + true + end end end diff --git a/app/views/plates/_choose_workflow.html.erb b/app/views/plates/_choose_workflow.html.erb index 3374c0bdd2..b05ffea2ce 100644 --- a/app/views/plates/_choose_workflow.html.erb +++ b/app/views/plates/_choose_workflow.html.erb @@ -45,7 +45,7 @@ <% end %> <% end %> - <%= submit_tag name, class: 'create-submission-button' %> + <%= submit_tag name, class: 'create-submission-button', disabled: !presenter.allow_workflow_creation? %> <% end %> <% end %> <% end %> From 7f712f7abf8e703884cc3dfbc5c10b25872c3e11 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Tue, 3 Mar 2026 09:28:17 +0000 Subject: [PATCH 15/17] update disable workflow condition --- app/models/presenters/plate_presenter.rb | 4 ++++ .../stock_plate_with_submission_presenter.rb | 11 ++++++----- app/views/plates/_choose_workflow.html.erb | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/models/presenters/plate_presenter.rb b/app/models/presenters/plate_presenter.rb index 45bf3727df..48cc48f0f4 100644 --- a/app/models/presenters/plate_presenter.rb +++ b/app/models/presenters/plate_presenter.rb @@ -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? diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index 2c1488de5f..bbaa23b7d0 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -20,16 +20,17 @@ def allow_new_submission? end def submission_in_progress? - labware.requests_in_progress.any? + labware.requests_in_progress.any? end def requests_pending? - labware.all_requests.any?(&:pending?) + labware.all_requests.any?(&:pending?) end - def allow_workflow_creation? - return false if (submission_in_progress? || requests_pending?) - true + def disable_workflow_creation? + return true if pending_submissions? || requests_pending? + + false end end end diff --git a/app/views/plates/_choose_workflow.html.erb b/app/views/plates/_choose_workflow.html.erb index b05ffea2ce..f902bf50c9 100644 --- a/app/views/plates/_choose_workflow.html.erb +++ b/app/views/plates/_choose_workflow.html.erb @@ -45,7 +45,7 @@ <% end %> <% end %> - <%= submit_tag name, class: 'create-submission-button', disabled: !presenter.allow_workflow_creation? %> + <%= submit_tag name, class: 'create-submission-button', disabled: presenter.disable_workflow_creation? %> <% end %> <% end %> <% end %> From 7a50cb52bc9aa70418bd6f272ddafbade9ca8e65 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Tue, 3 Mar 2026 15:18:00 +0000 Subject: [PATCH 16/17] update request pending condition --- app/models/presenters/stock_plate_with_submission_presenter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index bbaa23b7d0..a335c9d19e 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -24,7 +24,7 @@ def submission_in_progress? end def requests_pending? - labware.all_requests.any?(&:pending?) + labware.requests_as_source.any?(&:pending?) end def disable_workflow_creation? From c789c0f5a41f9e57cad63667a8a41a769a5347e7 Mon Sep 17 00:00:00 2001 From: Wendy Yang Date: Thu, 5 Mar 2026 09:21:49 +0000 Subject: [PATCH 17/17] revert the changes as request_as_source is private method --- app/models/presenters/stock_plate_with_submission_presenter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/presenters/stock_plate_with_submission_presenter.rb b/app/models/presenters/stock_plate_with_submission_presenter.rb index a335c9d19e..bbaa23b7d0 100644 --- a/app/models/presenters/stock_plate_with_submission_presenter.rb +++ b/app/models/presenters/stock_plate_with_submission_presenter.rb @@ -24,7 +24,7 @@ def submission_in_progress? end def requests_pending? - labware.requests_as_source.any?(&:pending?) + labware.all_requests.any?(&:pending?) end def disable_workflow_creation?