Skip to content

Commit 748edf7

Browse files
authored
Merge pull request #33 from vidispine/25.2.1
25.2.1
2 parents 1934f34 + 4ab52ba commit 748edf7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1178
-389
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vidispine/admin-tool",
3-
"version": "25.2.0",
3+
"version": "25.2.1",
44
"private": true,
55
"dependencies": {
66
"@devbookhq/splitter": "^1.3.2",

src/components/auditlog/AuditLogTable.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export default function AuditLogTable({
4343
<TableCell>Method</TableCell>
4444
<TableCell>Path</TableCell>
4545
<TableCell>Query Parameters</TableCell>
46-
<TableCell>Matrix Parameters</TableCell>
4746
</TableRow>
4847
</TableHead>
4948
<TableBody>

src/components/autoimport/AutoImportRuleDialog.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import WizardForm from '../ui/WizardForm';
88

99
import AutoImportRuleForm from './AutoImportRuleForm';
1010

11-
function AutoImportRuleDialog({ open, onClose, history, openSnackBar }) {
11+
function AutoImportRuleDialog({ storageId, open, onClose, history, openSnackBar }) {
1212
const onSubmitSuccess = (response) => {
1313
const { autoImportRuleDocument } = response;
1414
const { storage: storageId } = autoImportRuleDocument;
@@ -32,6 +32,7 @@ function AutoImportRuleDialog({ open, onClose, history, openSnackBar }) {
3232
onSubmitSuccess={onSubmitSuccess}
3333
onSubmitFail={onSubmitFail}
3434
onCancel={onClose}
35+
storageId={storageId}
3536
/>
3637
</DialogContent>
3738
</Dialog>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import Button from '@material-ui/core/Button';
2+
import Dialog from '@material-ui/core/Dialog';
3+
import DialogActions from '@material-ui/core/DialogActions';
4+
import DialogTitle from '@material-ui/core/DialogTitle';
5+
6+
import { autoimport as AutoImportApi } from '@vidispine/vdt-api';
7+
8+
import withUI from '../../hoc/withUI';
9+
10+
function AutoImportRuleDisable({ open, onClose, openSnackBar, storageId, onSuccess }) {
11+
const onAbandon = () => {
12+
AutoImportApi.disableAutoImport({ storageId })
13+
.then(() => {
14+
const messageContent = 'Auto Import Rule Disabled';
15+
openSnackBar({ messageContent });
16+
onClose();
17+
if (onSuccess) {
18+
onSuccess();
19+
}
20+
})
21+
.catch(() => {
22+
const messageContent = 'Error Disabling Auto Import Rule ';
23+
openSnackBar({ messageContent, messageColor: 'secondary' });
24+
});
25+
};
26+
return (
27+
<Dialog open={open} onClose={onClose} fullWidth maxWidth={false}>
28+
<DialogTitle>{`Disable ${storageId} Auto Import Rule`}</DialogTitle>
29+
<DialogActions>
30+
<Button onClick={onClose} color="primary">
31+
Close
32+
</Button>
33+
<Button variant="text" onClick={onAbandon} color="secondary" autoFocus>
34+
Disable
35+
</Button>
36+
</DialogActions>
37+
</Dialog>
38+
);
39+
}
40+
41+
export default withUI(AutoImportRuleDisable);

src/components/autoimport/AutoImportRuleEditor.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function AutoImportRuleEditor({ autoImportRuleDocument, storageId, openSnackBar,
3333
displayComponent={AutoImportRuleDisplay}
3434
displayProps={displayProps}
3535
initialValues={initialValues}
36+
storageId={storageId}
3637
/>
3738
);
3839
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import Button from '@material-ui/core/Button';
2+
import Dialog from '@material-ui/core/Dialog';
3+
import DialogActions from '@material-ui/core/DialogActions';
4+
import DialogTitle from '@material-ui/core/DialogTitle';
5+
6+
import { autoimport as AutoImportApi } from '@vidispine/vdt-api';
7+
8+
import withUI from '../../hoc/withUI';
9+
10+
function AutoImportRuleEnable({ open, onClose, openSnackBar, storageId, onSuccess }) {
11+
const onAbandon = () => {
12+
AutoImportApi.enableAutoImport({ storageId })
13+
.then(() => {
14+
const messageContent = 'Auto Import Rule Enabled';
15+
openSnackBar({ messageContent });
16+
onClose();
17+
if (onSuccess) {
18+
onSuccess();
19+
}
20+
})
21+
.catch(() => {
22+
const messageContent = 'Error Enabling Auto Import Rule ';
23+
openSnackBar({ messageContent, messageColor: 'secondary' });
24+
});
25+
};
26+
return (
27+
<Dialog open={open} onClose={onClose} fullWidth maxWidth={false}>
28+
<DialogTitle>{`Enable ${storageId} Auto Import Rule`}</DialogTitle>
29+
<DialogActions>
30+
<Button onClick={onClose} color="primary">
31+
Close
32+
</Button>
33+
<Button variant="text" onClick={onAbandon} color="secondary" autoFocus>
34+
Enable
35+
</Button>
36+
</DialogActions>
37+
</Dialog>
38+
);
39+
}
40+
41+
export default withUI(AutoImportRuleEnable);

src/components/autoimport/AutoImportRuleForm.jsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';
22
import Typography from '@material-ui/core/Typography';
33
import { reduxForm, Field, FormSection } from 'redux-form';
44

5+
import { required } from '../../utils/FieldValidation';
56
import { TextField } from '../form';
67
import { MetadataType } from '../metadata/MetadataForm';
78
import { loadShapeTagOptions } from '../shapetag/ShapeTagSelect';
@@ -25,17 +26,6 @@ function FilenameFilterTypeForm() {
2526
function AutoImportRuleTypeForm() {
2627
return (
2728
<>
28-
<Field
29-
name="storage"
30-
label="Storage ID"
31-
component={StatefulAsyncSelect}
32-
loadOptions={loadStorageOptions}
33-
cacheOptions
34-
isClearable
35-
required
36-
fullWidth
37-
disableInitial
38-
/>
3929
<FormControlLabel
4030
control={<Field name="enabled" component={BoolCheckbox} />}
4131
label="Enabled"
@@ -78,10 +68,24 @@ function AutoImportRuleTypeForm() {
7868
);
7969
}
8070

81-
function AutoImportRuleForm({ error, handleSubmit }) {
71+
function AutoImportRuleForm({ error, handleSubmit, storageId }) {
8272
return (
8373
<form onSubmit={handleSubmit}>
8474
{error && <Typography color="error">{error}</Typography>}
75+
{!storageId && (
76+
<Field
77+
name="storageId"
78+
label="Storage ID"
79+
component={StatefulAsyncSelect}
80+
loadOptions={loadStorageOptions}
81+
cacheOptions
82+
isClearable
83+
required
84+
fullWidth
85+
disableInitial
86+
validate={[required]}
87+
/>
88+
)}
8589
<FormSection name="autoImportRuleDocument" component={AutoImportRuleTypeForm} />
8690
<button type="submit" hidden />
8791
</form>

src/components/autoimport/AutoImportRuleTitle.jsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/components/job/JobDisplay.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function JobTaskType({ value = {} }) {
5252
titleKey="step"
5353
value={
5454
Array.isArray(value.subTask)
55-
? value.subTask.sort((a, b) => b.step - a.step)
55+
? value.subTask.sort((a, b) =>
56+
b.step === a.step ? b.attempts - a.attempts : b.step - a.step,
57+
)
5658
: value.subTask
5759
}
5860
component={JobTaskType}
@@ -95,7 +97,13 @@ function StepType({ value }) {
9597
<TypeArray
9698
title="Step"
9799
titleKey="step"
98-
value={Array.isArray(value.task) ? value.task.sort((a, b) => b.step - a.step) : value.task}
100+
value={
101+
Array.isArray(value.task)
102+
? value.task.sort((a, b) =>
103+
b.step === a.step ? b.attempts - a.attempts : b.step - a.step,
104+
)
105+
: value.task
106+
}
99107
component={JobTaskType}
100108
hideNoValue
101109
hover

src/components/resource/ResourceDisplay.jsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
import { Fragment } from 'react';
22

3+
import { SimpleMetadataType, KeyValuePairType } from '../ui/DisplayType';
34
import TextGrid from '../ui/TextGrid';
4-
5-
function SimpleMetadataType({ metadata }) {
6-
return (
7-
<>
8-
<TextGrid title="Metadata" value="" />
9-
{metadata.field &&
10-
metadata.field.map((field) => (
11-
<TextGrid key={field.key} title={field.key} value={field.value} />
12-
))}
13-
</>
14-
);
15-
}
5+
import TypeArray from '../ui/TypeArray';
166

177
function ThumbnailServiceType({ thumbnail }) {
188
return (
199
<>
2010
<TextGrid title="Path" value={thumbnail.path} />
2111
<TextGrid title="Mode" value={thumbnail.mode} />
12+
<TextGrid title="state" value={thumbnail.state} />
13+
<TextGrid title="Last Success" value={thumbnail.lastSuccess} />
14+
<TextGrid title="Last Failure" value={thumbnail.lastFailure} />
15+
<TextGrid title="Failure Message" value={thumbnail.failureMessage} />
2216
</>
2317
);
2418
}
@@ -39,7 +33,7 @@ function FinalCutServerType({ finalcutserver }) {
3933
<TextGrid title="Tag" value={finalcutserver.tag} />
4034
<TextGrid title="State" value={finalcutserver.state} />
4135
<TextGrid title="Description" value={finalcutserver.description} />
42-
<SimpleMetadataType metadata={finalcutserver.metadata} />
36+
<TypeArray title="Metadata" value={finalcutserver.metadata} component={SimpleMetadataType} />
4337
</>
4438
);
4539
}
@@ -113,6 +107,7 @@ function TranscoderType({ transcoder }) {
113107
{/* <TextGrid title="Transcoder" value={transcoder.transcoder} /> */}
114108
<TextGrid title="Weight" value={transcoder.weight} />
115109
<TextGrid title="Max Job" value={transcoder.maxJob} />
110+
<TypeArray title="Resource Tag" value={transcoder.resourceTag} component={KeyValuePairType} />
116111
</>
117112
);
118113
}
@@ -134,7 +129,7 @@ function MXFServerResourceType({ mxfserver }) {
134129
<TextGrid title="Detect Atom" variant="boolean" value={mxfserver.detectAtom} />
135130
<TextGrid title="Enforce Quota" variant="boolean" value={mxfserver.enforceQuota} />
136131
<TextGrid title="File Import Pattern" value={mxfserver.fileImportPattern} />
137-
<SimpleMetadataType metadata={mxfserver.metadata} />
132+
<TypeArray title="Metadata" value={mxfserver.metadata} component={SimpleMetadataType} />
138133
</>
139134
);
140135
}

0 commit comments

Comments
 (0)