sequencescape icon indicating copy to clipboard operation
sequencescape copied to clipboard

DPL-448 Allow updating of tube purposes

Open JamesGlover opened this issue 2 years ago • 0 comments

User story The labware edit page allows for plate purposes to be updated for anyone who has the permission to change_purpose for the labware.

However, for tubes, the drop down is not populated with suitable purposes. So this action is not possible. This can cause delays in pipelines as users are unable to fix mistakes made during manifest generation.

Eg: https://rt.sanger.ac.uk/SelfService/Display.html?id=756565

@valid_purposes_options should be populated for tubes in a similar manner to plates.

Plates currently use the scope:

scope :compatible_with_purpose,
        ->(purpose) { purpose.nil? ? none : where(target_type: purpose.target_type).order(name: :asc) }

on PlatePurpose. It should be safe to move this up onto Purpose.

It is probably safe to move:

# app/models/plate.rb
  def compatible_purposes
    PlatePurpose.compatible_with_purpose(purpose)
  end

Onto Labware, just updating the PlatePurpose to be Purpose instead. The scope should prevent us offering up tube purposes for plates and vice versa.

Who are the primary contacts for this story e.g. John S (don't include surnames in public repos)

Acceptance criteria To be considered successful the solution must allow:

  • [ ] add a list of acceptance criteria here
  • [ ] ...

Dependencies This story is blocked by the following dependencies:

  • #<issue_no.>
  • sanger/#<issue_no.>

References This story has a non-blocking relationship with:

  • #<issue_no.>
  • sanger/#<issue_no.>

Additional context Add any other context or screenshots about the feature request here.

JamesGlover avatar Jul 29 '22 10:07 JamesGlover