@@ -95,11 +95,11 @@ export const Workflow = (workflowProps: WorkflowProps): JSX.Element | null => {
|
||||
async (originalFormState: Record<string, JsonValue>) => {
|
||||
let formState: Record<string, JsonValue> = { ...originalFormState };
|
||||
|
||||
if (manifest?.EXPERIMENTAL_formDecorators && formDecorators?.size) {
|
||||
if (manifest?.EXPERIMENTAL_formDecorators) {
|
||||
// for each of the form decorators, go and call the decorator with the context
|
||||
await Promise.all(
|
||||
manifest.EXPERIMENTAL_formDecorators.map(async decorator => {
|
||||
const formDecorator = formDecorators.get(decorator.id);
|
||||
const formDecorator = formDecorators?.get(decorator.id);
|
||||
if (!formDecorator) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Failed to find form decorator', decorator.id);
|
||||
|
||||
@@ -52,6 +52,12 @@ export type ScaffolderFormDecorator<
|
||||
) => Promise<void>;
|
||||
};
|
||||
|
||||
/** @alpha */
|
||||
export type AnyScaffolderFormDecorator = ScaffolderFormDecorator<
|
||||
{ [key in string]: (zImpl: typeof z) => z.ZodType },
|
||||
{ [key in string]: AnyApiRef },
|
||||
any
|
||||
>;
|
||||
/**
|
||||
* Method for creating decorators which can be used to collect
|
||||
* secrets from the user before submitting to the backend.
|
||||
|
||||
Reference in New Issue
Block a user