Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Schema): create a schema editor (#392)
* feat(components): add components that build to create TypePicker 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 * feat(DynamicEditField): in place input field w/ validation 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 * feat(SchemaItem): row that contains editable schema info - 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 * feat(Schema): add schema, adjust DynamicEditField to use div DynamicEditField uses editable `div` rather then `input` * refactor(DynamicEditField): adjust where we pull value now that we are no longer using `input` * refactor(Schema): add non-editable state and bring Schema into app `Schema` is now apart of the `Structure` component! We have schema editing in app :) * refactor(Schema): handle strange types make adjustments to the way we handle unknown types and 'any' * refactor(structure): adjust inputs and function signatures 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
- Loading branch information