-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItemSubclipCreateForm.jsx
More file actions
168 lines (164 loc) · 5.22 KB
/
ItemSubclipCreateForm.jsx
File metadata and controls
168 lines (164 loc) · 5.22 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import FormControl from '@material-ui/core/FormControl';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import FormHelperText from '@material-ui/core/FormHelperText';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import Typography from '@material-ui/core/Typography';
import { reduxForm } from 'redux-form';
import JobPriority from '../../const/JobPriority';
import { required } from '../../utils/FieldValidation';
import { TextField, Select } from '../form';
import { loadShapeTagOptions } from '../shapetag/ShapeTagSelect';
import { loadStorageOptions } from '../storage/StorageSelect';
import BoolCheckbox from '../ui/BoolCheckbox';
import Field from '../ui/Field';
import FieldTypeArray from '../ui/FieldTypeArray';
import FormSection from '../ui/FormSection';
import { KeyValuePairType } from '../ui/FormType';
import { StatefulAsyncSelect } from '../ui/Select';
const queryParams = () => (
<>
<Field
name="sourceTag"
label="sourceTag"
helperText="Comma-separated list of shape tags. The first valid shape is selected as the source of the job. If non of the tags are valid, the original shape will be used"
component={StatefulAsyncSelect}
loadOptions={loadShapeTagOptions}
cacheOptions
isClearable
fullWidth
isMulti
creatable
/>
<Field
name="tag"
label="tag"
helperText="Comma-separated list of shape tags specifying the desired output formats. Currently, only a single tag can be specified for a sequence item"
component={StatefulAsyncSelect}
loadOptions={loadShapeTagOptions}
cacheOptions
isClearable
fullWidth
isMulti
creatable
/>
<Field
name="original"
label="original"
component={TextField}
fullWidth
helperText="If specified, should be one of the tags specified in the tag parameter. Specifies that the original shape tag will be reset to the shape created to this tag."
/>
<Field
name="destinationItem"
label="destinationItem"
component={TextField}
fullWidth
helperText="An item id to which the new shape will be associated"
validate={[required]}
required
/>
<Field
name="storageId"
label="storageId"
helperText="Where essence file is to be stored"
component={StatefulAsyncSelect}
loadOptions={loadStorageOptions}
cacheOptions
isClearable
fullWidth
creatable
/>
<FormControl required fullWidth>
<InputLabel htmlFor="mode">mode</InputLabel>
<Field name="mode" component={Select} validate={[required]}>
<MenuItem value="Rendering">Rendering</MenuItem>
</Field>
<FormHelperText>Rendermode of the transcoder</FormHelperText>
</FormControl>
<Field
name="start"
label="start"
component={TextField}
fullWidth
helperText="Start frame in the source of the subclip"
/>
<Field name="duration" component={TextField} fullWidth helperText="Duration of the subclip" />
<Field
name="startTimeCode"
label="startTimeCode"
component={TextField}
fullWidth
helperText="Start timecode of the new clip"
/>
<Field
name="resourceId"
label="resourceId"
component={TextField}
fullWidth
helperText="The transcoder resource to use to execute the job"
/>
<Field
name="resourceTag"
label="resourceTag"
component={TextField}
fullWidth
helperText="The resource tag criteria used to select transcoders for the job"
/>
<Field
name="notification"
label="notification"
component={TextField}
fullWidth
helperText="The placeholder job notification to use for this job"
/>
<FieldTypeArray
name="notificationData"
label="notificationData"
component={KeyValuePairType}
arrayHeader
withHeader={false}
dense
/>
<FormControl fullWidth>
<InputLabel htmlFor="priority">priority</InputLabel>
<Field name="priority" component={Select}>
{JobPriority.map((priority) => (
<MenuItem key={priority} value={priority}>
{priority}
</MenuItem>
))}
</Field>
<FormHelperText>The priority to assign to the job. Default is MEDIUM</FormHelperText>
</FormControl>
<FieldTypeArray
name="jobmetadata"
label="jobmetadata"
component={KeyValuePairType}
withHeader={false}
arrayHeader
dense
/>
<FormControl>
<FormControlLabel
control={<Field name="holdJob" component={BoolCheckbox} />}
label="holdJob"
fullWidth
/>
<FormHelperText>Created job in a HOLD state</FormHelperText>
</FormControl>
</>
);
function ItemSubclipCreateForm({ itemId, error, handleSubmit }) {
return (
<form onSubmit={handleSubmit}>
{error && <Typography color="error">{error}</Typography>}
{itemId === undefined ? (
<Field name="itemId" label="Item ID" component={TextField} fullWidth />
) : null}
<FormSection name="queryParams" component={queryParams} />
<button type="submit" hidden />
</form>
);
}
export default reduxForm()(ItemSubclipCreateForm);