6.0.10 • Published 5 months ago

@terminusdb/terminusdb-documents-ui v6.0.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

terminusdb-documents-ui

SDK to build UI from terminusdb documents

Run playground

Run playground to get a demo.

Create a new data product in TerminusCMS and name it Playground. Go to /product_model page and copy paste the schema from file - playground/src/schema.json.

Make a .env file and add the following

SERVER=https://cloud.terminusdb.com/ 
USER=<your email>
TEAM=<your team>
DATA_PRODUCT="Playground"
TOKEN=<your token>

After adding .env file, run the below command npm run playground

Run test

To connect to a particular data product in TerminusCMS - add the following variables to .env file

SERVER=https://cloud.terminusdb.com/
USER=<your email>
TEAM=<your team>
DATA_PRODUCT=<your data product ID>
TOKEN=<your token>

After adding .env file, run the below command npm run test

Installation

Install the dependancy from npm

npm install @terminusdb/terminusdb-documents-ui

Then import dependancy as shown below

import {FrameViewer} from '@terminusdb/terminusdb-documents-ui'

Usage

Create

    let frame = "Person": {
	  "@key": {
		"@fields": [
		  "name",
		  "works_as"
		],
		"@type": "Lexical"
	  },
	  "@type": "Class",
	  "likes": {
		"@class": {
		  "@id": "Color",
		  "@type": "Enum",
		  "@values": [
			"red",
			"blue",
			"green"
		  ]
		},
		"@type": "Optional"
	  },
	  "name": "xsd:string"
	}

    return <FrameViewer
        frame={frame}
        mode={"Create"}
        type={"Person"}/>

View

Note - make sure filled document is provided in View mode

    let frame = "Person": {
	  "@key": {
		"@fields": [
		  "name",
		  "works_as"
		],
		"@type": "Lexical"
	  },
	  "@type": "Class",
	  "likes": {
		"@class": {
		  "@id": "Color",
		  "@type": "Enum",
		  "@values": [
			"red",
			"blue",
			"green"
		  ]
		},
		"@type": "Optional"
	  },
	  "name": "xsd:string"
	}

    let data = {
        "@id": "Person/Peter%20+terminusdb%3A%2F%2F%2Fdata%2FJob%2Fadmin",
        "@type": "Person",
        "likes": "blue",
        "name": "Peter "
    }

    return <FrameViewer
        frame={frame}
        mode={"View"}
        formData={data}
        type={"Person"}/>
6.0.10

5 months ago

6.2.1

12 months ago

6.2.0

12 months ago

6.1.10

12 months ago

6.1.1-0.alpha.1

12 months ago

6.1.9-alpha.0

12 months ago

6.1.9-alpha.4

12 months ago

6.1.9-alpha.3

12 months ago

6.1.9-alpha.2

12 months ago

6.1.9-alpha.1

12 months ago

6.2.2-alpha.7

12 months ago

6.2.2-alpha.8

12 months ago

6.2.2-alpha.5

12 months ago

6.2.2-alpha.6

12 months ago

6.2.2-alpha.3

12 months ago

6.2.3-alpha.0

11 months ago

6.2.2-alpha.4

12 months ago

6.2.2-alpha.1

12 months ago

6.2.2-alpha.2

12 months ago

6.2.2-alpha.0

12 months ago

6.2.5

11 months ago

6.2.4

11 months ago

6.1.8

12 months ago

6.1.6

1 year ago

6.1.7

1 year ago

6.1.4

1 year ago

6.1.3

1 year ago

6.0.1

1 year ago

6.0.3

1 year ago

6.0.2

1 year ago

5.0.3

1 year ago

5.0.2

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago