Skip to content

Conversation

@ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented Jun 9, 2022

We can now select the "Other" purpose when creating a Box. It will present an interface to select samples one by one by their UUID. You can type an UUID and it will be autocompleted, or you can paste/scan a QR code.

Notes/Questions:

  1. Which sample attributes should be blinded for this purpose? all of them

  2. QC samples aren't autocompleted and can't be selected (we can't transfer a box with QC samples). Alternative would be to warn about the sample being QC, and eventually prevent transferring a box with QC samples.

Improvement:

  • Auto-select the sample when we entered the UUID completely (and got one result) to improve the UX with QR scanners.

closes #1619

@ysbaddaden ysbaddaden self-assigned this Jun 9, 2022
@ysbaddaden ysbaddaden marked this pull request as ready for review June 9, 2022 16:33
Copy link
Contributor

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

LGTM 👍

There is duplication of the same function in BoxesController#samples_data and autocomplete.json.jbuilder. This could be consolidated.

Copy link
Contributor

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

Wrong button, I meant to approve =)

@ysbaddaden
Copy link
Contributor Author

I tried but failed to avoid the duplication between the samples/autocomplete template and the #samples_data helper. The template dumps a string (obviously), but the #react_component expects ruby objects to dump to JSON along other react props.

I pushed one last commit, that:

  • fixes react warnings (bind, key);
  • harmonizes samples/autocomplete and samples_data to return uuid & batch_number then have the SamplesSelector component prepare the options for CdxSelect (value, label);

@straight-shoota
Copy link
Contributor

How about using the helper method for samples#autocomplete instead of the other way around?

@ysbaddaden ysbaddaden merged commit b5aa372 into main Jun 10, 2022
@ysbaddaden ysbaddaden deleted the feature/1619-other-box-purpose branch June 10, 2022 15:35
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.

Allow to add in a box: individual samples

3 participants