Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y24-099 plate split to racks #2028

Merged
merged 24 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b581f0d
fix typo in comment
andrewsparkes Oct 2, 2024
b84e321
added purpose config fields and tube rack relationships
andrewsparkes Oct 16, 2024
909255e
Added tube rack purpose v2 resource
andrewsparkes Oct 17, 2024
85b10fd
Merge branch 'y24-099-tube-rack-banking-sequencescape-api' into y24-0…
andrewsparkes Oct 17, 2024
b8bc954
Merge branch 'y24-088-tuberacks-epic' into y24-099-plate-split-to-racks
andrewsparkes Oct 18, 2024
3f85856
checks added to prevent casting inappropriate values
andrewsparkes Oct 25, 2024
ae959c0
added specific tube rack creation and related api changes
andrewsparkes Oct 25, 2024
2fa7b50
added check for blank
andrewsparkes Oct 25, 2024
b394822
changed redirect to return to parent plate
andrewsparkes Oct 25, 2024
f64c55b
added check for tube rack false
andrewsparkes Oct 28, 2024
eb600c6
added cached relationship for request type to factory
andrewsparkes Oct 28, 2024
e29762a
added methods to fetch aliquots and requests_as_source for tubes in t…
andrewsparkes Oct 28, 2024
4e5b29c
removed unneeded comment
andrewsparkes Oct 29, 2024
f2bf2d4
put WellHelpers include back as breaking tests
andrewsparkes Oct 31, 2024
5708619
fixed tests for labware creator
andrewsparkes Oct 31, 2024
e934d73
reverted has_one to belongs_to as breaking tests
andrewsparkes Nov 1, 2024
bdd0c77
add WellHelpers back into tube rack as using coordinate methods
andrewsparkes Nov 1, 2024
f414945
added additional unit tests
andrewsparkes Nov 1, 2024
2c74086
fixed typo
andrewsparkes Nov 1, 2024
715c7ea
fixed test for private method
andrewsparkes Nov 1, 2024
456d986
added comments and added tests for contents_for in TubeRackStateChanger
andrewsparkes Nov 4, 2024
c5bb206
Merged develop
andrewsparkes Nov 20, 2024
4a329b2
removed references to tube rack barcode metadata key
andrewsparkes Nov 20, 2024
f4eca57
Merge branch 'y24-088-tuberacks-epic' into y24-099-plate-split-to-racks
andrewsparkes Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/creation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def params_purpose_uuid
end

def parent_uuid
params[:limber_tube_id] || params[:limber_plate_id]
params[:limber_tube_id] || params[:limber_plate_id] || params[:limber_tube_rack_id]
end

def extract_error_messages_from_api_exception(api_message)
Expand Down
3 changes: 3 additions & 0 deletions app/frontend/stylesheets/limber/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ nav.robots-list {
.robots-button,
.create-plate-button,
.create-tube-button,
.create-tube_rack-button,
.csv-link,
.create-submission-button {
@extend .btn;
Expand All @@ -272,6 +273,7 @@ nav.robots-list {
.other-actions {
.work-completion-button,
.create-plate-button,
.create-tube_rack-button,
.create-tube-button {
@extend .btn-secondary;
}
Expand All @@ -280,6 +282,7 @@ nav.robots-list {
.work-completion-button,
.create-plate-button,
.create-tube-button,
.create-tube_rack-button,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like some of this stuff could just be generic, like .create-labware-button or params[:limber_labware_id] in the above file. Let's not add refactoring to the scope of the story though!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, assuming the buttons don't have to have different text or some other difference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus the suggested action Add button now looks like 'Add tube_rack' with an underscore which looks odd (works for tube and plate as they are single word classes).

.create-submission-button {
@extend .btn-success;
}
Expand Down
1 change: 1 addition & 0 deletions app/helpers/page_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def jumbotron(jumbotron_id = nil, options = {}, &)
# eg. state_badge('pending')
# <span class="state-badge-pending">Pending</span>
def state_badge(state)
return if state.blank?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this returns nil? The state badge is not shown?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was temporary to get past the fact that the tube rack didn't have a state. And yes it doesn't show the state badge on the page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed once state for TubeRacks is fixed by another story.

tag.span(state.titleize, class: "state-badge #{state}", title: 'Labware State', data: { toggle: 'tooltip' })
end

Expand Down
4 changes: 4 additions & 0 deletions app/models/concerns/presenters/creation_behaviour.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def compatible_tube_purposes
construct_buttons(purposes_of_type('tube'))
end

def compatible_tube_rack_purposes
construct_buttons(purposes_of_type('tube_rack'))
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like this wants to be refactored to:

def compatible_labware_purposes(labware_type)
    construct_buttons(purposes_of_type(labware_type))
end

But again, maybe we can save up refactoring ideas for another story to try to draw a line under this story! Will keep commenting them if I notice and we can decide what to do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I think this is building the 'other actions' grey buttons. That could do with some better ordering/structuring in any case.

private

# Eventually this will end up on our labware_creators/creations module
Expand Down
10 changes: 10 additions & 0 deletions app/models/labware_creators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,25 @@ def custom_form?

# limber_plate_children (Plate -> Plate) (plate_creation#create)
# limber_plate_tubes (Plate -> Tube) (tube_creation#create)
# limber_plate_tube_racks (Plate -> TubeRack) (tube_rack_creation#create)
# limber_tube_children (Tube -> Plate) (nothing - want to be plate_creation#create)
# limber_tube_tubes (Tube -> Tube) (tube_creation#create)
# limber_tube_tube_racks (Tube -> TubeRack) (tube_rack_creation#create)

# Returns the ActiveModel::Name instance for the given type.
# This method maps the type to the corresponding model class and returns an ActiveModel::Name instance.
#
# @return [ActiveModel::Name] the ActiveModel::Name instance for the given type.
# @raise [StandardError] if the type is unknown.
def model_name
case type
# TODO: can we rename 'child' to 'plate' please? see routes.rb
when 'plate'
::ActiveModel::Name.new(Limber::Plate, nil, 'child')
when 'tube'
::ActiveModel::Name.new(Limber::Tube, nil, 'tube')
when 'tube_rack'
::ActiveModel::Name.new(Limber::TubeRack, nil, 'tube_rack')
else
raise StandardError, "Unknown type #{type}"
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/labware_creators/donor_pooling_plate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def barcodes=(barcodes)
def calculated_number_of_pools
return if source_wells_for_pooling.blank?

# div enfoces integer division
# div enforces integer division
source_wells_for_pooling.count.div(number_of_samples_per_pool)
end

Expand Down
Loading
Loading