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

feat(app, shared-data, components): implement base CSV file RTP UI #15410

Merged
merged 13 commits into from
Jun 13, 2024

Conversation

ncdiehl11
Copy link
Collaborator

@ncdiehl11 ncdiehl11 commented Jun 13, 2024

closes AUTH-449
closes AUTH-457
closes AUTH-458
closes AUTH-459
closes AUTH-494

Overview

This PR updates and implements the new csv_file type RTP in components across the app, ODD, and
components library.

Test Plan

Desktop

  • ensure 'enable csv file' feature flag is enabled
  • create and upload a runtime parameters protocol containing a .csv file parameter. Here's an example:
metadata = {
    'protocolName': 'RTP Test',
}

requirements = {
    "robotType": "Flex",
    "apiLevel": "2.18"
}


def add_parameters(parameters):
    parameters.add_int(
        display_name="Sample count but now I am long",
        variable_name="sample_count",
        default=6,
        minimum=1,
        maximum=12,
        description='number of samples to run'
    )
    parameters.add_float(
        display_name="volume",
        variable_name="vol",
        unit='µl',
        default=10.22,
        minimum=0.0,
        maximum=100.0,
    )
    parameters.add_bool(
        display_name="do this step",
        variable_name="do_this",
        default=True,
        description='Do you reaaaaally want to do this? I am just making sure. I want to see what a long long.'
    )
    parameters.add_float(
        display_name="Volume2",
        variable_name="volume2",
        default=20.0,
        choices=[
            {"display_name": "Low Volume (10.0ul)", "value": 10.0},
            {"display_name": "Medium Volume (20.0ul)", "value": 20.0},
            {"display_name": "High Volume (50.0ul)", "value": 50.0},
        ],
    )
    parameters.add_str(
        display_name="string var",
        variable_name="str_var",
        default='test1',
        description='Oh boy I am a super long description with text next to me',
        choices=[
            {"display_name": "Low Volume", "value": 'test1'},
            {"display_name": "Medium Volume", "value": 'test2'},
        ],
    )
    parameters.add_csv_file(
        display_name="CSV Data",
        variable_name="csv_data",
        description="CSV file containing labware and volume information."
    )


PIPETTE_NAME = 'flex_1channel_50'


def run(context):
    context.params

    trash_bin = context.load_trash_bin('A3')
    tip_rack = context.load_labware('opentrons_flex_96_tiprack_50ul', 'D2')
    plate = context.load_labware('biorad_96_wellplate_200ul_pcr', 'D1')
    # pipette = context.load_instrument(PIPETTE_NAME, mount="left", tip_racks=[tip_rack])

    water = context.define_liquid(name='water', description='this is water', display_color='#00FF00')
    plate.wells()[0].load_liquid(water, volume=100)

    context.move_labware(plate, 'C1')

    context.delay(seconds=5)

    context.comment(context.params.sample_count)
  • click protocol card and verify that ProtocolDetails page correctly renders csv parameter at the top of the ParametersTable, including requires upload chip
  • start setup and select a robot
  • verify that UploadInput renders for the csv file parameter at the top of the slideout and the 'confirm values' button is disabled
  • upload a file that is not a .csv file (.pdf, .png, etc.) and verify that an error file card renders and the 'confirm values' button is still disabled
  • remove the file by clicking the 'x' icon on the file card or by selecting "Restore default values"
  • upload a file that _is a .csv fileand verify that a valid file card renders and the 'confirm values' button is now enabled
  • click 'confirm values'
  • verify that you are routed to ProtocolRun page and the csv parameter renders at the top of the ProtocolRunRuntimeParameters component with an updated chip

ODD

  • send the above example protocol or equivalent to the ODD
  • select the protocol to view detaiils > parameters
  • verify that the csv parameter renders at the top and the default and range match designs
  • select 'start setup' and verify that the csv parameter renders at the top of the list (upload functionality will be added in a followup PR)
  • select confirm values
  • verify that the 'parameters' item detail reads 'custom values'
  • select 'parameters verify that the csv parameter renders at the top of the parameters list component with an updated chip

Changelog

Review requests

authorship js. This is a sizable PR due to the new types changes affecting components and utilities across the app, so I am happy to sit down and work through a review with any reviewers.

Risk assessment

medium. I introduce a lot of new code to the UI, but any HTTP API communication should be unaffected in this PR.

@ncdiehl11 ncdiehl11 self-assigned this Jun 13, 2024
@ncdiehl11 ncdiehl11 marked this pull request as ready for review June 13, 2024 18:39
@ncdiehl11 ncdiehl11 requested a review from a team as a code owner June 13, 2024 18:39
@ncdiehl11 ncdiehl11 requested review from TamarZanzouri and removed request for a team June 13, 2024 18:39
Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

this looks great! nice work! all my comments are pretty minimal. Once they're addressed and Koji's comments are addressed, this is good to go 🎉 🦖 🌮

koji
koji approved these changes Jun 13, 2024
app/src/organisms/ChooseRobotSlideout/FileCard.tsx Outdated Show resolved Hide resolved
app/src/organisms/ChooseRobotSlideout/FileCard.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@koji koji left a comment

Choose a reason for hiding this comment

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

thank you for updating types and slideouts.
they always require a lot of work 😁

@ncdiehl11 ncdiehl11 merged commit 821cac6 into edge Jun 13, 2024
44 checks passed
@ncdiehl11 ncdiehl11 deleted the feat_app-csv-rtp-slideout branch June 13, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants