Skip to content

Commit 7ecd022

Browse files
Ruben van LeeuwenDutchBen
authored andcommitted
947: Add formdefintion as JSON block
1 parent 8095cac commit 7ecd022

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

pages/example-form.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ import {
88
EuiPageHeader,
99
EuiSpacer,
1010
} from '@elastic/eui';
11-
import { WfoUserInputForm } from '@orchestrator-ui/orchestrator-ui-components';
11+
import {
12+
WfoJsonCodeBlock,
13+
WfoUserInputForm,
14+
} from '@orchestrator-ui/orchestrator-ui-components';
1215
import type { InputForm } from '@orchestrator-ui/orchestrator-ui-components';
16+
import { PROCESSES_ENDPOINT } from '@orchestrator-ui/orchestrator-ui-components';
1317

1418
export function ExampleFormPage() {
1519
const router = useRouter();
@@ -120,22 +124,30 @@ export function ExampleFormPage() {
120124
},
121125
},
122126
type: 'object',
127+
title: 'Example form',
123128
};
124129

125130
return (
126131
<EuiFlexGroup>
127132
<EuiFlexItem>
128133
<EuiPageHeader pageTitle="Example form" />
129134
<EuiSpacer />
130-
This page shows a sample of form fields that can be used to
131-
automatically create forms when creating workflows in the
132-
Workflow Orchestrator. For more information, see the
133-
<a
134-
href="https://workfloworchestrator.org/orchestrator-core/reference-docs/forms/"
135-
target="_blank"
136-
>
137-
Forms documentation
138-
</a>
135+
This page shows the form definition that a fictitious `$
136+
{PROCESSES_ENDPOINT}`/test-name endpoint might return to request
137+
userInput it needs and the form it is turned into. It shows the
138+
form fields and their types, and how they are rendered in the
139+
form.
140+
<EuiSpacer />
141+
<div>
142+
<a
143+
href="https://workfloworchestrator.org/orchestrator-core/reference-docs/forms/"
144+
target="_blank"
145+
>
146+
For more see the Forms documentation
147+
</a>
148+
</div>
149+
<EuiSpacer />
150+
<WfoJsonCodeBlock data={formDefinition} />
139151
<EuiSpacer />
140152
<WfoUserInputForm
141153
key={'key'}

0 commit comments

Comments
 (0)