make onComplete not required
Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
+5
-2
@@ -25,7 +25,10 @@ import { Box, Button } from '@material-ui/core';
|
||||
import type { JsonValue } from '@backstage/types';
|
||||
import type { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
type EmbeddedWorkflowProps = Omit<WorkflowProps, 'customFieldExtensions'> & {
|
||||
type EmbeddedWorkflowProps = Omit<
|
||||
WorkflowProps,
|
||||
'customFieldExtensions' | 'onComplete'
|
||||
> & {
|
||||
customExtensionsElement?: React.ReactNode;
|
||||
initialFormState?: Record<string, JsonValue>;
|
||||
onComplete: (values: Record<string, JsonValue>) => Promise<void>;
|
||||
@@ -33,7 +36,7 @@ type EmbeddedWorkflowProps = Omit<WorkflowProps, 'customFieldExtensions'> & {
|
||||
FormProps: FormProps
|
||||
frontPage: ReactNode;
|
||||
finishPage: ReactNode;
|
||||
};
|
||||
} & Partial<Pick<WorkflowProps, 'onComplete'>>;
|
||||
|
||||
type Display = 'front' | 'workflow' | 'finish';
|
||||
|
||||
|
||||
@@ -26,9 +26,12 @@ const ReviewWrapper = () => {
|
||||
);
|
||||
};
|
||||
|
||||
/*
|
||||
* This is an exmaple component that uses the <EmbeddedScaffolderWorkflow />
|
||||
*/
|
||||
export function SecurityTab(): JSX.Element | null {
|
||||
// eslint-disable-next-line no-console
|
||||
const onComplete = async () => console.log('onComplete called from ');
|
||||
const onComplete = async () => console.log('we can add to onComplete here');
|
||||
|
||||
const onError = (error: Error | undefined) => (
|
||||
<h2>{error?.message ?? 'Houston we have a problem.'}</h2>
|
||||
|
||||
Reference in New Issue
Block a user