Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions docs/contributing/create-new-nodes/design-the-settings-dialog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
sidebar_position: 7.5
sidebar_label: "Design the settings dialog"
title: "Design the settings dialog"
---

# Design the settings dialog

<Lead>

Use the **JSONForms Playground** to design your node's settings form in the browser. Edit the schemas, see the form update as you type, then paste the result into your node. You don't need to build or run a worker.

</Lead>

<Badges>
<Badge color="blue">Any time after Step 4</Badge>
<Badge color="green">No install needed</Badge>
</Badges>

**Open it: [playground.tools.projectcontinuum.org](https://playground.tools.projectcontinuum.org)**

## Why use it

A node's settings dialog is described by two JSON documents in its metadata: `propertiesSchema` (what settings exist and what is valid) and `propertiesUiSchema` (how the form is laid out). See [Step 4](./step-4-write-your-node.md#settings-and-validation). Getting the layout right by rebuilding the worker and reloading the Workbench is slow. The playground gives you the same form in a second.

It uses the same [JSON Forms](https://jsonforms.io/) version, Material UI theme and custom renderers as the Workbench, so the form you design there should look and behave the same in the Workbench. The custom renderers are the code editor and the credential picker.

## What you can do

| Area | What it does |
|------|--------------|
| **Schema**, **UI Schema** and **Data** editors | Three editors for `propertiesSchema`, `propertiesUiSchema` and the default `properties`. The form re-renders as you type. Invalid JSON is reported next to the editor that has the problem. |
| **Form preview** | The rendered form. Editing a field in the form updates the **Data** editor, and the other way round. A chip shows **Valid** or the number of validation errors. |
| **Example** picker | Start from a built-in Continuum example (basic node, array of objects, categorization, code editor field, credential field) or from the upstream JSON Forms examples. |
| **Dialog preview** | Opens the form in a popup that mimics the Workbench's *Node Settings* dialog, with its title bar and default size, so you can check how the form fits. |
| **Light and dark themes** | Check that the form reads well in both. |

## A typical workflow

<Steps>

1. Open the playground and pick the closest **Example**, or start from the blank one.
2. Write your `propertiesSchema` in the **Schema** editor: the settings, their types, `required`, `minimum` and defaults.
3. Write your `propertiesUiSchema` in the **UI Schema** editor: layouts, groups, tabs and show or hide rules.
4. Use the form: fill it in, trigger validation errors, and check the **Data** editor shows the values you expect.
5. Open the **Dialog preview** to see it as the Workbench shows it.
6. Copy the three documents into your node: the schema and UI schema into `propertiesSchema` and `propertiesUiSchema`, and the data into `properties` (the defaults). In Kotlin or Java these are JSON strings, as in [Step 4](./step-4-write-your-node.md).

</Steps>

:::tip
Keep the schemas in the playground until the form feels right, then paste them into your node once. Escaping JSON inside Kotlin or Java strings is the part that's easy to get wrong, so do it last.
:::

## Credentials and code editors

Controls with `options.format` set to `"credential"` or `"code"` render with the same pickers and editors as the Workbench. See [Use a credential](./recipes.md#use-a-credential) for how a node reads the value.

In the playground, the credential picker shows **mock credentials**. It doesn't connect to a real credentials server, so use it to check the layout, not to test credential access.

## Load a real node from your platform

You can also load the schemas of nodes that are already registered with a running platform, for example to tweak the form of an existing node.

1. Start the platform, for example with [`continuum-local-setup`](../../getting-started/local-setup.md).
2. In the playground, turn on **Load from API** and enter the **API Server URL**. The default is `http://localhost:8081`.
3. Pick a node under **Load Node from API Server**. Use the refresh button to reload the catalog.

The playground reads the node catalog through the API server's node-explorer endpoint (`/api/v1/node-explorer/children`).

:::note
The hosted playground runs in your browser and calls the API server directly from there. The API server therefore has to allow cross-origin requests from `https://playground.tools.projectcontinuum.org`. If your API server doesn't, the playground shows **API server unreachable**. In that case, run the playground locally instead:

```bash
git clone https://github.com/projectcontinuum-org/continuum-jsonform-playground.git
cd continuum-jsonform-playground
npm install
npm run dev
```

Then open `http://localhost:4300`.
:::

## Found a difference from the Workbench?

The playground only helps if it matches the Workbench. If a form looks or behaves differently in the Workbench, please open an issue in the [playground repository](https://github.com/projectcontinuum-org/continuum-jsonform-playground/issues).

Next: [test and run your node](./step-5-test-and-run.md), or go back to the [recipes](./recipes.md).
2 changes: 2 additions & 0 deletions docs/contributing/create-new-nodes/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ You don't need a GitHub token, and you don't need to install Gradle: the reposit

</Steps>

To design a node's settings form without rebuilding anything, use the hosted [JSONForms Playground](https://playground.tools.projectcontinuum.org); see [Design the settings dialog](./design-the-settings-dialog.md).

After the six steps, [More node recipes](./recipes.md) covers adding more nodes, source nodes, credentials, retries, extra libraries, logging and debugging.

## Where to look when something breaks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ A node can have **several ports**. Add more entries to the map, give each a diff

- `properties` in the metadata holds the **default values** used when a user drops the node on the canvas.
- Before `execute()` runs, the platform checks the user's settings against `propertiesSchema`. Values that break `required`, `type` or `minimum` fail the node before your code starts. Checking again in `execute()` is still worthwhile because it lets you give a clearer error message.
- `propertiesUiSchema` is a [JSON Forms](https://jsonforms.io/) layout, used only to draw the form. For credential pickers, see [Credentials](./recipes.md#use-a-credential). You can try schemas in the [JSON Forms playground](https://github.com/projectcontinuum-org/continuum-jsonform-playground) first.
- `propertiesUiSchema` is a [JSON Forms](https://jsonforms.io/) layout, used only to draw the form. For credential pickers, see [Credentials](./recipes.md#use-a-credential). Design and try the form first in the [JSONForms Playground](https://playground.tools.projectcontinuum.org); see [Design the settings dialog](./design-the-settings-dialog.md).

### Reading and writing rows

Expand Down
1 change: 1 addition & 0 deletions docs/ecosystem/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Project Continuum is split across several focused repositories under the [`proje
| [continuum-feature-template](https://github.com/projectcontinuum-org/continuum-feature-template) | Template — scaffold your own custom feature worker. Uses the [Gradle plugin](./gradle-plugin.md) |
| [continuum-charts](https://github.com/projectcontinuum-org/continuum-charts) | Helm charts for deploying Continuum on Kubernetes |
| [continuum-local-setup](https://github.com/projectcontinuum-org/continuum-local-setup) | Docker Compose setup for running the entire platform locally |
| [continuum-jsonform-playground](https://github.com/projectcontinuum-org/continuum-jsonform-playground) | Browser playground for designing node settings dialogs (JSON schema and UI schema), hosted at [playground.tools.projectcontinuum.org](https://playground.tools.projectcontinuum.org). See [Design the settings dialog](../contributing/create-new-nodes/design-the-settings-dialog.md) |
| [continuum-website](https://github.com/projectcontinuum-org/continuum-website) | Marketing site ([projectcontinuum.org](https://projectcontinuum.org)) |
| [continuum-docs](https://github.com/projectcontinuum-org/continuum-docs) | This documentation site |

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
sidebar_position: 7.5
sidebar_label: "Design the settings dialog"
title: "Design the settings dialog"
---

# Design the settings dialog

<Lead>

Use the **JSONForms Playground** to design your node's settings form in the browser. Edit the schemas, see the form update as you type, then paste the result into your node. You don't need to build or run a worker.

</Lead>

<Badges>
<Badge color="blue">Any time after Step 4</Badge>
<Badge color="green">No install needed</Badge>
</Badges>

**Open it: [playground.tools.projectcontinuum.org](https://playground.tools.projectcontinuum.org)**

## Why use it

A node's settings dialog is described by two JSON documents in its metadata: `propertiesSchema` (what settings exist and what is valid) and `propertiesUiSchema` (how the form is laid out). See [Step 4](./step-4-write-your-node.md#settings-and-validation). Getting the layout right by rebuilding the worker and reloading the Workbench is slow. The playground gives you the same form in a second.

It uses the same [JSON Forms](https://jsonforms.io/) version, Material UI theme and custom renderers as the Workbench, so the form you design there should look and behave the same in the Workbench. The custom renderers are the code editor and the credential picker.

## What you can do

| Area | What it does |
|------|--------------|
| **Schema**, **UI Schema** and **Data** editors | Three editors for `propertiesSchema`, `propertiesUiSchema` and the default `properties`. The form re-renders as you type. Invalid JSON is reported next to the editor that has the problem. |
| **Form preview** | The rendered form. Editing a field in the form updates the **Data** editor, and the other way round. A chip shows **Valid** or the number of validation errors. |
| **Example** picker | Start from a built-in Continuum example (basic node, array of objects, categorization, code editor field, credential field) or from the upstream JSON Forms examples. |
| **Dialog preview** | Opens the form in a popup that mimics the Workbench's *Node Settings* dialog, with its title bar and default size, so you can check how the form fits. |
| **Light and dark themes** | Check that the form reads well in both. |

## A typical workflow

<Steps>

1. Open the playground and pick the closest **Example**, or start from the blank one.
2. Write your `propertiesSchema` in the **Schema** editor: the settings, their types, `required`, `minimum` and defaults.
3. Write your `propertiesUiSchema` in the **UI Schema** editor: layouts, groups, tabs and show or hide rules.
4. Use the form: fill it in, trigger validation errors, and check the **Data** editor shows the values you expect.
5. Open the **Dialog preview** to see it as the Workbench shows it.
6. Copy the three documents into your node: the schema and UI schema into `propertiesSchema` and `propertiesUiSchema`, and the data into `properties` (the defaults). In Kotlin or Java these are JSON strings, as in [Step 4](./step-4-write-your-node.md).

</Steps>

:::tip
Keep the schemas in the playground until the form feels right, then paste them into your node once. Escaping JSON inside Kotlin or Java strings is the part that's easy to get wrong, so do it last.
:::

## Credentials and code editors

Controls with `options.format` set to `"credential"` or `"code"` render with the same pickers and editors as the Workbench. See [Use a credential](./recipes.md#use-a-credential) for how a node reads the value.

In the playground, the credential picker shows **mock credentials**. It doesn't connect to a real credentials server, so use it to check the layout, not to test credential access.

## Load a real node from your platform

You can also load the schemas of nodes that are already registered with a running platform, for example to tweak the form of an existing node.

1. Start the platform, for example with [`continuum-local-setup`](../../getting-started/local-setup.md).
2. In the playground, turn on **Load from API** and enter the **API Server URL**. The default is `http://localhost:8081`.
3. Pick a node under **Load Node from API Server**. Use the refresh button to reload the catalog.

The playground reads the node catalog through the API server's node-explorer endpoint (`/api/v1/node-explorer/children`).

:::note
The hosted playground runs in your browser and calls the API server directly from there. The API server therefore has to allow cross-origin requests from `https://playground.tools.projectcontinuum.org`. If your API server doesn't, the playground shows **API server unreachable**. In that case, run the playground locally instead:

```bash
git clone https://github.com/projectcontinuum-org/continuum-jsonform-playground.git
cd continuum-jsonform-playground
npm install
npm run dev
```

Then open `http://localhost:4300`.
:::

## Found a difference from the Workbench?

The playground only helps if it matches the Workbench. If a form looks or behaves differently in the Workbench, please open an issue in the [playground repository](https://github.com/projectcontinuum-org/continuum-jsonform-playground/issues).

Next: [test and run your node](./step-5-test-and-run.md), or go back to the [recipes](./recipes.md).
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ You don't need a GitHub token, and you don't need to install Gradle: the reposit

</Steps>

To design a node's settings form without rebuilding anything, use the hosted [JSONForms Playground](https://playground.tools.projectcontinuum.org); see [Design the settings dialog](./design-the-settings-dialog.md).

After the six steps, [More node recipes](./recipes.md) covers adding more nodes, source nodes, credentials, retries, extra libraries, logging and debugging.

## Where to look when something breaks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ A node can have **several ports**. Add more entries to the map, give each a diff

- `properties` in the metadata holds the **default values** used when a user drops the node on the canvas.
- Before `execute()` runs, the platform checks the user's settings against `propertiesSchema`. Values that break `required`, `type` or `minimum` fail the node before your code starts. Checking again in `execute()` is still worthwhile because it lets you give a clearer error message.
- `propertiesUiSchema` is a [JSON Forms](https://jsonforms.io/) layout, used only to draw the form. For credential pickers, see [Credentials](./recipes.md#use-a-credential). You can try schemas in the [JSON Forms playground](https://github.com/projectcontinuum-org/continuum-jsonform-playground) first.
- `propertiesUiSchema` is a [JSON Forms](https://jsonforms.io/) layout, used only to draw the form. For credential pickers, see [Credentials](./recipes.md#use-a-credential). Design and try the form first in the [JSONForms Playground](https://playground.tools.projectcontinuum.org); see [Design the settings dialog](./design-the-settings-dialog.md).

### Reading and writing rows

Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.0.20/ecosystem/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Project Continuum is split across several focused repositories under the [`proje
| [continuum-feature-template](https://github.com/projectcontinuum-org/continuum-feature-template) | Template — scaffold your own custom feature worker. Uses the [Gradle plugin](./gradle-plugin.md) |
| [continuum-charts](https://github.com/projectcontinuum-org/continuum-charts) | Helm charts for deploying Continuum on Kubernetes |
| [continuum-local-setup](https://github.com/projectcontinuum-org/continuum-local-setup) | Docker Compose setup for running the entire platform locally |
| [continuum-jsonform-playground](https://github.com/projectcontinuum-org/continuum-jsonform-playground) | Browser playground for designing node settings dialogs (JSON schema and UI schema), hosted at [playground.tools.projectcontinuum.org](https://playground.tools.projectcontinuum.org). See [Design the settings dialog](../contributing/create-new-nodes/design-the-settings-dialog.md) |
| [continuum-website](https://github.com/projectcontinuum-org/continuum-website) | Marketing site ([projectcontinuum.org](https://projectcontinuum.org)) |
| [continuum-docs](https://github.com/projectcontinuum-org/continuum-docs) | This documentation site |

Expand Down
Loading