@imposium-hub/components 2.5.10-13 → 2.5.10-15
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/app-wrapper/AppWrapper.js +5 -2
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableGlobalCell.js +1 -2
- package/dist/cjs/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableNameCell.js +2 -3
- package/dist/cjs/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTypeIcon.js +0 -2
- package/dist/cjs/components/assets/AssetsTypeIcon.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.d.ts +1 -11
- package/dist/cjs/components/confirm-modal/ConfirmModal.js +89 -7
- package/dist/cjs/components/confirm-modal/ConfirmModal.js.map +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/components/tabs/Tabs.d.ts +1 -4
- package/dist/cjs/components/tabs/Tabs.stories.d.ts +1 -3
- package/dist/cjs/constants/icons.d.ts +0 -1
- package/dist/cjs/constants/icons.js +1 -3
- package/dist/cjs/constants/icons.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 +0 -1
- package/dist/cjs/redux/actions/asset-list.js.map +1 -1
- package/dist/cjs/redux/actions/asset-uploads.js +1 -23
- package/dist/cjs/redux/actions/asset-uploads.js.map +1 -1
- package/dist/cjs/redux/reducers/asset-uploads.js +0 -8
- package/dist/cjs/redux/reducers/asset-uploads.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/app-wrapper/AppWrapper.js +5 -2
- package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableGlobalCell.js +1 -2
- package/dist/esm/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableNameCell.js +2 -3
- package/dist/esm/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js +1 -3
- package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
- 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.d.ts +1 -11
- package/dist/esm/components/confirm-modal/ConfirmModal.js +41 -7
- package/dist/esm/components/confirm-modal/ConfirmModal.js.map +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/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/constants/icons.d.ts +0 -1
- package/dist/esm/constants/icons.js +0 -2
- package/dist/esm/constants/icons.js.map +1 -1
- 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 +0 -1
- package/dist/esm/redux/actions/asset-list.js.map +1 -1
- package/dist/esm/redux/actions/asset-uploads.js +1 -12
- package/dist/esm/redux/actions/asset-uploads.js.map +1 -1
- package/dist/esm/redux/reducers/asset-uploads.js +0 -11
- package/dist/esm/redux/reducers/asset-uploads.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/app-wrapper/AppWrapper.tsx +3 -4
- package/src/components/assets/AssetsTableGlobalCell.tsx +1 -11
- package/src/components/assets/AssetsTableNameCell.tsx +2 -11
- package/src/components/assets/AssetsTypeIcon.tsx +1 -4
- package/src/components/card/Card.tsx +13 -27
- package/src/components/confirm-modal/ConfirmModal.tsx +51 -8
- package/src/components/data-table/Paginator.tsx +93 -140
- package/src/components/smpte-field/SMPTEField.tsx +3 -8
- package/src/constants/icons.tsx +0 -3
- package/src/index.ts +0 -4
- package/src/redux/actions/asset-list.ts +0 -1
- package/src/redux/actions/asset-uploads.ts +1 -11
- package/src/redux/reducers/asset-uploads.ts +0 -13
- 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
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
-
import { useHotkeys } from 'react-hotkeys-hook';
|
|
4
3
|
import Modal from '../modal/Modal';
|
|
5
4
|
import Button from '../button/Button';
|
|
6
5
|
import { confirm as copy } from '../../constants/copy';
|
|
@@ -16,29 +15,73 @@ interface IConfirmModalProps {
|
|
|
16
15
|
showCancel?: boolean;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
export const ConfirmModal = (
|
|
20
|
-
|
|
18
|
+
export const ConfirmModal = () => {
|
|
19
|
+
const [props, setProps] = useState<IConfirmModalProps>(null);
|
|
20
|
+
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
21
|
+
|
|
22
|
+
const onOpen = (event) => {
|
|
23
|
+
setProps({
|
|
24
|
+
...event.detail
|
|
25
|
+
});
|
|
26
|
+
setIsOpen(true);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const onClose = () => {
|
|
30
|
+
setIsOpen(false);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const onKeyDown = useCallback(
|
|
34
|
+
(e) => {
|
|
35
|
+
if (e.key === 'Enter') {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
props.onYes(e);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[isOpen]
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
window.addEventListener('openconfirmmodal', onOpen);
|
|
45
|
+
window.addEventListener('closeconfirmmodal', onClose);
|
|
46
|
+
return () => {
|
|
47
|
+
window.removeEventListener('openconfirmmodal', onOpen);
|
|
48
|
+
window.removeEventListener('closeconfirmmodal', onClose);
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (isOpen) {
|
|
54
|
+
document.addEventListener('keypress', onKeyDown);
|
|
55
|
+
} else {
|
|
56
|
+
document.removeEventListener('keypress', onKeyDown);
|
|
57
|
+
}
|
|
58
|
+
return () => {
|
|
59
|
+
document.removeEventListener('keypress', onKeyDown);
|
|
60
|
+
};
|
|
61
|
+
}, [isOpen, onKeyDown]);
|
|
21
62
|
|
|
22
63
|
const { cancel, yes, no } = copy;
|
|
23
64
|
const noLabel = props?.noLabel ? props.noLabel : no;
|
|
24
65
|
const yesLabel = props?.yesLabel ? props.yesLabel : yes;
|
|
25
66
|
|
|
26
|
-
const modal = (
|
|
67
|
+
const modal = isOpen && (
|
|
27
68
|
<Modal
|
|
28
|
-
onRequestClose={
|
|
69
|
+
onRequestClose={onClose}
|
|
29
70
|
wrapperStyle={{
|
|
30
71
|
left: '0px',
|
|
31
72
|
width: '100%'
|
|
32
73
|
}}
|
|
33
74
|
style={{
|
|
34
75
|
width: '400px',
|
|
35
|
-
height: '
|
|
76
|
+
height: '14%',
|
|
36
77
|
top: 'calc(50% - 150px)',
|
|
37
78
|
left: 'calc((100% - 400px) / 2)'
|
|
38
79
|
}}
|
|
39
80
|
isOpen={true}>
|
|
40
81
|
<Section>
|
|
41
|
-
<div
|
|
82
|
+
<div
|
|
83
|
+
className='confirm-modal'
|
|
84
|
+
onKeyDown={(e) => console.log('onKeyDown', e)}>
|
|
42
85
|
<p>{props.title}</p>
|
|
43
86
|
<div className='confirm-buttons'>
|
|
44
87
|
{props.showCancel ? (
|
|
@@ -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/constants/icons.tsx
CHANGED
|
@@ -74,7 +74,6 @@ 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';
|
|
78
77
|
|
|
79
78
|
export const ICON_VIDEO = <FontAwesomeIcon icon={faVideo} />;
|
|
80
79
|
|
|
@@ -221,5 +220,3 @@ export const ICON_CODE = <FontAwesomeIcon icon={faCode} />;
|
|
|
221
220
|
export const ICON_UP_RIGHT_FROM_SQUARE = <FontAwesomeIcon icon={faUpRightFromSquare} />;
|
|
222
221
|
|
|
223
222
|
export const ICON_FILE_UPLOAD = <FontAwesomeIcon icon={faCloudArrowUp} />;
|
|
224
|
-
|
|
225
|
-
export const ICON_FILE_ERROR = <FontAwesomeIcon icon={faCircleExclamation} />;
|
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,
|
|
@@ -7,8 +7,7 @@ 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'
|
|
11
|
-
ERROR: 'assetUploads/ERROR'
|
|
10
|
+
REMOVE_UPLOAD: 'assetUploads/REMOVE_UPLOAD'
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
const POLL_INTERVAL: number = 5000;
|
|
@@ -242,15 +241,6 @@ const uploadAssetHandler = (api: IImposiumAPI, dispatch, getStore) => {
|
|
|
242
241
|
if (axios.isCancel(e) && currentQueue !== queueLength - 1) {
|
|
243
242
|
currentQueue = currentQueue + 1;
|
|
244
243
|
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);
|
|
254
244
|
}
|
|
255
245
|
});
|
|
256
246
|
}
|
|
@@ -47,19 +47,6 @@ 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
|
-
};
|
|
63
50
|
default:
|
|
64
51
|
return state;
|
|
65
52
|
}
|
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;
|