Skip to content

Commit

Permalink
Merge pull request #2117 from sanger/develop
Browse files Browse the repository at this point in the history
[release] Merge Develop into Master
  • Loading branch information
sdjmchattie authored Dec 11, 2024
2 parents a4837a2 + 4de815e commit 23a1b9e
Show file tree
Hide file tree
Showing 161 changed files with 2,676 additions and 3,550 deletions.
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.65.0
3.66.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ FactoryBot.define do
transient { related_thing { create :v2_tag_group_with_tags } }

after(:build) do |record, factory|
record._cached_relationship(:related_thing) { factory.related_thing } if evaluator.related_thing
record._cached_relationship(:related_thing) { factory.related_thing } if factory.related_thing
end
end
end
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/labware_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ def state_changer_for(purpose_uuid, labware_uuid)
end

def presenter_for(labware)
presenter = Presenters.lookup_for(labware).new(labware:)

# TODO: {Y24-190} - Remove this line when the API v1 is removed from Presenters::ExtendedCsv
presenter.api = api if presenter.respond_to?(:api=)

presenter
Presenters.lookup_for(labware).new(labware:)
end
end
19 changes: 13 additions & 6 deletions app/controllers/qc_files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ class QcFilesController < ApplicationController
before_action :find_assets, only: %i[create index]

def index
respond_to { |format| format.json { render json: { 'qc_files' => asset.qc_files } } }
respond_to { |format| format.json { render json: { 'qc_files' => asset.qc_files.map { |q| qc_file_to_json(q) } } } }
end

def show
response = api.qc_file.find(params[:id]).retrieve
filename = /filename="([^"]*)"/.match(response['Content-Disposition'])[1] || 'unnamed_file'
send_data(response.body, filename: filename, type: 'sequencescape/qc_file')
qc_file = Sequencescape::Api::V2::QcFile.find(uuid: params[:id]).first
send_data(qc_file.contents, filename: qc_file.filename, type: 'sequencescape/qc_file')
end

def create
asset.qc_files.create_from_file!(params['qc_file'], params['qc_file'].original_filename)
Sequencescape::Api::V2::QcFile.create_for_labware!(
contents: params['qc_file'].read,
filename: params['qc_file'].original_filename,
labware: asset
)
redirect_to(
asset_path,
notice: 'Your file has been uploaded and is available from the file tab' # rubocop:todo Rails/I18nLocaleTexts
Expand All @@ -30,12 +33,16 @@ def create

private

def qc_file_to_json(qc_file)
{ filename: qc_file.filename, size: qc_file.size, uuid: qc_file.uuid, created: qc_file.created_at.to_fs(:long) }
end

def find_assets
%w[plate tube multiplexed_library_tube tube_rack].each do |klass|
next if params["limber_#{klass}_id"].nil?

@asset_path = send(:"limber_#{klass}_path", params["limber_#{klass}_id"])
@asset = api.send(:"#{klass}").find(params["limber_#{klass}_id"])
@asset = Sequencescape::Api::V2::Labware.find(uuid: params["limber_#{klass}_id"]).first
return true
end
false
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/tubes/work_completions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class Tubes::WorkCompletionsController < ApplicationController
before_action :check_for_current_user!

def labware
@labware ||= api.tube.find(params[:limber_tube_id])
@labware ||= Sequencescape::Api::V2.tube_for_completion(params[:limber_tube_id])
end
end
Loading

0 comments on commit 23a1b9e

Please sign in to comment.