Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vidispine/admin-tool",
"version": "25.3.0",
"version": "25.3.1",
"private": true,
"dependencies": {
"@devbookhq/splitter": "^1.3.2",
Expand Down
1 change: 1 addition & 0 deletions src/components/autoimport/AutoImportRuleDisplay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function AutoImportRuleType({ rule }) {
<>
<TextGrid title="Storage ID" variant="storageId" value={rule.storage} hover />
<TextGrid title="Enabled" variant="boolean" value={rule.enabled} hover />
<TextGrid title="Priority" value={rule.priority} hover />
<TextGrid title="File Name As Title" variant="boolean" value={rule.fileNameAsTitle} hover />
<TextGrid
title="Ignore Sidecar Import"
Expand Down
16 changes: 15 additions & 1 deletion src/components/autoimport/AutoImportRuleForm.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import FormControl from '@material-ui/core/FormControl';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import Typography from '@material-ui/core/Typography';
import { reduxForm, Field, FormSection } from 'redux-form';

import JobPriority from '../../const/JobPriority';
import { required } from '../../utils/FieldValidation';
import { TextField } from '../form';
import { TextField, Select } from '../form';
import { MetadataType } from '../metadata/MetadataForm';
import { loadShapeTagOptions } from '../shapetag/ShapeTagSelect';
import { loadStorageOptions } from '../storage/StorageSelect';
Expand All @@ -30,6 +34,16 @@ function AutoImportRuleTypeForm() {
control={<Field name="enabled" component={BoolCheckbox} />}
label="Enabled"
/>
<FormControl fullWidth>
<InputLabel htmlFor="priority">Priority</InputLabel>
<Field name="priority" component={Select}>
{JobPriority.map((priority) => (
<MenuItem key={priority} value={priority}>
{priority}
</MenuItem>
))}
</Field>
</FormControl>
<FormControlLabel
control={<Field name="fileNameAsTitle" component={BoolCheckbox} />}
label="File Name As Title"
Expand Down
70 changes: 70 additions & 0 deletions src/components/item/ItemSubclipCreate.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import Divider from '@material-ui/core/Divider';
import { compose } from 'redux';

import * as formActions from '../../formactions/item';
import withFormActions from '../../hoc/withFormActions';
import withUI from '../../hoc/withUI';

import ItemSubclipCreateForm from './ItemSubclipCreateForm';

const ITEM_SUBCLIP_CREATE_FORM = 'ITEM_SUBCLIP_CREATE_FORM';

function ItemSubclipCreate({
open,
onClose,
onSuccess,
onFail,
openSnackBar,
submitForm,
itemId,
initialValues,
form = ITEM_SUBCLIP_CREATE_FORM,
}) {
const onSubmitSuccess = (response, dispatch, props) => {
const messageContent = 'Subclip Job Created';
openSnackBar({ messageContent });
if (onSuccess) {
onSuccess(response, dispatch, props);
}
onClose();
};
const onSubmitFail = (error, dispatch, props) => {
const messageContent = 'Error Creating Subclip';
openSnackBar({ messageContent, messageColor: 'secondary' });
if (onFail) {
onFail(error, dispatch, props);
}
};
return (
<Dialog open={open} onClose={onClose} fullWidth maxWidth={false}>
<DialogTitle>Create Sequence</DialogTitle>
<DialogContent>
<ItemSubclipCreateForm
form={form}
onSubmit={formActions.onCreateItemSubclip}
onSubmitSuccess={onSubmitSuccess}
onSubmitFail={onSubmitFail}
onCancel={onClose}
itemId={itemId}
initialValues={{ itemId, ...initialValues }}
/>
</DialogContent>
<Divider />
<DialogActions>
<Button color="secondary" onClick={onClose}>
Close
</Button>
<Button variant="contained" color="primary" onClick={() => submitForm(form)}>
Create
</Button>
</DialogActions>
</Dialog>
);
}

export default compose(withUI, withFormActions)(ItemSubclipCreate);
168 changes: 168 additions & 0 deletions src/components/item/ItemSubclipCreateForm.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,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);
4 changes: 4 additions & 0 deletions src/components/item/ItemTitle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function ItemTitle({
breadcrumbList,
createShapeModal,
createSequenceModal,
createSubclipModal,
analyzeModal,
...props
}) {
Expand Down Expand Up @@ -150,6 +151,9 @@ function ItemTitle({
<MenuItem onClick={() => onOpen({ modalName: createSequenceModal })}>
<Typography>Create Sequence</Typography>
</MenuItem>
<MenuItem onClick={() => onOpen({ modalName: createSubclipModal })}>
<Typography>Create Subclip</Typography>
</MenuItem>
<MenuItem onClick={() => onOpen({ modalName: exportModal })}>
<Typography>Export</Typography>
</MenuItem>
Expand Down
20 changes: 19 additions & 1 deletion src/components/notification/NotificationTrigger.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function StorageTriggerType({ trigger: { storage } }) {
triggerAction = 'create';
} else if ('delete' in storage) {
triggerAction = 'delete';
} else if ('modify' in storage) {
triggerAction = 'modify';
}
return <TextGrid title="Trigger Action" value={triggerAction} />;
}
Expand All @@ -169,6 +171,8 @@ function FileTriggerType({ trigger: { file } }) {
triggerAction = 'close';
} else if ('delete' in file) {
triggerAction = 'delete';
} else if ('lost' in file) {
triggerAction = 'lost';
}
return <TextGrid title="Trigger Action" value={triggerAction} />;
}
Expand Down Expand Up @@ -227,8 +231,22 @@ function DocumentTriggerType({ trigger: { document } }) {
triggerAction = 'create';
} else if ('delete' in document) {
triggerAction = 'delete';
} else if ('modify' in document) {
triggerAction = 'modify';
}
return <TextGrid title="Trigger Action" value={triggerAction} />;
return (
<>
<TextGrid title="Trigger Action" value={triggerAction} />
{triggerAction === 'modify' && (
<>
<TextGrid title="Field" value={document?.modify?.field} />
<TextGrid title="Language" value={document?.modify?.language} />
<TextGrid title="Track" value={document?.modify?.track} />
<TextGrid title="Interval" value={document?.modify?.interval} />
</>
)}
</>
);
}

function DeletionLockTriggerType({ trigger: { deletionLock } }) {
Expand Down
Loading