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

use java command wrappers and params to create plates #1864

Merged
merged 5 commits into from
Mar 22, 2024

Conversation

labkey-chrisj
Copy link
Contributor

Rationale

This adds command/response wrappers to create plate sets used in biologics for now, (I'm not sure if this will be limited to lims modules or not, so creating here)

The reason to create via API at this point is that the UI doesn't yet support creating child or parent-type plate sets, this allows us to get automated regression coverage in place until it does

Related Pull Requests

https://github.com/LabKey/limsModules/pull/65

Changes

create command/response/params classes for use in testing plate automation

Copy link
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

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

Just a small nit about some odd JSONObject behavior.

Comment on lines 29 to 40
JSONObject json = new JSONObject();
if (_name != null)
json.put("name", _name);
if (_description != null)
json.put("description", _description);
if (_type != null)
json.put("type", _type);
if (_id != null)
json.put("rowId", _id);
if (_parentPlateSetId != null)
json.put("parentPlateSetId", _parentPlateSetId);
return json;
Copy link
Member

Choose a reason for hiding this comment

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

These null checks actually aren't necessary. Much to our chagrin, JSONObject doesn't allow null values. A put with a null value actually removes any existing entry and does nothing if there is no existing entry.

Suggested change
JSONObject json = new JSONObject();
if (_name != null)
json.put("name", _name);
if (_description != null)
json.put("description", _description);
if (_type != null)
json.put("type", _type);
if (_id != null)
json.put("rowId", _id);
if (_parentPlateSetId != null)
json.put("parentPlateSetId", _parentPlateSetId);
return json;
JSONObject json = new JSONObject();
json.put("name", _name);
json.put("description", _description);
json.put("type", _type);
json.put("rowId", _id);
json.put("parentPlateSetId", _parentPlateSetId);
return json;

Copy link
Contributor Author

@labkey-chrisj labkey-chrisj Mar 20, 2024

Choose a reason for hiding this comment

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

Thank you! (I didn't know that, it feels good to learn something new)
This probably means we have a lot of other writing-of-json to update accordingly; in writing this I followed the pattern from NotebookParams

@labkey-chrisj labkey-chrisj merged commit 26d6f11 into develop Mar 22, 2024
2 checks passed
@labkey-chrisj labkey-chrisj deleted the fb_introParentPlateSetTest_story1 branch March 22, 2024 18:56
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