-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2135 from sanger/Y24-190-use-v2-for-qcables
Y24-190: Use SS API V2 for Qcable resources
- Loading branch information
Showing
9 changed files
with
134 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
# Receives AJAX requests when creating tag plates, returns the | ||
# plate information eg. lot number, template, status | ||
# plate information eg. lot number, template | ||
# The front end makes a decision regarding suitability | ||
class TagPlatesController < ApplicationController | ||
INCLUDES = [:labware, { lot: [{ lot_type: :target_purpose }, :template] }].freeze | ||
|
||
def show | ||
qcable = Presenters::QcablePresenter.new(api.qcable.find(params[:id])) | ||
respond_to { |format| format.json { render json: { 'qcable' => qcable } } } | ||
qcable_resource = Sequencescape::Api::V2::Qcable.includes(*INCLUDES).find(uuid: params[:id]).first | ||
qcable_presenter = Presenters::QcablePresenter.new(qcable_resource) | ||
respond_to { |format| format.json { render json: { 'qcable' => qcable_presenter } } } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
# A Lot from sequencescape via the V2 API | ||
class Sequencescape::Api::V2::Lot < Sequencescape::Api::V2::Base | ||
has_one :lot_type | ||
|
||
# The template is is a polymorphic relationship in Sequencescape, but we only want to access the UUID | ||
# and so we don't need a specific class since all properties are accessible via the base class. | ||
has_one :template, class_name: 'Sequencescape::Api::V2::Base' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
# A LotType from sequencescape via the V2 API | ||
class Sequencescape::Api::V2::LotType < Sequencescape::Api::V2::Base | ||
has_one :target_purpose, class_name: 'Sequencescape::Api::V2::Purpose' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class Sequencescape::Api::V2::Purpose < Sequencescape::Api::V2::Base | ||
UNKNOWN = 'UNKNOWN' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
# A Qcable from sequencescape via the V2 API | ||
class Sequencescape::Api::V2::Qcable < Sequencescape::Api::V2::Base | ||
has_one :labware | ||
has_one :lot | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters