diff --git a/ui/src/jobs/JobEdit.tsx b/ui/src/jobs/JobEdit.tsx index 1eedf0650..f2e1fdf05 100644 --- a/ui/src/jobs/JobEdit.tsx +++ b/ui/src/jobs/JobEdit.tsx @@ -6,15 +6,18 @@ import { SimpleForm, BooleanInput, NumberInput, - DateTimeInput + DateTimeInput, + required, + useRecordContext } from 'react-admin'; import { JsonInput } from "react-admin-json-view"; -export const JobEdit = (props: any) => ( - +export const JobEdit = () => { + const record = useRecordContext(); + return ( - -); + ); +} export const JobCreate = (props: any) => ( @@ -22,13 +25,13 @@ export const JobCreate = (props: any) => ( ); -const EditForm = (props: any) => ( - +const EditForm = (record: any) => ( + - + - + @@ -71,7 +74,7 @@ const EditForm = (props: any) => ( }} helperText="Job metadata describes the job and allows filtering from the API." /> - + ( displayDataTypes: false, }} helperText="Configuration arguments for the specific executor." + validate={required()} /> diff --git a/ui/src/jobs/JobShow.tsx b/ui/src/jobs/JobShow.tsx index 45a56e633..c8a66af4b 100644 --- a/ui/src/jobs/JobShow.tsx +++ b/ui/src/jobs/JobShow.tsx @@ -25,8 +25,8 @@ import { apiUrl } from '../dataProvider'; // basePath={basePath} const JobShowActions = ({ basePath, data, resource }: any) => ( - - + + ); diff --git a/ui/src/jobs/RunButton.tsx b/ui/src/jobs/RunButton.tsx index c572d9cc3..d73c05950 100644 --- a/ui/src/jobs/RunButton.tsx +++ b/ui/src/jobs/RunButton.tsx @@ -1,9 +1,10 @@ import { useState } from 'react'; -import { useNotify, useRefresh, Button } from 'react-admin'; +import { useNotify, useRefresh, Button, useRecordContext } from 'react-admin'; import { apiUrl } from '../dataProvider'; import RunIcon from '@mui/icons-material/PlayArrow'; -const RunButton = ({record}: any) => { +const RunButton = () => { + const record = useRecordContext(); const refresh = useRefresh(); const notify = useNotify(); const [loading, setLoading] = useState(false); diff --git a/ui/src/jobs/ToggleButton.tsx b/ui/src/jobs/ToggleButton.tsx index 7366dc4bc..8c5604a95 100644 --- a/ui/src/jobs/ToggleButton.tsx +++ b/ui/src/jobs/ToggleButton.tsx @@ -1,9 +1,10 @@ import { useState } from 'react'; -import { useNotify, useRefresh, Button } from 'react-admin'; +import { useNotify, useRefresh, Button, useRecordContext } from 'react-admin'; import { apiUrl } from '../dataProvider'; import ToggleIcon from '@mui/icons-material/Pause'; -const ToggleButton = ({record}: any) => { +const ToggleButton = () => { + const record = useRecordContext(); const refresh = useRefresh(); const notify = useNotify(); const [loading, setLoading] = useState(false);