@imposium-hub/components 2.5.10-11 → 2.5.10-13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/assets/AssetsTableGlobalCell.js +2 -1
- package/dist/cjs/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableNameCell.js +3 -2
- package/dist/cjs/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTypeIcon.js +2 -0
- package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/cjs/components/card/Card.d.ts +1 -0
- package/dist/cjs/components/card/Card.js +17 -4
- package/dist/cjs/components/card/Card.js.map +1 -1
- package/dist/cjs/components/data-table/Paginator.js +51 -7
- package/dist/cjs/components/data-table/Paginator.js.map +1 -1
- package/dist/cjs/components/smpte-field/SMPTEField.d.ts +2 -1
- package/dist/cjs/components/smpte-field/SMPTEField.js +9 -3
- package/dist/cjs/components/smpte-field/SMPTEField.js.map +1 -1
- package/dist/cjs/constants/icons.d.ts +1 -0
- package/dist/cjs/constants/icons.js +3 -1
- package/dist/cjs/constants/icons.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/redux/actions/asset-list.js +34 -42
- package/dist/cjs/redux/actions/asset-list.js.map +1 -1
- package/dist/cjs/redux/actions/asset-uploads.js +23 -1
- package/dist/cjs/redux/actions/asset-uploads.js.map +1 -1
- package/dist/cjs/redux/reducers/asset-uploads.js +8 -0
- package/dist/cjs/redux/reducers/asset-uploads.js.map +1 -1
- package/dist/cjs/services/API.d.ts +3 -0
- package/dist/cjs/services/API.js +9 -0
- package/dist/cjs/services/API.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableGlobalCell.js +2 -1
- package/dist/esm/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableNameCell.js +3 -2
- package/dist/esm/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js +3 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/esm/components/card/Card.d.ts +1 -0
- package/dist/esm/components/card/Card.js +16 -4
- package/dist/esm/components/card/Card.js.map +1 -1
- package/dist/esm/components/data-table/Paginator.js +74 -44
- package/dist/esm/components/data-table/Paginator.js.map +1 -1
- package/dist/esm/components/smpte-field/SMPTEField.d.ts +2 -1
- package/dist/esm/components/smpte-field/SMPTEField.js +9 -3
- package/dist/esm/components/smpte-field/SMPTEField.js.map +1 -1
- package/dist/esm/constants/icons.d.ts +1 -0
- package/dist/esm/constants/icons.js +2 -0
- package/dist/esm/constants/icons.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/redux/actions/asset-list.js +34 -42
- package/dist/esm/redux/actions/asset-list.js.map +1 -1
- package/dist/esm/redux/actions/asset-uploads.js +12 -1
- package/dist/esm/redux/actions/asset-uploads.js.map +1 -1
- package/dist/esm/redux/reducers/asset-uploads.js +11 -0
- package/dist/esm/redux/reducers/asset-uploads.js.map +1 -1
- package/dist/esm/services/API.d.ts +3 -0
- package/dist/esm/services/API.js +9 -0
- package/dist/esm/services/API.js.map +1 -1
- package/dist/styles.css +13 -2
- package/dist/styles.less +16 -3
- package/less/components/data-table.less +4 -0
- package/less/components/form-field.less +7 -3
- package/less/components/tag.less +5 -0
- package/package.json +1 -1
- package/src/components/assets/AssetsTableAssetIdCell.tsx +65 -0
- package/src/components/assets/AssetsTableAssetIdFilter.tsx +40 -0
- package/src/components/assets/AssetsTableGlobalCell.tsx +11 -1
- package/src/components/assets/AssetsTableNameCell.tsx +11 -2
- package/src/components/assets/AssetsTypeIcon.tsx +4 -1
- package/src/components/card/Card.tsx +27 -13
- package/src/components/data-table/Paginator.tsx +140 -93
- package/src/components/smpte-field/SMPTEField.tsx +8 -3
- package/src/constants/icons.tsx +3 -0
- package/src/index.ts +4 -0
- package/src/redux/actions/asset-list.ts +37 -44
- package/src/redux/actions/asset-uploads.ts +11 -1
- package/src/redux/reducers/asset-uploads.ts +13 -0
- package/src/services/API.ts +15 -0
|
@@ -26,102 +26,149 @@ const Paginator: React.FC<any> = ({
|
|
|
26
26
|
setPageSize,
|
|
27
27
|
itemsPerPage,
|
|
28
28
|
onItemsPerPage
|
|
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
|
-
|
|
29
|
+
}) => {
|
|
30
|
+
const [getPageIndex, setPageIndex] = React.useState<number>(pageIndex);
|
|
31
|
+
const [getItemsPerPage, setItemsPerPage] = React.useState<number>(itemsPerPage);
|
|
32
|
+
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (pageIndex !== getPageIndex) {
|
|
35
|
+
setPageIndex(pageIndex);
|
|
36
|
+
}
|
|
37
|
+
}, [pageIndex]);
|
|
38
|
+
|
|
39
|
+
const onItemsPerPageBlur = () => {
|
|
40
|
+
clearTimeout(textInputTimeout);
|
|
41
|
+
onItemsPerPage(getItemsPerPage);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onGoToPageBlur = () => {
|
|
45
|
+
clearTimeout(textInputTimeout);
|
|
46
|
+
gotoPage(getPageIndex, pageSize);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const onItemsPerPageKeyDown = (e) => {
|
|
50
|
+
if (e.key === 'Enter') {
|
|
51
|
+
clearTimeout(textInputTimeout);
|
|
52
|
+
onItemsPerPage(getItemsPerPage);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const onGoToPageKeyDown = (e) => {
|
|
57
|
+
if (e.key === 'Enter') {
|
|
58
|
+
clearTimeout(textInputTimeout);
|
|
59
|
+
gotoPage(getPageIndex, pageSize);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<section className='ip-table-pagination'>
|
|
65
65
|
<span>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
<Button
|
|
67
|
+
style='subtle'
|
|
68
|
+
size='small'
|
|
69
|
+
tooltip='Go to first page'
|
|
70
|
+
disabled={!canPreviousPage}
|
|
71
|
+
onClick={() => gotoPage(1, pageSize)}>
|
|
72
|
+
{ICON_ANGLE_DOUBLE_LEFT}
|
|
73
|
+
</Button>
|
|
74
|
+
<Button
|
|
75
|
+
style='subtle'
|
|
76
|
+
size='small'
|
|
77
|
+
tooltip='Go to previous page'
|
|
78
|
+
disabled={!canPreviousPage}
|
|
79
|
+
onClick={() => previousPage()}>
|
|
80
|
+
{ICON_ANGLE_LEFT}
|
|
81
|
+
</Button>
|
|
82
|
+
<Button
|
|
83
|
+
style='subtle'
|
|
84
|
+
size='small'
|
|
85
|
+
tooltip='Go to next page'
|
|
86
|
+
disabled={!canNextPage}
|
|
87
|
+
onClick={() => nextPage()}>
|
|
88
|
+
{ICON_ANGLE_RIGHT}
|
|
89
|
+
</Button>
|
|
90
|
+
<Button
|
|
91
|
+
style='subtle'
|
|
92
|
+
size='small'
|
|
93
|
+
tooltip='Go to last page'
|
|
94
|
+
disabled={!canNextPage}
|
|
95
|
+
onClick={() => gotoPage(pageCount, pageSize)}>
|
|
96
|
+
{ICON_ANGLE_DOUBLE_RIGHT}
|
|
97
|
+
</Button>
|
|
70
98
|
|
|
99
|
+
<span>
|
|
100
|
+
{copy.table.page}
|
|
101
|
+
<strong>
|
|
102
|
+
{getPageIndex} of {pageCount}
|
|
103
|
+
</strong>
|
|
104
|
+
|
|
105
|
+
</span>
|
|
106
|
+
<span>
|
|
107
|
+
{copy.table.goToPage}
|
|
108
|
+
<input
|
|
109
|
+
className='paginator-input'
|
|
110
|
+
type='number'
|
|
111
|
+
placeholder={getPageIndex.toString()}
|
|
112
|
+
onChange={(e) => {
|
|
113
|
+
const input = e.target.value;
|
|
114
|
+
const inputNum = Number(input);
|
|
115
|
+
let next: number;
|
|
116
|
+
|
|
117
|
+
clearTimeout(textInputTimeout);
|
|
118
|
+
|
|
119
|
+
if (!input || inputNum < 1 || inputNum > pageCount) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (inputNum >= 1 && inputNum <= pageCount) {
|
|
124
|
+
next = inputNum;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
textInputTimeout = window.setTimeout(
|
|
128
|
+
() => gotoPage(next, pageSize),
|
|
129
|
+
1000
|
|
130
|
+
);
|
|
131
|
+
}}
|
|
132
|
+
onBlur={() => onGoToPageBlur()}
|
|
133
|
+
onKeyDown={(e) => onGoToPageKeyDown(e)}
|
|
134
|
+
/>
|
|
135
|
+
</span>
|
|
136
|
+
|
|
137
|
+
<span>
|
|
138
|
+
{copy.table.itemsPerPage}
|
|
139
|
+
<input
|
|
140
|
+
className='paginator-input'
|
|
141
|
+
type='number'
|
|
142
|
+
placeholder={getItemsPerPage.toString()}
|
|
143
|
+
min={1}
|
|
144
|
+
onChange={(e) => {
|
|
145
|
+
const input = e.target.value;
|
|
146
|
+
const inputNum = Number(input);
|
|
147
|
+
|
|
148
|
+
clearTimeout(textInputTimeout);
|
|
149
|
+
|
|
150
|
+
if (!input || inputNum < 1) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
setItemsPerPage(inputNum);
|
|
155
|
+
|
|
156
|
+
textInputTimeout = window.setTimeout(
|
|
157
|
+
() => onItemsPerPage(inputNum),
|
|
158
|
+
1000
|
|
159
|
+
);
|
|
160
|
+
}}
|
|
161
|
+
onBlur={() => onItemsPerPageBlur()}
|
|
162
|
+
onKeyDown={(e) => onItemsPerPageKeyDown(e)}
|
|
163
|
+
/>
|
|
164
|
+
</span>
|
|
71
165
|
</span>
|
|
72
|
-
<span>
|
|
73
|
-
{copy.table.goToPage}
|
|
74
|
-
<input
|
|
75
|
-
className='paginator-input'
|
|
76
|
-
type='number'
|
|
77
|
-
placeholder={pageIndex}
|
|
78
|
-
onChange={(e) => {
|
|
79
|
-
const input = e.target.value;
|
|
80
|
-
const inputNum = Number(input);
|
|
81
|
-
let next: number;
|
|
82
|
-
|
|
83
|
-
clearTimeout(textInputTimeout);
|
|
84
|
-
|
|
85
|
-
if (!input || inputNum < 1 || inputNum > pageCount) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (inputNum >= 1 && inputNum <= pageCount) {
|
|
90
|
-
next = inputNum;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
textInputTimeout = window.setTimeout(() => gotoPage(next, pageSize), 300);
|
|
94
|
-
}}
|
|
95
|
-
/>
|
|
96
|
-
</span>
|
|
97
|
-
|
|
98
|
-
<span>
|
|
99
|
-
{copy.table.itemsPerPage}
|
|
100
|
-
<input
|
|
101
|
-
className='paginator-input'
|
|
102
|
-
type='number'
|
|
103
|
-
placeholder={itemsPerPage}
|
|
104
|
-
min={1}
|
|
105
|
-
onChange={(e) => {
|
|
106
|
-
const input = e.target.value;
|
|
107
|
-
const inputNum = Number(input);
|
|
108
|
-
|
|
109
|
-
clearTimeout(textInputTimeout);
|
|
110
|
-
|
|
111
|
-
if (!input || inputNum < 1) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
textInputTimeout = window.setTimeout(() => onItemsPerPage(inputNum), 300);
|
|
116
|
-
}}
|
|
117
|
-
/>
|
|
118
|
-
</span>
|
|
119
|
-
</span>
|
|
120
166
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
);
|
|
167
|
+
<span className='total-assets'>
|
|
168
|
+
{copy.table.total} <strong>{totalItems || 0}</strong>
|
|
169
|
+
</span>
|
|
170
|
+
</section>
|
|
171
|
+
);
|
|
172
|
+
};
|
|
126
173
|
|
|
127
174
|
export default Paginator;
|
|
@@ -12,6 +12,7 @@ interface ISMPTEFieldProps {
|
|
|
12
12
|
width?: string | number;
|
|
13
13
|
onChange?(e): void;
|
|
14
14
|
onBlur?(e): void;
|
|
15
|
+
onError?(e): void;
|
|
15
16
|
info?: string;
|
|
16
17
|
labelPosition?: string;
|
|
17
18
|
labelWidth?: string | number;
|
|
@@ -75,7 +76,7 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
75
76
|
|
|
76
77
|
private onBlur(e?) {
|
|
77
78
|
const val = e ? e.target.value : this.inputRef.current.value;
|
|
78
|
-
const isValid = this.
|
|
79
|
+
const isValid = this.SMTPEValidator(val);
|
|
79
80
|
|
|
80
81
|
if (e && e.key === 'Enter') {
|
|
81
82
|
this.setDuration(isValid, val);
|
|
@@ -88,10 +89,12 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
88
89
|
|
|
89
90
|
private onChange() {
|
|
90
91
|
const val = this.inputRef.current.value;
|
|
91
|
-
const isValid = this.
|
|
92
|
+
const isValid = this.SMTPEValidator(val);
|
|
92
93
|
|
|
93
94
|
if (isValid) {
|
|
94
95
|
this.props.onChange(val);
|
|
96
|
+
} else {
|
|
97
|
+
this.props.onError(isValid);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
|
|
@@ -101,11 +104,13 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
101
104
|
const smpte = getSMPTE(frameRate, val);
|
|
102
105
|
if (smpte && this.props.onBlur) {
|
|
103
106
|
this.props.onBlur(smpte);
|
|
107
|
+
} else {
|
|
108
|
+
this.props.onError(isValid);
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
|
|
108
|
-
private
|
|
113
|
+
private SMTPEValidator(val) {
|
|
109
114
|
const isValidSMPTETimeCode = new RegExp(this.regex);
|
|
110
115
|
const isValid = isValidSMPTETimeCode.test(val);
|
|
111
116
|
const errorMsg = isValid ? null : TIMECODE.ERROR;
|
package/src/constants/icons.tsx
CHANGED
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
import { faCircleSmall } from '@fortawesome/pro-solid-svg-icons/faCircleSmall';
|
|
75
75
|
import { faClapperboardPlay } from '@fortawesome/pro-solid-svg-icons/faClapperboardPlay';
|
|
76
76
|
import { faCloudArrowUp, faFilters } from '@fortawesome/pro-solid-svg-icons';
|
|
77
|
+
import { faCircleExclamation } from '@fortawesome/free-solid-svg-icons';
|
|
77
78
|
|
|
78
79
|
export const ICON_VIDEO = <FontAwesomeIcon icon={faVideo} />;
|
|
79
80
|
|
|
@@ -220,3 +221,5 @@ export const ICON_CODE = <FontAwesomeIcon icon={faCode} />;
|
|
|
220
221
|
export const ICON_UP_RIGHT_FROM_SQUARE = <FontAwesomeIcon icon={faUpRightFromSquare} />;
|
|
221
222
|
|
|
222
223
|
export const ICON_FILE_UPLOAD = <FontAwesomeIcon icon={faCloudArrowUp} />;
|
|
224
|
+
|
|
225
|
+
export const ICON_FILE_ERROR = <FontAwesomeIcon icon={faCircleExclamation} />;
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ import AssetField from './components/assets/AssetField';
|
|
|
40
40
|
import AssetsTableDropzone from './components/assets/AssetsTableDropzone';
|
|
41
41
|
import AssetsTableNameCell from './components/assets/AssetsTableNameCell';
|
|
42
42
|
import AssetsTableNameFilter from './components/assets/AssetsTableNameFilter';
|
|
43
|
+
import AssetsTableAssetIdFilter from './components/assets/AssetsTableAssetIdFilter';
|
|
43
44
|
import AssetsTableSelectCell from './components/assets/AssetsTableSelectCell';
|
|
44
45
|
import AssetsTableSelectFilter from './components/assets/AssetsTableSelectFilter';
|
|
45
46
|
import AssetsTableTagsCell from './components/assets/AssetsTableTagsCell';
|
|
@@ -159,6 +160,7 @@ import ContextMenuTrigger from './components/context-menu/ContextMenuTrigger';
|
|
|
159
160
|
import CopyPropIdButton from './components/copy-prop-id-button/CopyPropIdButton';
|
|
160
161
|
import Submenu from './components/context-menu/SubMenu';
|
|
161
162
|
import { ConfirmModal } from './components/confirm-modal/ConfirmModal';
|
|
163
|
+
import AssetsTableAssetIdCell from './components/assets/AssetsTableAssetIdCell';
|
|
162
164
|
|
|
163
165
|
export {
|
|
164
166
|
AppWrapper,
|
|
@@ -217,6 +219,8 @@ export {
|
|
|
217
219
|
AssetsTableGlobalCell,
|
|
218
220
|
AssetsTableStatusCell,
|
|
219
221
|
AssetsTableNameFilter,
|
|
222
|
+
AssetsTableAssetIdFilter,
|
|
223
|
+
AssetsTableAssetIdCell,
|
|
220
224
|
AssetsTableNameCell,
|
|
221
225
|
AssetsTableDurationCell,
|
|
222
226
|
AssetsTableRateCell,
|
|
@@ -78,22 +78,19 @@ export const getAssets = (api: IImposiumAPI, storyId: string): any => {
|
|
|
78
78
|
|
|
79
79
|
export const deleteAssets = (api: IImposiumAPI, ids: string[], storyId: string): any => {
|
|
80
80
|
return (dispatch) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} else {
|
|
95
|
-
return Promise.resolve(false);
|
|
96
|
-
}
|
|
81
|
+
return new Promise<boolean>((resolve, reject) => {
|
|
82
|
+
dispatch(toggleLoading(true));
|
|
83
|
+
api.deleteAssets(ids)
|
|
84
|
+
.then(() => {
|
|
85
|
+
dispatch(getAssets(api, storyId));
|
|
86
|
+
dispatch(toggleLoading(false));
|
|
87
|
+
resolve(true);
|
|
88
|
+
})
|
|
89
|
+
.catch((errors: Error[]) => {
|
|
90
|
+
dispatch(toggleLoading(false));
|
|
91
|
+
reject(false);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
97
94
|
};
|
|
98
95
|
};
|
|
99
96
|
|
|
@@ -194,20 +191,18 @@ export const deleteAssetTags = (api: IImposiumAPI, id: string): any => {
|
|
|
194
191
|
|
|
195
192
|
export const deleteAssetsTags = (api: IImposiumAPI, ids: string[], storyId: string): any => {
|
|
196
193
|
return (dispatch) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
});
|
|
210
|
-
}
|
|
194
|
+
return new Promise<void>((resolve, reject) => {
|
|
195
|
+
dispatch(toggleLoading(true));
|
|
196
|
+
api.deleteAssetsTags(ids)
|
|
197
|
+
.then(() => {
|
|
198
|
+
dispatch(getAssets(api, storyId));
|
|
199
|
+
resolve();
|
|
200
|
+
})
|
|
201
|
+
.catch((errors: Error[]) => {
|
|
202
|
+
dispatch(toggleLoading(false));
|
|
203
|
+
reject();
|
|
204
|
+
});
|
|
205
|
+
});
|
|
211
206
|
};
|
|
212
207
|
};
|
|
213
208
|
|
|
@@ -245,20 +240,18 @@ export const updateAssetStory = (api: IImposiumAPI, id: string, storyId: string)
|
|
|
245
240
|
|
|
246
241
|
export const decoupleAssets = (api: IImposiumAPI, ids: string[], storyId: string): any => {
|
|
247
242
|
return (dispatch) => {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
});
|
|
261
|
-
}
|
|
243
|
+
return new Promise<void>((resolve, reject) => {
|
|
244
|
+
dispatch(toggleLoading(true));
|
|
245
|
+
api.decoupleAssets(ids)
|
|
246
|
+
.then(() => {
|
|
247
|
+
dispatch(getAssets(api, storyId));
|
|
248
|
+
resolve();
|
|
249
|
+
})
|
|
250
|
+
.catch((errors: Error[]) => {
|
|
251
|
+
dispatch(toggleLoading(false));
|
|
252
|
+
reject();
|
|
253
|
+
});
|
|
254
|
+
});
|
|
262
255
|
};
|
|
263
256
|
};
|
|
264
257
|
|
|
@@ -7,7 +7,8 @@ const assetUploadsActions: any = {
|
|
|
7
7
|
UPDATE_UPLOAD: 'assetUploads/UPDATE_UPLOAD',
|
|
8
8
|
UPDATE_PERCENT_UPLOADED: 'assetUploads/UPDATE_PERCENT_UPLOADED',
|
|
9
9
|
ADD_UPLOAD_ASSET_ID: 'assetUploads/ADD_UPLOAD_ASSET_ID',
|
|
10
|
-
REMOVE_UPLOAD: 'assetUploads/REMOVE_UPLOAD'
|
|
10
|
+
REMOVE_UPLOAD: 'assetUploads/REMOVE_UPLOAD',
|
|
11
|
+
ERROR: 'assetUploads/ERROR'
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
const POLL_INTERVAL: number = 5000;
|
|
@@ -241,6 +242,15 @@ const uploadAssetHandler = (api: IImposiumAPI, dispatch, getStore) => {
|
|
|
241
242
|
if (axios.isCancel(e) && currentQueue !== queueLength - 1) {
|
|
242
243
|
currentQueue = currentQueue + 1;
|
|
243
244
|
createPromise(currentQueue);
|
|
245
|
+
} else {
|
|
246
|
+
const error: any = { ...e };
|
|
247
|
+
const errorMsg = error.response.data.error.split(':')[0];
|
|
248
|
+
dispatch({
|
|
249
|
+
type: assetUploadsActions.ERROR,
|
|
250
|
+
filename: uploadBlobs[activeIndex].filename,
|
|
251
|
+
errorMsg
|
|
252
|
+
});
|
|
253
|
+
doAssetTableHydration(api, storyId);
|
|
244
254
|
}
|
|
245
255
|
});
|
|
246
256
|
}
|
|
@@ -47,6 +47,19 @@ const assetUploads = (state = initialState, action): any => {
|
|
|
47
47
|
...state,
|
|
48
48
|
uploads: state.uploads.filter((u: any) => u.filename !== action.filename)
|
|
49
49
|
};
|
|
50
|
+
case assetUploadsActions.ERROR:
|
|
51
|
+
const newError = state.uploads.map((u: any) => {
|
|
52
|
+
if (u.filename === action.filename) {
|
|
53
|
+
return { ...u, error: action.errorMsg };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return u;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
...state,
|
|
61
|
+
uploads: newError
|
|
62
|
+
};
|
|
50
63
|
default:
|
|
51
64
|
return state;
|
|
52
65
|
}
|
package/src/services/API.ts
CHANGED
|
@@ -153,6 +153,9 @@ interface ITTSOptions {
|
|
|
153
153
|
voice: string;
|
|
154
154
|
service: string;
|
|
155
155
|
model?: string;
|
|
156
|
+
speed?: string;
|
|
157
|
+
pause_silences?: boolean;
|
|
158
|
+
minimum_silence_length?: number;
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
interface ICancelTokenCache {
|
|
@@ -1607,6 +1610,18 @@ export default class API {
|
|
|
1607
1610
|
url += `&model=${options.model}`;
|
|
1608
1611
|
}
|
|
1609
1612
|
|
|
1613
|
+
if (options.speed) {
|
|
1614
|
+
url += `&speed=${options.speed}`;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
if (options.pause_silences) {
|
|
1618
|
+
url += `&pause_silences=${options.pause_silences}`;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
if (options.minimum_silence_length) {
|
|
1622
|
+
url += `&minimum_silence_length=${options.minimum_silence_length}`;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1610
1625
|
return this.doRequest({
|
|
1611
1626
|
url,
|
|
1612
1627
|
method: 'GET',
|