This repository was archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathJobInspector.tsx
More file actions
66 lines (63 loc) · 2.1 KB
/
JobInspector.tsx
File metadata and controls
66 lines (63 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { FormikValues } from 'formik';
import JobMapping from '../../../mappings/JobMapping';
import { useStoreActions } from '../../../state/Hooks';
import { DefinitionModel } from '../../../state/Store';
import InspectorProperty from '../../atoms/form/InspectorProperty';
import ListProperty from '../../atoms/form/ListProperty';
import StepPropertiesMenu from '../../menus/definitions/StepDefinitionMenu';
import StepTypePage from '../../menus/definitions/subtypes/StepTypePage';
import SubTypeMenuNav from '../../menus/SubTypeMenu';
const JobInspector = (
props: FormikValues & { definitions: DefinitionModel },
) => {
const navigateTo = useStoreActions((actions) => actions.navigateTo);
const executor = props.values.executor;
const executorName = typeof executor === 'string' ? executor : executor.name;
return (
<div>
<InspectorProperty label="Name" name="name" required />
<InspectorProperty
label="Executor"
as="select"
name="executor.name"
value={executorName}
required
>
{[{ name: 'Select Executor' }, ...props.definitions.executors].map(
(executor) => (
<option value={executor.name} key={executor.name}>
{executor.name}
</option>
),
)}
</InspectorProperty>
<ListProperty
label="Steps"
name="steps"
values={props.values.steps}
expanded
emptyText="No steps defined yet."
titleExpanded={
<button
type="button"
onClick={() => {
navigateTo({
component: SubTypeMenuNav,
props: {
typePage: StepTypePage,
menuPage: StepPropertiesMenu,
passThrough: { dataType: JobMapping },
},
values: props.values,
});
}}
className="ml-auto tracking-wide hover:underline leading-6 text-sm text-circle-blue font-medium"
>
New
</button>
}
></ListProperty>
</div>
);
};
export default JobInspector;