Skip to content

Commit ae861ac

Browse files
authored
chore(orchestrator): fix paths for documentation (#773)
Signed-off-by: Marek Libra <marek.libra@gmail.com>
1 parent adaa9a5 commit ae861ac

3 files changed

Lines changed: 12 additions & 148 deletions

File tree

workspaces/orchestrator/docs/extensibleForm.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To implement the API, include @red-hat-developer-hub/backstage-plugin-orchestrat
1818
This package provides the `OrchestratorFormApi` interface and related types.
1919

2020
```typescript
21-
export type OrchestratorFormDecoratorProps = Pick<
21+
export type FormDecoratorProps = Pick<
2222
FormProps<JsonObject, JSONSchema7>,
2323
'formData' | 'formContext' | 'widgets' | 'onChange' | 'customValidate'
2424
> & {
@@ -28,21 +28,27 @@ export type OrchestratorFormDecoratorProps = Pick<
2828
};
2929

3030
export type OrchestratorFormDecorator = (
31-
FormComponent: React.ComponentType<OrchestratorFormDecoratorProps>,
31+
FormComponent: React.ComponentType<FormDecoratorProps>,
3232
) => React.ComponentType;
3333

3434
export interface OrchestratorFormApi {
35-
getFormDecorator(schema: JSONSchema7): OrchestratorFormDecorator;
35+
getFormDecorator(): OrchestratorFormDecorator;
3636
}
3737
```
3838

39+
### WrapperFormPropsContext
40+
41+
The OrchestratorFormApi implementation is wrapped within `WrapperFormPropsContext` to get access to i.e. recent UI schema, schemaUpdater or other-fields form data which can be used for data fetching or validation.
42+
43+
Use `useWrapperFormPropsContext()` hook to access the context.
44+
3945
### Example API Implementation
4046

4147
```typescript
4248
class CustomFormApi implements OrchestratorFormApi {
43-
getFormDecorator(schema: JSONSchema7) {
49+
getFormDecorator() {
4450
return (FormComponent: React.ComponentType<FormDecoratorProps>>) => {
45-
const widgets = {CountryWidget}; // CountryWidget needs to be implemneted and imported
51+
const widgets = {CountryWidget}; // CountryWidget needs to be implemented and imported
4652
return () => <FormComponent widgets={widgets} />;
4753
};
4854
}
@@ -131,6 +137,6 @@ The `orchestrator-form-react` plugin handles the following key tasks:
131137

132138
- **Organizing Forms into Wizard-Style Steps:** If the schema is an object containing nested objects (i.e., the root is an object, and its properties are also objects), the plugin organizes the form into multiple steps. Each nested object becomes a separate step in a wizard-style interface. For example, the schema provided above results in two steps: _Personal Details_ and _Contact Details_.
133139

134-
The [`orchestrator-form-react`](https://github.com/redhat-developer/rhdh-plugins/tree/main/workspaces/orchestrator/plugins/orchestrator-form-react) plugin is designed to operate independently of the main orchestrator plugin. This modularity allows developers to test and validate form behavior in a standalone Backstage development environment before integrating it with the full orchestrator setup.
140+
The [`orchestrator-form-react`](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/orchestrator-form-react) plugin is designed to operate independently of the main orchestrator plugin. This modularity allows developers to test and validate form behavior in a standalone Backstage development environment before integrating it with the full orchestrator setup.
135141

136142
To use this plugin, add the `@red-hat-developer-hub/backstage-plugin-orchestrator-form-react` package as a dependency in your project.

workspaces/orchestrator/plugins/orchestrator/docs/orchestratorFormWidgets.md renamed to workspaces/orchestrator/docs/orchestratorFormWidgets.md

File renamed without changes.

workspaces/orchestrator/plugins/orchestrator/docs/extensibleForm.md

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)