From 808f0013a4f97b57b612526a8fa3705ce131774b Mon Sep 17 00:00:00 2001 From: Stephen Hulme Date: Mon, 9 Dec 2024 16:54:51 +0000 Subject: [PATCH] feat: add relatives tab to tube-rack It will be populated with whatever is assigned to parents and children --- .../sequencescape/api/v2/tube_rack.rb | 1 + .../tube_racks/summaries/_default.html.erb | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/sequencescape/sequencescape/api/v2/tube_rack.rb b/app/sequencescape/sequencescape/api/v2/tube_rack.rb index a0aee1c25..a49bfb60d 100644 --- a/app/sequencescape/sequencescape/api/v2/tube_rack.rb +++ b/app/sequencescape/sequencescape/api/v2/tube_rack.rb @@ -35,6 +35,7 @@ def model_name has_many :tubes, through: :racked_tubes, class_name: 'Sequencescape::Api::V2::Tube' has_many :parents, class_name: 'Sequencescape::Api::V2::Asset' + has_many :children, class_name: 'Sequencescape::Api::V2::Asset' property :name property :size diff --git a/app/views/tube_racks/summaries/_default.html.erb b/app/views/tube_racks/summaries/_default.html.erb index 0f6248ef7..885187dfd 100644 --- a/app/views/tube_racks/summaries/_default.html.erb +++ b/app/views/tube_racks/summaries/_default.html.erb @@ -7,12 +7,15 @@ - <% data_attributes = { - sequencescape_api: Limber::Application.config.api.v2.connection_options.js_url, - sequencescape_api_key: Limber::Application.config.api.v2.connection_options.authorisation, - asset_id: presenter.id - } %> + @@ -22,6 +25,11 @@
<%= render partial: 'summary', locals: { presenter: presenter } %>
+ +
+ <%= render partial: 'relatives_list', locals: { presenter: presenter } %> +
+