1.0.0 • Published 1 year ago

@deix/mozart-ui v1.0.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

Mozart UI

This repository contains react components to display and edit tables exposed by mozart.

React components usage

The main component is DBTable, which can be used by passing mozartURL and editable props:

<DBTable
    mozartURL='http://localhost:8000/api/db'
    dbTable='table_name'
    editable
/>

Props

  • mozartURL (string): base url where mozart endpoints are reachable
  • dbTable (string): name of the table
  • filterQuery { key: string: string }: any additional query params to be passed to mozart
  • editable boolean: will allow editing the table
  • singleSelectColumns {key: string: string[]}: a map where the keys are table columns and the values are a list of selectable options
  • newRowTemplate: an object containing the default values for a new row

Any additional prop will be passed to the underlying DataGrid.

Usage as a docker image

docker run -d \
    -e MOZART_URL=http://localhost:8000/api/db \
    -e ENABLE_EDITING=true \
    -p 3000:3000 \
    quay.io/deix/mozart-ui