-
Notifications
You must be signed in to change notification settings - Fork 90
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
JSON Editor and Schema validation #1867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the new changes look mostly good, except for some minor issues
Co-authored-by: Alexei Mochalov <[email protected]>
inner: { | ||
display: 'flex', | ||
overflowX: 'auto', | ||
'-ms-overflow-style': 'none', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a note for the future: in JSS this can be written as MsOverflowStyle
. the general rule is it inserts a dash before and lowers every uppercase letter.
display: 'flex', | ||
overflowX: 'auto', | ||
'-ms-overflow-style': 'none', | ||
'scrollbar-width': 'none', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, scrollbarWidth
would do the same, but w/o quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is good to go. @akarve pls wordsmith the docs (in a new pr probably)
Description
JSON editor implemented as a separate component. Root components are
components/JsonEditor/JsonEditor.js
andcomponents/JsonEditor/State.js
Editor is a list of two-column tables. Every table is a nested level of JSON.
The hierarchy of components is the following:
JsonEditor
andState
are root componentsColumn
, it's a two-column table actually. Represents one nested level of JSONRow
,AddRow
/AddArrayItem
. Represents key/value pair or a control to add new rowsCell
. Represents key or value wrapperInput
andPreview
. Edit and show key or valueNote
is like MUI InputAdornment for bothInput
andPreview
For a table implementation, I used
react-table
. It's almost useless in this context, to be honest, and I think we should get rid of it later.UI/UX feedback
Code review feedback
i18nMsgs
dicts everywhere? doesn't seem like this adds any value / developer convenience. consider removing them and using inline strings insteadanchorRef
UPPER_CASE
plus inline comments