Skip to content

Commit

Permalink
Merge pull request #2114 from sanger/y24-486-relatives-tab
Browse files Browse the repository at this point in the history
Y24-486: Add relatives tab
  • Loading branch information
StephenHulme authored Jan 21, 2025
2 parents 1238ccf + 37d98e9 commit 6d21ad9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/sequencescape/sequencescape/api/v2/tube_rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

has_many :state_changes

Expand Down
18 changes: 13 additions & 5 deletions app/views/tube_racks/summaries/_default.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
<li class="nav-item">
<a class="nav-link active" href="#summary_tab" data-toggle="tab" role="tab" data-plate-view="summary-view">Summary</a>
</li>
<% 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
} %>
<li class="nav-item">
<a class="nav-link" href="#relatives_tab" data-toggle="tab" role="tab" data-plate-view="pools-view">Relatives</a>
</li>
<li class="nav-item">
<% 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
} %>
<a id='comments-tab-link' class="nav-link" href="#comments_tab" data-toggle="tab" role="tab" data-plate-view="comments-view">Comments <%= count_badge(nil, 'asset-comments-counter',data_attributes) %></a>
</li>
</ul>
Expand All @@ -22,6 +25,11 @@
<div class="tab-pane active" id='summary_tab' role="tabpanel">
<%= render partial: 'summary', locals: { presenter: presenter } %>
</div>

<div class="tab-pane" id='relatives_tab' role="tabpanel">
<%= render partial: 'relatives_list', locals: { presenter: presenter } %>
</div>

<div class="tab-pane" id='comments_tab' role="tabpanel">
<div id='asset-comments' data-sequencescape-api="<%= Limber::Application.config.api.v2.connection_options.js_url %>"
data-sequencescape-api-key="<%= Limber::Application.config.api.v2.connection_options.authorisation %>"
Expand Down

0 comments on commit 6d21ad9

Please sign in to comment.