-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat(24318): Create a compact editable table for attribute/value editor #509
Conversation
<Box> | ||
<ArrayFieldTitleTemplate | ||
idSchema={idSchema} | ||
title={uiOptions.title || title} |
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.
should we document somewhere that uiOptions.title
takes precedence over title
?
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.
It's the expected behaviour of the RJSF library: the (JSON)schema
provides the bulk of the information (e.g. title, description, validation rules, ...) unless they are overridden by the optional uiSchema
/> | ||
<ArrayFieldDescriptionTemplate | ||
idSchema={idSchema} | ||
description={uiOptions.description || schema.description} |
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 question as above regarding description
const inputProps = getInputProps(schema, type, options) | ||
|
||
const _onChange = ({ target: { value } }: ChangeEvent<HTMLInputElement>) => | ||
onChange(value === '' ? options.emptyValue : value) |
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.
Are strings made of spaces only valid?
Would you want to trim the input somewhere to avoid bad surprises?
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 spaces can be valid. it should be capable of any UTF-8 Character, so I would not recommend trimming
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'm also merely replicating the code from the component I'm overriding, in order to maintain consistency
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.
Added a few comments but approving anyway 🦣
d29440f
to
8afcf33
Compare
8afcf33
to
cd035eb
Compare
feat(24318): Create a compact editable table for attribute/value editor * refactor(24318): add mapping for custom fields * feat(24318): add custom editable table for user properties * feat(24143): add custom editor for compact property/value items * fix(24143): fix JSX * feat(24143): add support for add and delete item * refactor(24143): refactor editable cell and add required checks * refactor(24143): refactor initial state * refactor(24143): fix publish * feat(24143): add ui mapping to adapters * refactor(24318): update dependencies * refactor(24318): refactor the form widget to export the UI components * refactor(24318): refactor the table component * refactor(24318): add a grid component * refactor(24318): revert datagrid trials * feat(24318): add custom templates for the compact grid * refactor(24318): refactor compact grid field * feat(24318): add custom field to the configuration of the adapter editor * test(24318): add mocks and tests
See https://hivemq.kanbanize.com/ctrl_board/57/cards/24318/details/
The PR creates a custom renderer for JSONSchema array of properties, intended for usage with limited object properties such as the
User Properties
The default rendering is similar to every array of properties, a flat verbose list of input fields with their own management (title, descriptions, error messages, etc.).
The PR reorganises the templates for the different parts of the schema to deliver a more compact, table-based editor
Design
uiSchema
configuration, by adding'ui:field': 'compactTable'
to the relevantproperty
, e.g.Out-of-scope
Before
After