Skip to content

Commit 10b9210

Browse files
fix todos
1 parent 4af7814 commit 10b9210

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { SectionError } from '../section_error';
2424
import { pipelineFormSchema } from './schema';
2525

2626
interface Props {
27-
onSave: (pipeline: any) => void; // todo fix TS
27+
onSave: (pipeline: Pipeline) => void;
2828
isSaving: boolean;
2929
saveError: any;
3030
defaultValue?: Pipeline;
@@ -50,16 +50,16 @@ export const PipelineForm: React.FunctionComponent<Props> = ({
5050
const [isVersionVisible, setIsVersionVisible] = useState<boolean>(false);
5151
const [isOnFailureEditorVisible, setIsOnFailureEditorVisible] = useState<boolean>(false);
5252

53-
const setDataAndValidation: FormConfig['onSubmit'] = (formData, isValid) => {
53+
const handleSave: FormConfig['onSubmit'] = (formData, isValid) => {
5454
if (isValid) {
55-
onSave(formData);
55+
onSave(formData as Pipeline);
5656
}
5757
};
5858

5959
const { form } = useForm({
6060
schema: pipelineFormSchema,
6161
defaultValue,
62-
onSubmit: setDataAndValidation,
62+
onSubmit: handleSave,
6363
});
6464

6565
return (

x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
99
import { EuiPageBody, EuiPageContent, EuiSpacer, EuiTitle } from '@elastic/eui';
1010

1111
import { BASE_PATH } from '../../../../common/constants';
12+
import { Pipeline } from '../../../../common/types';
1213
import { useKibana } from '../../../shared_imports';
1314
import { PipelineForm } from '../../components';
1415

@@ -18,8 +19,7 @@ export const PipelinesCreate: React.FunctionComponent<RouteComponentProps> = ({
1819
const [isSaving, setIsSaving] = useState<boolean>(false);
1920
const [saveError, setSaveError] = useState<any>(null);
2021

21-
const onSave = async (pipeline: any) => {
22-
// TODO fix TS
22+
const onSave = async (pipeline: Pipeline) => {
2323
setIsSaving(true);
2424
setSaveError(null);
2525

x-pack/plugins/ingest_pipelines/public/shared_imports.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export {
2424
Form,
2525
getUseField,
2626
ValidationFuncArg,
27+
FormData,
2728
} from '../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib';
2829

2930
export {

0 commit comments

Comments
 (0)