Skip to content

Commit 10579ce

Browse files
authored
chore(orchestrator): user documentation for orchestrator-form-widgets (#764)
Signed-off-by: Marek Libra <marek.libra@gmail.com>
1 parent 8c6f0f1 commit 10579ce

3 files changed

Lines changed: 298 additions & 76 deletions

File tree

workspaces/orchestrator/plugins/orchestrator-form-widgets/README.md

Lines changed: 3 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -19,57 +19,14 @@ const app = createApp({
1919

2020
### Dynamic (for RHDH production)
2121

22-
For RHDH production deployments, it is expected that the plugin is exported as a dynamic plugin using janus CLI a loaded among the other dynamic frontend plugins.
22+
For RHDH production deployments, it is expected that the plugin is exported as a dynamic plugin using Janus CLI a loaded among the other dynamic frontend plugins.
2323
No explicit configuration is needed.
2424

2525
## Content
2626

27-
The plugin provides implementation of `OrchestratorFormApi` (for `orchestratorFormApiRef`) to extend the Workflow execution form for custom provided ui:widgets.
27+
Documentation of implemented widgets can be found in a [separate document](https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/orchestrator/docs/orchestratorFormWidgets.md).
2828

29-
## Context
30-
31-
## SchemaUpdater widget
32-
33-
A headless widget used for fetching snippets of JSON schema and dynamically updating the RJSF form JSON schema on the fly.
34-
35-
Example of use in workflow's input data schema:
36-
37-
```json
38-
"mySchemaUpdater": {
39-
"type": "string",
40-
"ui:widget": "SchemaUpdater",
41-
"ui:props": {
42-
"fetch:url": "https://service.providing/chunk01.json"
43-
}
44-
},
45-
"placeholderTwo": {
46-
"type": "string",
47-
"title": "This title is used until replaced by any SchemaUpdater"
48-
},
49-
"placeholderFour": {
50-
"ui:widget": "hidden"
51-
}
52-
```
53-
54-
The provided chunks are expected to be JSON documents of `SchemaChunksResponse` structure.
55-
56-
Example of response:
57-
58-
```
59-
{
60-
"placeholderTwo": {
61-
"type": "string",
62-
"title": "This is inputbox supplied by chunk02, replacing addition by chunk01 to the same placeholderTwo"
63-
},
64-
"placeholderFour": {
65-
"type": "string",
66-
"title": "This is ActiveTextInput ui:widget to test preservation of state on placeholderFour",
67-
"ui:widget": "ActiveTextInput"
68-
}
69-
}
70-
```
71-
72-
## HTTP server for dynamic widgets development - http-workflow-dev-server
29+
## `http-workflow-dev-server` - HTTP server for dynamic widgets development
7330

7431
**For the development purposes only**, there is `http-workflow-dev-server`, very simple Express Node.js server which responds with JSON schema chunks for the `SchemaUpdater` and other active widgets.
7532

@@ -149,32 +106,3 @@ The URLs referenced from this workflow's data input schema rely on proxy configu
149106

150107
This dev-only workflow is similar to https://github.com/rhdhorchestrator/backstage-orchestrator-workflows/blob/main/workflows/dynamic.schema.sw.json .
151108
The difference is in the URLs used - the backstage-orchestrator-workflows' one references public GitHub HTTP server, so no extra steps in running the `http-workflow-dev-server` are needed.
152-
153-
## Development of a workflow using orchestrator-form-widgets
154-
155-
Developing workflows with `orchestrator-form-widgets` follows principles similar to standard workflow creation, with one critical enhancement: the ability to incorporate dynamic UI elements via the `ui:widget` property in your data input schema.
156-
157-
Key Differentiators:
158-
159-
- Dynamic UI Integration: Reference custom UI widgets directly in your schema using `ui:widget`, enabling interactive components like `ActiveTextInput` or `ActiveDropdown`.
160-
- Backend Flexibility: A live HTTP server is required to:
161-
- Serve JSON Schema snippets for the SchemaUpdater.
162-
- Provide default data or option lists.
163-
- Handle complex validation logic for widgets.
164-
165-
Deployment Considerations:
166-
167-
- Use one or multiple servers depending on organizational needs.
168-
- Ensure endpoint structures and response formats exactly match the naming conventions and data structures defined in your schema’s `ui:props` by the creator of workflow's `data input schema`.
169-
170-
TODO: describe components and provide snippets of code (based on the ADR).
171-
172-
### SchemaUpdater
173-
174-
TBD
175-
176-
### ActiveTextInput
177-
178-
TBD
179-
180-
### TBD: other sections - similar to the ADR

workspaces/orchestrator/plugins/orchestrator-form-widgets/http-workflow-dev-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The purpose of this Express Node.js server is to respond with JSON Schema chunks and other test data to ease development of the active widgets, like the `SchemaUpdater`.
44

5-
The production environment is expected to provide another HTTP server (unrelated to this testing one) dynamically providing `SchemaUpdater` snippets or fetch/validation functionality for other widgets.
5+
The production environment is expected to provide another HTTP server (unrelated to this testing one) which dynamically provides `SchemaUpdater` JSON-schema snippets or fetch/validation functionality for other widgets.
66

77
## How to run
88

0 commit comments

Comments
 (0)