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 response = data?.executeFlow?.data;
|
||||
|
||||
const isCompleted = !error && called && !loading;
|
||||
const hasNoOutput = !response && isCompleted;
|
||||
|
||||
const {
|
||||
name,
|
||||
} = substep;
|
||||
@@ -73,7 +76,7 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement {
|
||||
{error?.graphQLErrors.map((error) => (<>{error.message}<br /></>))}
|
||||
</Alert>}
|
||||
|
||||
{called && !loading && !error && !response && (
|
||||
{hasNoOutput && (
|
||||
<Alert severity="warning" sx={{ mb: 1, width: '100%' }}>
|
||||
<AlertTitle sx={{ fontWeight: 700 }}>{formatMessage('flowEditor.noTestDataTitle')}</AlertTitle>
|
||||
|
||||
@@ -96,7 +99,8 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement {
|
||||
disabled={editorContext.readOnly}
|
||||
color="primary"
|
||||
>
|
||||
Test & Continue
|
||||
{isCompleted && formatMessage('flowEditor.continue')}
|
||||
{!isCompleted && formatMessage('flowEditor.testAndContinue')}
|
||||
</LoadingButton>
|
||||
</ListItem>
|
||||
</Collapse>
|
||||
|
@@ -49,6 +49,8 @@
|
||||
"flowEditor.publishedFlowCannotBeUpdated": "To edit this flow, you must first unpublish it.",
|
||||
"flowEditor.noTestDataTitle": "We couldn't find matching data",
|
||||
"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.updatedAt": "updated {datetime}",
|
||||
"flow.view": "View",
|
||||
|
Reference in New Issue
Block a user