-
Notifications
You must be signed in to change notification settings - Fork 14
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(Schema): create a schema editor #392
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ramfox
force-pushed
the
structure-row
branch
3 times, most recently
from
January 14, 2020 23:48
b5bf989
to
3b26a66
Compare
ramfox
changed the title
feat(SchemaItem): create DynamicEditField and SchemaItem
feat(Schema): create a schema editor
Jan 15, 2020
added components: - overlay/Overlay: used as a pop over, will call `onCancel` if you click outside fo the div, or click the 'x'. The `navigation` prop is optional. Any `children` will overflow-y scroll. - item/DataType.tsx: defines the `DataTypes` type. Wraps the type name, description, and icon. `type` and `description`, are defined and passed down. May want to refactor to keep description and type defined here, and just use the type to determine all content. - nav/TabPicker: has size options 'sm' and 'md', and color options 'light' and 'dark' - overlay/TypePickerOverlay: a version of `Overlay` that lists the DataTypes and passes through the `navigation` component. `typesAndDescriptions` are defined here. - structure/ColumnType: the component used to show the column type with its icon. Is not 'clickable' if there is no 'onClick' func passed down. I a column has more than one type, it will indicate 'multi' - structure/TypePicker: takes all these components and creates a TypePicker. Click on the columnType to get a TypePickerOverlay popup. Choose between single or multi mode. The chosen type is kept in the hidden input named for the column (`${column-name}-type`) This commit also created scss files based on the folder structure: - chrome - item - nav - overlay - structure - type It also adds a story for each component under the `structure` tab
modeled after the `DatasetReference` component Ran into a bizarre issue where the `commitEdit` function was only ever pulling from the initial state values, rather then the current state. Had to do a weird hack where I used the `prev` value in the setState functions to get the actual state... Added a new story for `Form` items
- adjusts ColumnType, TypePicker, and DynamicEditField to have `expanded` view - adds up, down, left, right carets to `Icon` - creates `SchemaItem` that expands and retracts - known bug, DynamicEditField doesn't expand fully at first when you expand SchemaItem
DynamicEditField uses editable `div` rather then `input`
…e no longer using `input`
`Schema` is now apart of the `Structure` component! We have schema editing in app :)
make adjustments to the way we handle unknown types and 'any'
internally we have decided to pass all the 'stuff' that a component needs to display as the prop `data`, and that each component should handle their own events this pr required refactoring to match with this paradigm
chriswhong
approved these changes
Jan 17, 2020
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 gorgeous! LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We now can edit the schema in app!
There is also a non-editable schema that you can view in history.
yarn storybook to check out each component on its own, or just take a look at any dataset you have to checkout out the new schema component!