Skip to content

Commit 676c4f1

Browse files
committed
implement cancel action on wizards
1 parent 329e78b commit 676c4f1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

web/src/components/forms/flowCollector-wizard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const FlowCollectorWizard: FC<FlowCollectorWizardProps> = props => {
135135
</Title>
136136
</div>
137137
<div id="wizard-container">
138-
<Wizard onStepChange={onStepChange} onSave={() => ctx.onSubmit(data)}>
138+
<Wizard onStepChange={onStepChange} onSave={() => ctx.onSubmit(data)} onClose={() => navigate('/')}>
139139
<WizardStep name={t('Overview')} id="overview">
140140
<span className="co-pre-line">
141141
{t(

web/src/components/forms/flowMetric-wizard.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
88
import { useParams } from 'react-router-dom-v5-compat';
99
import { ContextSingleton } from '../../utils/context';
1010
import { safeYAMLToJS } from '../../utils/yaml';
11-
import DynamicLoader from '../dynamic-loader/dynamic-loader';
11+
import DynamicLoader, { navigate } from '../dynamic-loader/dynamic-loader';
1212
import { FlowMetricUISchema } from './config/uiSchema';
1313
import { DynamicForm } from './dynamic-form/dynamic-form';
1414
import './forms.css';
@@ -86,7 +86,12 @@ export const FlowMetricWizard: FC<FlowMetricWizardProps> = props => {
8686
</Title>
8787
</div>
8888
<div id="wizard-container">
89-
<Wizard id="flowMetricWizard" onStepChange={onStepChange} onSave={() => ctx.onSubmit(data)}>
89+
<Wizard
90+
id="flowMetricWizard"
91+
onStepChange={onStepChange}
92+
onSave={() => ctx.onSubmit(data)}
93+
onClose={() => navigate('/')}
94+
>
9095
<WizardStep name={t('Overview')} id="overview">
9196
<span className="co-pre-line">
9297
{t(

0 commit comments

Comments
 (0)