@imposium-hub/components 2.5.10-12 → 2.5.10-14
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 +1 -2
- package/dist/cjs/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/cjs/components/card/Card.d.ts +0 -1
- package/dist/cjs/components/card/Card.js +4 -17
- package/dist/cjs/components/card/Card.js.map +1 -1
- package/dist/cjs/components/confirm-modal/ConfirmModal.js +1 -1
- package/dist/cjs/components/data-table/Paginator.js +7 -51
- package/dist/cjs/components/data-table/Paginator.js.map +1 -1
- package/dist/cjs/components/smpte-field/SMPTEField.d.ts +1 -2
- package/dist/cjs/components/smpte-field/SMPTEField.js +3 -9
- package/dist/cjs/components/smpte-field/SMPTEField.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -3
- package/dist/cjs/index.js +2 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/redux/actions/asset-list.js +42 -34
- package/dist/cjs/redux/actions/asset-list.js.map +1 -1
- package/dist/cjs/services/API.d.ts +0 -3
- package/dist/cjs/services/API.js +0 -9
- package/dist/cjs/services/API.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableDateCell.d.ts +1 -6
- package/dist/esm/components/assets/AssetsTableGlobalCell.d.ts +1 -5
- package/dist/esm/components/assets/AssetsTableGlobalCell.js +1 -2
- package/dist/esm/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTablePreviewCell.d.ts +1 -16
- package/dist/esm/components/assets/AssetsTableStatusCell.d.ts +1 -5
- package/dist/esm/components/assets/AssetsTableTagsCell.d.ts +1 -6
- package/dist/esm/components/assets/AssetsTableTypeCell.d.ts +1 -5
- package/dist/esm/components/assets/AssetsTypeIcon.d.ts +1 -5
- package/dist/esm/components/card/Card.d.ts +0 -1
- package/dist/esm/components/card/Card.js +4 -16
- package/dist/esm/components/card/Card.js.map +1 -1
- package/dist/esm/components/confirm-modal/ConfirmModal.js +1 -1
- package/dist/esm/components/data-table/Paginator.js +44 -74
- package/dist/esm/components/data-table/Paginator.js.map +1 -1
- package/dist/esm/components/determinate-loader/DeterminateLoader.stories.d.ts +0 -1
- package/dist/esm/components/shortcut-menu/ShortcutMenu.stories.d.ts +0 -1
- package/dist/esm/components/smpte-field/SMPTEField.d.ts +1 -2
- package/dist/esm/components/smpte-field/SMPTEField.js +3 -9
- package/dist/esm/components/smpte-field/SMPTEField.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.d.ts +1 -4
- package/dist/esm/components/tabs/Tabs.stories.d.ts +1 -4
- package/dist/esm/components/tag/Tag.d.ts +1 -9
- package/dist/esm/index.d.ts +1 -3
- package/dist/esm/index.js +1 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/redux/actions/asset-list.js +42 -34
- package/dist/esm/redux/actions/asset-list.js.map +1 -1
- package/dist/esm/services/API.d.ts +0 -3
- package/dist/esm/services/API.js +0 -9
- package/dist/esm/services/API.js.map +1 -1
- package/dist/styles.css +2 -13
- package/dist/styles.less +3 -16
- package/less/components/data-table.less +0 -4
- package/less/components/form-field.less +3 -7
- package/less/components/tag.less +0 -5
- package/package.json +1 -1
- package/src/components/assets/AssetsTableGlobalCell.tsx +1 -11
- package/src/components/card/Card.tsx +13 -27
- package/src/components/confirm-modal/ConfirmModal.tsx +1 -1
- package/src/components/data-table/Paginator.tsx +93 -140
- package/src/components/smpte-field/SMPTEField.tsx +3 -8
- package/src/index.ts +0 -4
- package/src/redux/actions/asset-list.ts +44 -37
- package/src/services/API.ts +0 -15
- package/src/components/assets/AssetsTableAssetIdCell.tsx +0 -65
- package/src/components/assets/AssetsTableAssetIdFilter.tsx +0 -40
|
@@ -11,7 +11,6 @@ interface ICardProps {
|
|
|
11
11
|
onOpen?: (e: any) => any;
|
|
12
12
|
onClose?: (e: any) => any;
|
|
13
13
|
onToggle?: (toggle: boolean) => any;
|
|
14
|
-
buttons?: any[];
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
interface ICardState {
|
|
@@ -98,7 +97,9 @@ class Card extends React.PureComponent<ICardProps, ICardState> {
|
|
|
98
97
|
|
|
99
98
|
return (
|
|
100
99
|
<div className={`card ${openClass} ${collapsableClass} ${styleClass}`}>
|
|
101
|
-
<div
|
|
100
|
+
<div
|
|
101
|
+
className='card-header'
|
|
102
|
+
onClick={this.evtHandlers.toggleOpen}>
|
|
102
103
|
{this.renderTitle(styleClass)}
|
|
103
104
|
{this.renderButtons()}
|
|
104
105
|
</div>
|
|
@@ -108,36 +109,21 @@ class Card extends React.PureComponent<ICardProps, ICardState> {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
public renderButtons() {
|
|
111
|
-
const { collapsable
|
|
112
|
+
const { collapsable } = this.props;
|
|
112
113
|
const { open } = this.state;
|
|
113
114
|
const buttonIcon = open ? ICON_CARET_UP : ICON_CARET_DOWN;
|
|
114
115
|
|
|
115
|
-
let buttonArray: JSX.Element[];
|
|
116
|
-
|
|
117
|
-
const toggleBtn = (
|
|
118
|
-
<Button
|
|
119
|
-
key='toggleOpen'
|
|
120
|
-
style='subtle'
|
|
121
|
-
onClick={(e) => this.toggleOpen(e)}>
|
|
122
|
-
{buttonIcon}
|
|
123
|
-
</Button>
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
if (buttons && buttons.length > 0) {
|
|
127
|
-
buttonArray = buttons.map((button) => {
|
|
128
|
-
return button;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
116
|
if (collapsable) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
117
|
+
return (
|
|
118
|
+
<div className='header-buttons'>
|
|
119
|
+
<Button
|
|
120
|
+
style='subtle'
|
|
121
|
+
onClick={this.evtHandlers.toggleOpen}>
|
|
122
|
+
{buttonIcon}
|
|
123
|
+
</Button>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
138
126
|
}
|
|
139
|
-
|
|
140
|
-
return <div className='header-buttons'>{buttonArray}</div>;
|
|
141
127
|
}
|
|
142
128
|
}
|
|
143
129
|
|
|
@@ -26,149 +26,102 @@ 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
|
+
<section className='ip-table-pagination'>
|
|
31
|
+
<span>
|
|
32
|
+
<Button
|
|
33
|
+
style='subtle'
|
|
34
|
+
size='small'
|
|
35
|
+
tooltip='Go to first page'
|
|
36
|
+
disabled={!canPreviousPage}
|
|
37
|
+
onClick={() => gotoPage(1, pageSize)}>
|
|
38
|
+
{ICON_ANGLE_DOUBLE_LEFT}
|
|
39
|
+
</Button>
|
|
40
|
+
<Button
|
|
41
|
+
style='subtle'
|
|
42
|
+
size='small'
|
|
43
|
+
tooltip='Go to previous page'
|
|
44
|
+
disabled={!canPreviousPage}
|
|
45
|
+
onClick={() => previousPage()}>
|
|
46
|
+
{ICON_ANGLE_LEFT}
|
|
47
|
+
</Button>
|
|
48
|
+
<Button
|
|
49
|
+
style='subtle'
|
|
50
|
+
size='small'
|
|
51
|
+
tooltip='Go to next page'
|
|
52
|
+
disabled={!canNextPage}
|
|
53
|
+
onClick={() => nextPage()}>
|
|
54
|
+
{ICON_ANGLE_RIGHT}
|
|
55
|
+
</Button>
|
|
56
|
+
<Button
|
|
57
|
+
style='subtle'
|
|
58
|
+
size='small'
|
|
59
|
+
tooltip='Go to last page'
|
|
60
|
+
disabled={!canNextPage}
|
|
61
|
+
onClick={() => gotoPage(pageCount, pageSize)}>
|
|
62
|
+
{ICON_ANGLE_DOUBLE_RIGHT}
|
|
63
|
+
</Button>
|
|
64
|
+
|
|
65
65
|
<span>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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>
|
|
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>
|
|
66
|
+
{copy.table.page}
|
|
67
|
+
<strong>
|
|
68
|
+
{pageIndex} of {pageCount}
|
|
69
|
+
</strong>
|
|
136
70
|
|
|
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>
|
|
165
71
|
</span>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
+
/>
|
|
169
96
|
</span>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
};
|
|
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
|
+
|
|
121
|
+
<span className='total-assets'>
|
|
122
|
+
{copy.table.total} <strong>{totalItems || 0}</strong>
|
|
123
|
+
</span>
|
|
124
|
+
</section>
|
|
125
|
+
);
|
|
173
126
|
|
|
174
127
|
export default Paginator;
|
|
@@ -12,7 +12,6 @@ interface ISMPTEFieldProps {
|
|
|
12
12
|
width?: string | number;
|
|
13
13
|
onChange?(e): void;
|
|
14
14
|
onBlur?(e): void;
|
|
15
|
-
onError?(e): void;
|
|
16
15
|
info?: string;
|
|
17
16
|
labelPosition?: string;
|
|
18
17
|
labelWidth?: string | number;
|
|
@@ -76,7 +75,7 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
76
75
|
|
|
77
76
|
private onBlur(e?) {
|
|
78
77
|
const val = e ? e.target.value : this.inputRef.current.value;
|
|
79
|
-
const isValid = this.
|
|
78
|
+
const isValid = this.smptValidator(val);
|
|
80
79
|
|
|
81
80
|
if (e && e.key === 'Enter') {
|
|
82
81
|
this.setDuration(isValid, val);
|
|
@@ -89,12 +88,10 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
89
88
|
|
|
90
89
|
private onChange() {
|
|
91
90
|
const val = this.inputRef.current.value;
|
|
92
|
-
const isValid = this.
|
|
91
|
+
const isValid = this.smptValidator(val);
|
|
93
92
|
|
|
94
93
|
if (isValid) {
|
|
95
94
|
this.props.onChange(val);
|
|
96
|
-
} else {
|
|
97
|
-
this.props.onError(isValid);
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
97
|
|
|
@@ -104,13 +101,11 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
104
101
|
const smpte = getSMPTE(frameRate, val);
|
|
105
102
|
if (smpte && this.props.onBlur) {
|
|
106
103
|
this.props.onBlur(smpte);
|
|
107
|
-
} else {
|
|
108
|
-
this.props.onError(isValid);
|
|
109
104
|
}
|
|
110
105
|
}
|
|
111
106
|
}
|
|
112
107
|
|
|
113
|
-
private
|
|
108
|
+
private smptValidator(val) {
|
|
114
109
|
const isValidSMPTETimeCode = new RegExp(this.regex);
|
|
115
110
|
const isValid = isValidSMPTETimeCode.test(val);
|
|
116
111
|
const errorMsg = isValid ? null : TIMECODE.ERROR;
|
package/src/index.ts
CHANGED
|
@@ -40,7 +40,6 @@ 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';
|
|
44
43
|
import AssetsTableSelectCell from './components/assets/AssetsTableSelectCell';
|
|
45
44
|
import AssetsTableSelectFilter from './components/assets/AssetsTableSelectFilter';
|
|
46
45
|
import AssetsTableTagsCell from './components/assets/AssetsTableTagsCell';
|
|
@@ -160,7 +159,6 @@ import ContextMenuTrigger from './components/context-menu/ContextMenuTrigger';
|
|
|
160
159
|
import CopyPropIdButton from './components/copy-prop-id-button/CopyPropIdButton';
|
|
161
160
|
import Submenu from './components/context-menu/SubMenu';
|
|
162
161
|
import { ConfirmModal } from './components/confirm-modal/ConfirmModal';
|
|
163
|
-
import AssetsTableAssetIdCell from './components/assets/AssetsTableAssetIdCell';
|
|
164
162
|
|
|
165
163
|
export {
|
|
166
164
|
AppWrapper,
|
|
@@ -219,8 +217,6 @@ export {
|
|
|
219
217
|
AssetsTableGlobalCell,
|
|
220
218
|
AssetsTableStatusCell,
|
|
221
219
|
AssetsTableNameFilter,
|
|
222
|
-
AssetsTableAssetIdFilter,
|
|
223
|
-
AssetsTableAssetIdCell,
|
|
224
220
|
AssetsTableNameCell,
|
|
225
221
|
AssetsTableDurationCell,
|
|
226
222
|
AssetsTableRateCell,
|
|
@@ -78,19 +78,22 @@ 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
|
-
|
|
81
|
+
if (window.confirm(`Are you sure you want to delete ${ids.length} assets?`)) {
|
|
82
|
+
return new Promise<boolean>((resolve, reject) => {
|
|
83
|
+
dispatch(toggleLoading(true));
|
|
84
|
+
api.deleteAssets(ids)
|
|
85
|
+
.then(() => {
|
|
86
|
+
dispatch(getAssets(api, storyId));
|
|
87
|
+
resolve(true);
|
|
88
|
+
})
|
|
89
|
+
.catch((errors: Error[]) => {
|
|
90
|
+
dispatch(toggleLoading(false));
|
|
91
|
+
reject(false);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
} else {
|
|
95
|
+
return Promise.resolve(false);
|
|
96
|
+
}
|
|
94
97
|
};
|
|
95
98
|
};
|
|
96
99
|
|
|
@@ -191,18 +194,20 @@ export const deleteAssetTags = (api: IImposiumAPI, id: string): any => {
|
|
|
191
194
|
|
|
192
195
|
export const deleteAssetsTags = (api: IImposiumAPI, ids: string[], storyId: string): any => {
|
|
193
196
|
return (dispatch) => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
197
|
+
if (window.confirm(`Are you sure you want to remove all tags from ${ids.length} assets?`)) {
|
|
198
|
+
return new Promise<void>((resolve, reject) => {
|
|
199
|
+
dispatch(toggleLoading(true));
|
|
200
|
+
api.deleteAssetsTags(ids)
|
|
201
|
+
.then(() => {
|
|
202
|
+
dispatch(getAssets(api, storyId));
|
|
203
|
+
resolve();
|
|
204
|
+
})
|
|
205
|
+
.catch((errors: Error[]) => {
|
|
206
|
+
dispatch(toggleLoading(false));
|
|
207
|
+
reject();
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}
|
|
206
211
|
};
|
|
207
212
|
};
|
|
208
213
|
|
|
@@ -240,18 +245,20 @@ export const updateAssetStory = (api: IImposiumAPI, id: string, storyId: string)
|
|
|
240
245
|
|
|
241
246
|
export const decoupleAssets = (api: IImposiumAPI, ids: string[], storyId: string): any => {
|
|
242
247
|
return (dispatch) => {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
248
|
+
if (window.confirm(`Are you sure you want to decouple ${ids.length} assets?`)) {
|
|
249
|
+
return new Promise<void>((resolve, reject) => {
|
|
250
|
+
dispatch(toggleLoading(true));
|
|
251
|
+
api.decoupleAssets(ids)
|
|
252
|
+
.then(() => {
|
|
253
|
+
dispatch(getAssets(api, storyId));
|
|
254
|
+
resolve();
|
|
255
|
+
})
|
|
256
|
+
.catch((errors: Error[]) => {
|
|
257
|
+
dispatch(toggleLoading(false));
|
|
258
|
+
reject();
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
}
|
|
255
262
|
};
|
|
256
263
|
};
|
|
257
264
|
|
package/src/services/API.ts
CHANGED
|
@@ -153,9 +153,6 @@ 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;
|
|
159
156
|
}
|
|
160
157
|
|
|
161
158
|
interface ICancelTokenCache {
|
|
@@ -1610,18 +1607,6 @@ export default class API {
|
|
|
1610
1607
|
url += `&model=${options.model}`;
|
|
1611
1608
|
}
|
|
1612
1609
|
|
|
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
|
-
|
|
1625
1610
|
return this.doRequest({
|
|
1626
1611
|
url,
|
|
1627
1612
|
method: 'GET',
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { copying } from '../../constants/copy';
|
|
3
|
-
import { updateFilters } from '../../redux/actions/asset-filters';
|
|
4
|
-
import { connect } from 'react-redux';
|
|
5
|
-
import { bindActionCreators } from 'redux';
|
|
6
|
-
|
|
7
|
-
interface IAssetsTableAssetIdCellProps {
|
|
8
|
-
cell: any;
|
|
9
|
-
onNotification?: (e) => void;
|
|
10
|
-
onError?: (e) => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const AssetsTableAssetIdCell: React.FC<IAssetsTableAssetIdCellProps> = (
|
|
14
|
-
props: IAssetsTableAssetIdCellProps
|
|
15
|
-
) => {
|
|
16
|
-
const {
|
|
17
|
-
onNotification,
|
|
18
|
-
onError,
|
|
19
|
-
cell: {
|
|
20
|
-
row: {
|
|
21
|
-
original: { id }
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
} = props;
|
|
25
|
-
console.log('AssetsTableAssetIdCell');
|
|
26
|
-
console.log(id);
|
|
27
|
-
|
|
28
|
-
const copyToClipboard = (e) => {
|
|
29
|
-
navigator.clipboard.writeText(e.target.textContent).then(
|
|
30
|
-
() => {
|
|
31
|
-
if (onNotification) {
|
|
32
|
-
onNotification(`${copying.copied}`);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
() => {
|
|
36
|
-
if (onError) {
|
|
37
|
-
onError(`${copying.error}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div
|
|
45
|
-
key={id}
|
|
46
|
-
className='imposium-asset-id'
|
|
47
|
-
onClick={(e) => copyToClipboard(e)}>
|
|
48
|
-
{id}
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const mapDispatchToProps = (dispatch): any => {
|
|
54
|
-
return bindActionCreators({ updateFilters }, dispatch);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const mapStateToProps = (state): any => {
|
|
58
|
-
return { assetFilters: state.assetFilters };
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const AssetsTableAssetIdCellMemoized = connect(
|
|
62
|
-
mapStateToProps,
|
|
63
|
-
mapDispatchToProps
|
|
64
|
-
)(React.memo(AssetsTableAssetIdCell));
|
|
65
|
-
export default AssetsTableAssetIdCellMemoized;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import TextField from '../text-field/TextField';
|
|
3
|
-
import { updateFilters } from '../../redux/actions/asset-filters';
|
|
4
|
-
import { connect } from 'react-redux';
|
|
5
|
-
import { bindActionCreators } from 'redux';
|
|
6
|
-
|
|
7
|
-
interface IAssetsTableAssetIdFilterProps {
|
|
8
|
-
assetFilters: any;
|
|
9
|
-
updateFilters: (filters: any) => any;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
class AssetsTableAssetIdFilter extends React.PureComponent<IAssetsTableAssetIdFilterProps> {
|
|
13
|
-
public render = (): JSX.Element => {
|
|
14
|
-
const { assetFilters } = this.props;
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<TextField
|
|
18
|
-
className='asset-id'
|
|
19
|
-
submittable
|
|
20
|
-
submittableType='search'
|
|
21
|
-
value={assetFilters.id}
|
|
22
|
-
doSubmit={(n) => this.props.updateFilters({ id: n })}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const mapDispatchToProps = (dispatch): any => {
|
|
29
|
-
return bindActionCreators({ updateFilters }, dispatch);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const mapStateToProps = (state): any => {
|
|
33
|
-
return { assetFilters: state.assetFilters };
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const AssetsTableAssetIdFilterMemoized = connect(
|
|
37
|
-
mapStateToProps,
|
|
38
|
-
mapDispatchToProps
|
|
39
|
-
)(React.memo(AssetsTableAssetIdFilter));
|
|
40
|
-
export default AssetsTableAssetIdFilterMemoized;
|