feat(TestSubstep): show continue upon successful test
This commit is contained in:
@@ -39,6 +39,9 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement {
|
|||||||
const [executeFlow, { data, error, loading, called, reset }] = useMutation(EXECUTE_FLOW, { context: { autoSnackbar: false }});
|
const [executeFlow, { data, error, loading, called, reset }] = useMutation(EXECUTE_FLOW, { context: { autoSnackbar: false }});
|
||||||
const response = data?.executeFlow?.data;
|
const response = data?.executeFlow?.data;
|
||||||
|
|
||||||
|
const isCompleted = !error && called && !loading;
|
||||||
|
const hasNoOutput = !response && isCompleted;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
} = substep;
|
} = substep;
|
||||||
@@ -73,7 +76,7 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement {
|
|||||||
{error?.graphQLErrors.map((error) => (<>{error.message}<br /></>))}
|
{error?.graphQLErrors.map((error) => (<>{error.message}<br /></>))}
|
||||||
</Alert>}
|
</Alert>}
|
||||||
|
|
||||||
{called && !loading && !error && !response && (
|
{hasNoOutput && (
|
||||||
<Alert severity="warning" sx={{ mb: 1, width: '100%' }}>
|
<Alert severity="warning" sx={{ mb: 1, width: '100%' }}>
|
||||||
<AlertTitle sx={{ fontWeight: 700 }}>{formatMessage('flowEditor.noTestDataTitle')}</AlertTitle>
|
<AlertTitle sx={{ fontWeight: 700 }}>{formatMessage('flowEditor.noTestDataTitle')}</AlertTitle>
|
||||||
|
|
||||||
@@ -96,7 +99,8 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement {
|
|||||||
disabled={editorContext.readOnly}
|
disabled={editorContext.readOnly}
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
Test & Continue
|
{isCompleted && formatMessage('flowEditor.continue')}
|
||||||
|
{!isCompleted && formatMessage('flowEditor.testAndContinue')}
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
|
@@ -49,6 +49,8 @@
|
|||||||
"flowEditor.publishedFlowCannotBeUpdated": "To edit this flow, you must first unpublish it.",
|
"flowEditor.publishedFlowCannotBeUpdated": "To edit this flow, you must first unpublish it.",
|
||||||
"flowEditor.noTestDataTitle": "We couldn't find matching data",
|
"flowEditor.noTestDataTitle": "We couldn't find matching data",
|
||||||
"flowEditor.noTestDataMessage": "Create a sample in the associated service and test the step again.",
|
"flowEditor.noTestDataMessage": "Create a sample in the associated service and test the step again.",
|
||||||
|
"flowEditor.testAndContinue": "Test & Continue",
|
||||||
|
"flowEditor.continue": "Continue",
|
||||||
"flow.createdAt": "created {datetime}",
|
"flow.createdAt": "created {datetime}",
|
||||||
"flow.updatedAt": "updated {datetime}",
|
"flow.updatedAt": "updated {datetime}",
|
||||||
"flow.view": "View",
|
"flow.view": "View",
|
||||||
|
Reference in New Issue
Block a user