Reimplement GWT assay plate designer in React#7623
Reimplement GWT assay plate designer in React#7623labkey-jeckels wants to merge 11 commits intodevelopfrom
Conversation
|
👍 |
labkey-alan
left a comment
There was a problem hiding this comment.
I did not do the most thorough review on the React code, since I was only asked to take a cursory look at the code, and the GitHub outage is preventing me from viewing all of the files at this time. I do have two pieces of feedback though:
- Many of the components have really large chunks of TSX code (e.g. GroupTypesPanel). Lots of nested loops and conditional statements. This is a readability mess, and it also makes it significantly harder to test, since we can't test in smaller units of functionality. My recommendation is to split these large chunks of TSX into smaller components.
- There are zero unit tests. For a set of components this size, and this complex, we really should have as much unit test coverage as is reasonable.
Additionally I do have a concern about introducing this code more generally. While I understand the motivation to get rid of the last GWT component, and I would love to see us accomplish that goal, I am not sure that this is the best path forward. We already have a lot of plate related code in our apps, and while this code helps us get rid of GWT, it does not change the fact that we have two different implementations of a UI that is meant to accomplish the same thing. I think we would benefit most from having one UI for our plate code, not two different implementations that are both made with React.
I can take a more thorough look at the code later if wanted.
|
|
|
||
| @RequiresAnyOf({InsertPermission.class, DesignAssayPermission.class}) | ||
| public class DesignerAction extends SimpleViewAction<DesignerForm> | ||
| public class GetTemplateDefinitionAction extends ReadOnlyApiAction<DesignerForm> |
There was a problem hiding this comment.
Consider adding endpoint tests in PlateController.ispec.ts for both plate-getTemplateDefinition.api and plate-saveTemplate.api introduced in this PR.
There was a problem hiding this comment.
| private static final int MAX_BODY_BYTES = 10 * 1024 * 1024; // 10 MB | ||
|
|
||
| @Override | ||
| protected BaseApiAction.FormAndErrors<SaveTemplateForm> populateJacksonForm() throws Exception |
There was a problem hiding this comment.
Missing @NotNull annotation
There was a problem hiding this comment.
I found a better way to accomplish this. Separate Platform PR coming soon.
| } | ||
|
|
||
| @RequiresAnyOf({InsertPermission.class, DesignAssayPermission.class}) | ||
| public static class SaveTemplateAction extends MutatingApiAction<SaveTemplateForm> |
There was a problem hiding this comment.
Why is populateJacksonForm override necessary here? Just to limit to 10MB? Could you annotate with @Marshal(Marshaller.JSONObject) to achieve this instead?
There was a problem hiding this comment.
Yes, just to provide a limit and protect against DOS. We should support this more centrally. Platform PR coming soon.
| } | ||
|
|
||
| @RequiresAnyOf({InsertPermission.class, DesignAssayPermission.class}) | ||
| public static class SaveTemplateAction extends MutatingApiAction<SaveTemplateForm> |
There was a problem hiding this comment.
It would be nice to distinguish these endpoints somehow from our preferred endpoints so future engineers/users don't get them mixed up. Consider naming these GetDesignerTemplateDefinitionAction and SaveDesignerTemplateAction.
There was a problem hiding this comment.
Updated to getDesignerTemplate and saveDesignerTemplate. Also refactored to share more with createPlate
|
Rationale
Our assay plate designer is our final GWT UI. This replaces it with a React-based version.
Changes
Tasks 📍