-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support array column type in recordedit #1408
Comments
As per today's discussion, 4 different cases pertaining to base type and domain type.
|
I created an issue for the changes that we need in ermrestjs, to have basic array support in the non-entry modes. |
|
A simple array support that shouldn't take a lot of time is to provide a adjustable text box and validate to make sure that it follows the json array syntax. |
Required features and How it should behave
How to create array columnSome examples of array column can be found here. You can create your own schema with some array columns. Guideline and code changesBefore jumping into the code I think it's better if you just take a quick look at how the recordedit is written. It's our most complicated app, so just take a look at the existing code before jumping into the code. Since I'm not very fluent with chaise code, I did the same and the following steps are what I think would be the best way to approach this. You don't need to completely follow them. It's just a guideline. I might have missed some steps.
Again as I mentioned earlier these are just guidelines. If they're not helpful to you, you can ignore them. |
A minimal and temporary solution for having arrays in recordedit is treating them the same way as If we just do this simple change, then we can at least support arrays. Although we have to rely on ermrest to do the validation of values. The following is the error message that we currently show when a user tries to submit
@hongsudt Is this message clear enough? Should we just do this simple change? or should we spend more time to have a proper value validation here? If we are going to implement the complete support for arrays, the extra code that we have to add for validation now won't be useful. |
We should this get this minimal change in place, so that Facebase can start using it (with training on a small group of user). However, this error message is very hard to understand.. And if there are multiple array columns, there is no way for me to even know where to address the issue. So I think we should do simple client-side validation if simple or just wait and put the GUI in place for better UX. |
The changes for a simple array support has been merged into master. Chaise is going to provide a textarea for array columns which is similar to what we provide for json columns. You have to write the literal string value of the array ( |
@hongsudt, @jrchudy and @RFSH , Using the library
|
probably out of scope.. but it would be cool if this worked on facets and then we updated the annotations…..
|
Yes.. This is a very good idea. Then we can personalize the facet display as well.. |
actually, and columns!!! |
@hongsudt @RFSH and @jrchudy , I've tried a bunch of options as discussed. I've attached all the possible combinations of icons that could be used for -
Text, Int and Float fieldsBoolean fieldDate FieldLayout 1Layout 2Timestamp FieldLayout 1 | Layout 2Increased Icon size |
Updated the UI as per discussion -
|
As per commit aeb6c199b05a031c33921f74a98c2613577d80da ArrayField works as expected functionally. It is unusable in the current state as it suffers from severe performance issues due to the way the overall form implementation is structured and needs work to optimize it. Refactoring the ArrayField component to use the useFieldArray hook from the react-hook-form and memoizing ArrayField and react-beautiful-dnd components improves the performance 10 folds. Following a discussion with @RFSH and @jrchudy , the following possible ways to improve the form performance were identified
|
The array column type's contents can only be values of scalar types.
In the
recordedit
form, need to support the following functionality:This issue is currently relying on this PR in
ermrestJS
. It adds more functionality for tinkering with the display of array columns.NOTE:
markdown
.The text was updated successfully, but these errors were encountered: