@imposium-hub/components 2.9.0-12 → 2.9.0-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/Util.js +6 -0
- package/dist/cjs/Util.js.map +1 -1
- package/dist/cjs/components/app-wrapper/AppWrapper.js +1 -5
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/cjs/components/header/Header.js +1 -0
- package/dist/cjs/components/header/Header.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -3
- package/dist/cjs/index.js +3 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/redux/actions/publish.js +1 -1
- package/dist/cjs/redux/actions/publish.js.map +1 -1
- package/dist/cjs/services/API.d.ts +2 -2
- package/dist/cjs/services/API.js +7 -4
- package/dist/cjs/services/API.js.map +1 -1
- package/dist/cjs/utils/modal.d.ts +0 -3
- package/dist/cjs/utils/modal.js +1 -9
- package/dist/cjs/utils/modal.js.map +1 -1
- package/dist/esm/Util.js +6 -0
- package/dist/esm/Util.js.map +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js +1 -5
- package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/esm/components/header/Header.js +1 -0
- package/dist/esm/components/header/Header.js.map +1 -1
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/redux/actions/publish.js +1 -1
- package/dist/esm/redux/actions/publish.js.map +1 -1
- package/dist/esm/services/API.d.ts +2 -2
- package/dist/esm/services/API.js +7 -4
- package/dist/esm/services/API.js.map +1 -1
- package/dist/esm/utils/modal.d.ts +0 -3
- package/dist/esm/utils/modal.js +0 -7
- package/dist/esm/utils/modal.js.map +1 -1
- package/package.json +1 -1
- package/src/Util.ts +9 -0
- package/src/components/app-wrapper/AppWrapper.tsx +0 -4
- package/src/components/header/Header.tsx +1 -0
- package/src/index.ts +1 -5
- package/src/redux/actions/publish.ts +1 -1
- package/src/services/API.ts +11 -6
- package/src/utils/modal.ts +0 -10
- package/src/components/edit-guide-modal/EditGuideModal.tsx +0 -110
- package/src/components/replace-files-modal/ReplaceFilesModal.tsx +0 -217
package/src/Util.ts
CHANGED
|
@@ -53,7 +53,13 @@ export const checkStoryId = (storyId: string, orgId: string, access: any): any =
|
|
|
53
53
|
|
|
54
54
|
export const getLastModifiedStoryInOrg = (orgId: string, access: any): string => {
|
|
55
55
|
const activeOrg: any = getActiveOrg(orgId, access);
|
|
56
|
+
|
|
57
|
+
if (activeOrg.stories.length === 0) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
const sortByLastModified = activeOrg.stories.sort((a, b) => b.date_modified - a.date_modified);
|
|
62
|
+
|
|
57
63
|
if (sortByLastModified[0]) {
|
|
58
64
|
return sortByLastModified[0].id;
|
|
59
65
|
} else {
|
|
@@ -87,6 +93,9 @@ export const parameterizeServiceUrl = (
|
|
|
87
93
|
case 6:
|
|
88
94
|
case 8:
|
|
89
95
|
return `${url}/${activeOrg}/${activeStory}`;
|
|
96
|
+
case 11:
|
|
97
|
+
case 12:
|
|
98
|
+
return `${url}`;
|
|
90
99
|
default:
|
|
91
100
|
return `${url}/${activeOrg}`;
|
|
92
101
|
}
|
|
@@ -8,8 +8,6 @@ import { replaceRoute } from '../../utils/routing';
|
|
|
8
8
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
9
|
import { faExclamationTriangle } from '@fortawesome/pro-light-svg-icons';
|
|
10
10
|
import { initPendo } from '../../utils/pendo';
|
|
11
|
-
import { EditGuideModal } from '../edit-guide-modal/EditGuideModal';
|
|
12
|
-
import { ReplaceFilesModal } from '../replace-files-modal/ReplaceFilesModal';
|
|
13
11
|
|
|
14
12
|
export interface IAppWrapperProps {
|
|
15
13
|
appLabel: string;
|
|
@@ -287,8 +285,6 @@ export const AppWrapper: React.FC<IAppWrapperProps> = (props) => {
|
|
|
287
285
|
/>
|
|
288
286
|
{innerContent}
|
|
289
287
|
<ConfirmModal />
|
|
290
|
-
<EditGuideModal />
|
|
291
|
-
<ReplaceFilesModal />
|
|
292
288
|
</div>
|
|
293
289
|
);
|
|
294
290
|
};
|
|
@@ -211,6 +211,7 @@ class ImposiumHeader extends React.PureComponent<IHeaderProps, IHeaderState> {
|
|
|
211
211
|
api.cacheActiveStory(activeServiceId, orgId, storyId);
|
|
212
212
|
} else {
|
|
213
213
|
pushRoute(`/${orgId}`);
|
|
214
|
+
api.cacheActiveStory(activeServiceId, orgId);
|
|
214
215
|
}
|
|
215
216
|
})
|
|
216
217
|
.catch((e) => {
|
package/src/index.ts
CHANGED
|
@@ -161,8 +161,7 @@ import StoryTableNameFilter from './components/assets/StoryTableNameFilter';
|
|
|
161
161
|
import { AppWrapper } from './components/app-wrapper/AppWrapper';
|
|
162
162
|
import { pushRoute, replaceRoute } from './utils/routing';
|
|
163
163
|
import { ProjectDropdown } from './components/header/ProjectDropdown';
|
|
164
|
-
import {
|
|
165
|
-
import { openConfirmModal, openReplaceFilesModal } from './utils/modal';
|
|
164
|
+
import { openConfirmModal } from './utils/modal';
|
|
166
165
|
import { ConfirmModal, IConfirmModalProps } from './components/confirm-modal/ConfirmModal';
|
|
167
166
|
|
|
168
167
|
export {
|
|
@@ -260,7 +259,6 @@ export {
|
|
|
260
259
|
updateAssetData,
|
|
261
260
|
doAssetTableHydration,
|
|
262
261
|
uploadAssets,
|
|
263
|
-
openReplaceFilesModal,
|
|
264
262
|
replaceAsset,
|
|
265
263
|
selectAsset,
|
|
266
264
|
deselectAsset,
|
|
@@ -323,7 +321,5 @@ export {
|
|
|
323
321
|
CopyPropIdButton,
|
|
324
322
|
ConfirmModal,
|
|
325
323
|
IConfirmModalProps,
|
|
326
|
-
EditGuideModal,
|
|
327
|
-
IEditGuideModalProps,
|
|
328
324
|
openConfirmModal
|
|
329
325
|
};
|
|
@@ -45,7 +45,7 @@ export const getStoryPublishStatus = (api: IImposiumAPI, storyId: string): any =
|
|
|
45
45
|
})
|
|
46
46
|
.catch((e) => {
|
|
47
47
|
// 404 = no published version = using working copy
|
|
48
|
-
if (e?.response?.status !== 404) {
|
|
48
|
+
if (e?.response?.status !== 404 && e.error !== 'missing_refresh_token') {
|
|
49
49
|
console.error(e);
|
|
50
50
|
reject(copy.header.publishPollError);
|
|
51
51
|
}
|
package/src/services/API.ts
CHANGED
|
@@ -146,7 +146,7 @@ export interface IImposiumAPI {
|
|
|
146
146
|
getAssetMap(storyId: string);
|
|
147
147
|
clearStoryCache(storyId: string);
|
|
148
148
|
debugId(id: string);
|
|
149
|
-
cacheActiveStory(serviceId: any, orgId: string, storyId
|
|
149
|
+
cacheActiveStory(serviceId: any, orgId: string, storyId?: string);
|
|
150
150
|
getCachedStoryForOrg(serviceId: string, orgId: string);
|
|
151
151
|
getAccessData(includeTotalRenders?: boolean, orgId?: string);
|
|
152
152
|
deleteExperience(experienceId: string, eraseMedia?: boolean);
|
|
@@ -1655,16 +1655,21 @@ export default class API {
|
|
|
1655
1655
|
});
|
|
1656
1656
|
};
|
|
1657
1657
|
|
|
1658
|
-
public cacheActiveStory = (serviceId, orgId, storyId): Promise<any | Error> => {
|
|
1658
|
+
public cacheActiveStory = (serviceId, orgId, storyId?): Promise<any | Error> => {
|
|
1659
1659
|
const route = `/service/${serviceId}/${orgId}/active`;
|
|
1660
1660
|
|
|
1661
|
+
const data: any = {
|
|
1662
|
+
organization_id: orgId
|
|
1663
|
+
};
|
|
1664
|
+
|
|
1665
|
+
if (storyId) {
|
|
1666
|
+
data['story_id'] = storyId;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1661
1669
|
return this.doRequest({
|
|
1662
1670
|
method: 'POST',
|
|
1663
1671
|
url: route,
|
|
1664
|
-
data
|
|
1665
|
-
story_id: storyId,
|
|
1666
|
-
organization_id: orgId
|
|
1667
|
-
}
|
|
1672
|
+
data
|
|
1668
1673
|
});
|
|
1669
1674
|
};
|
|
1670
1675
|
|
package/src/utils/modal.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { IConfirmModalProps } from '../components/confirm-modal/ConfirmModal';
|
|
2
|
-
import { IReplaceFilesModalProps } from '../components/replace-files-modal/ReplaceFilesModal';
|
|
3
2
|
|
|
4
|
-
export const replaceFilesModalEvent = 'openreplacefilesmodal';
|
|
5
3
|
export const confirmModalEvent = 'openconfirmmodal';
|
|
6
4
|
|
|
7
5
|
export const openConfirmModal = (detail: IConfirmModalProps) => {
|
|
@@ -11,11 +9,3 @@ export const openConfirmModal = (detail: IConfirmModalProps) => {
|
|
|
11
9
|
|
|
12
10
|
window.dispatchEvent(event);
|
|
13
11
|
};
|
|
14
|
-
|
|
15
|
-
export const openReplaceFilesModal = (detail: IReplaceFilesModalProps) => {
|
|
16
|
-
const event = new CustomEvent(replaceFilesModalEvent, {
|
|
17
|
-
detail
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
window.dispatchEvent(event);
|
|
21
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import Modal from '../modal/Modal';
|
|
4
|
-
import Button from '../button/Button';
|
|
5
|
-
import Section from '../section/Section';
|
|
6
|
-
import NumberField from '../number-field/NumberField';
|
|
7
|
-
|
|
8
|
-
export interface IEditGuideModalProps {
|
|
9
|
-
guide: number;
|
|
10
|
-
onClose: () => any;
|
|
11
|
-
onContinue: (e) => any;
|
|
12
|
-
isHorizontal: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const EditGuideModal = () => {
|
|
16
|
-
const [props, setProps] = useState<IEditGuideModalProps>(null);
|
|
17
|
-
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
18
|
-
const [guide, setGuide] = useState<number>(null);
|
|
19
|
-
|
|
20
|
-
const onOpen = (event) => {
|
|
21
|
-
setProps({
|
|
22
|
-
...event.detail
|
|
23
|
-
});
|
|
24
|
-
setIsOpen(true);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const onClose = () => setIsOpen(false);
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
window.addEventListener('openeditguidemodal', onOpen);
|
|
31
|
-
return () => {
|
|
32
|
-
window.removeEventListener('openeditguidemodal', onOpen);
|
|
33
|
-
};
|
|
34
|
-
}, []);
|
|
35
|
-
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (props?.guide) {
|
|
38
|
-
setGuide(props.guide);
|
|
39
|
-
}
|
|
40
|
-
}, [props?.guide]);
|
|
41
|
-
|
|
42
|
-
const onKeyDown = (e) => {
|
|
43
|
-
if (e.key === 'Enter') {
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
onContinue(guide);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (isOpen) {
|
|
51
|
-
window.addEventListener('keypress', onKeyDown);
|
|
52
|
-
} else {
|
|
53
|
-
window.removeEventListener('keypress', onKeyDown);
|
|
54
|
-
}
|
|
55
|
-
return () => {
|
|
56
|
-
window.removeEventListener('keypress', onKeyDown);
|
|
57
|
-
};
|
|
58
|
-
}, [isOpen, onKeyDown]);
|
|
59
|
-
|
|
60
|
-
const onContinue = useCallback(
|
|
61
|
-
(e) => {
|
|
62
|
-
if (e) {
|
|
63
|
-
props.onContinue(e);
|
|
64
|
-
onClose();
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
[isOpen]
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const modal = isOpen && (
|
|
71
|
-
<Modal
|
|
72
|
-
onRequestClose={onClose}
|
|
73
|
-
style={{
|
|
74
|
-
width: '200px',
|
|
75
|
-
height: '110px',
|
|
76
|
-
top: '25%',
|
|
77
|
-
left: '55%'
|
|
78
|
-
}}
|
|
79
|
-
isOpen={true}>
|
|
80
|
-
<Section
|
|
81
|
-
title={`Edit ${props.isHorizontal ? 'Horizontal Guide' : 'Vertical Guide'}`}
|
|
82
|
-
style={{ padding: '10px' }}>
|
|
83
|
-
<NumberField
|
|
84
|
-
label={'Guide Position'}
|
|
85
|
-
labelPosition='top'
|
|
86
|
-
onChange={(e) => setGuide(Number(e))}
|
|
87
|
-
focusOnMount={true}
|
|
88
|
-
value={guide}
|
|
89
|
-
/>
|
|
90
|
-
<Button
|
|
91
|
-
onClick={onClose}
|
|
92
|
-
style='bold'
|
|
93
|
-
color='secondary'>
|
|
94
|
-
Cancel
|
|
95
|
-
</Button>
|
|
96
|
-
<Button
|
|
97
|
-
onClick={() => onContinue(guide)}
|
|
98
|
-
style='bold'
|
|
99
|
-
color='primary'>
|
|
100
|
-
Ok
|
|
101
|
-
</Button>
|
|
102
|
-
</Section>
|
|
103
|
-
</Modal>
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
const PortalContextComponent = () =>
|
|
107
|
-
ReactDOM.createPortal(modal, document.querySelector('#react-root'));
|
|
108
|
-
|
|
109
|
-
return <PortalContextComponent />;
|
|
110
|
-
};
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import Modal from '../modal/Modal';
|
|
4
|
-
import Button from '../button/Button';
|
|
5
|
-
import CheckboxField from '../checkbox-field/CheckboxField';
|
|
6
|
-
import Section from '../section/Section';
|
|
7
|
-
import { assets as copy } from '../../constants/copy';
|
|
8
|
-
import { replaceFilesModalEvent } from '../../utils/modal';
|
|
9
|
-
|
|
10
|
-
export interface IReplaceFilesModalProps {
|
|
11
|
-
onUpload: (f) => any;
|
|
12
|
-
onInstantUpload: (f) => any;
|
|
13
|
-
onApplyToAll: (e) => any;
|
|
14
|
-
onClose: () => void;
|
|
15
|
-
applyToAll: boolean;
|
|
16
|
-
existedAssets: any[];
|
|
17
|
-
existedAssetIds: any[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const ReplaceFilesModal = () => {
|
|
21
|
-
const [props, setProps] = useState<IReplaceFilesModalProps>(null);
|
|
22
|
-
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
23
|
-
const [applyToAll, setApplyToAll] = useState<boolean>();
|
|
24
|
-
const [height, setHeight] = useState(200);
|
|
25
|
-
const [index, setIndex] = useState<number>(0);
|
|
26
|
-
|
|
27
|
-
const replaceFileModalRef = useRef(null);
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (replaceFileModalRef.current) {
|
|
31
|
-
const {
|
|
32
|
-
current: { clientHeight }
|
|
33
|
-
} = replaceFileModalRef;
|
|
34
|
-
setHeight(clientHeight + 40);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const onOpen = (event) => {
|
|
39
|
-
setProps({
|
|
40
|
-
...event.detail
|
|
41
|
-
});
|
|
42
|
-
setIsOpen(true);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const onClose = () => {
|
|
46
|
-
props.onClose();
|
|
47
|
-
setIsOpen(false);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const onReplaceHandler = (curApplyToAll, curIndex, file, assetId) => {
|
|
51
|
-
const newIndex = curIndex + 1;
|
|
52
|
-
|
|
53
|
-
if (curApplyToAll && curIndex === 0) {
|
|
54
|
-
const updatedAssets = props.existedAssets.map((asset, i) => {
|
|
55
|
-
const updatefile = asset;
|
|
56
|
-
updatefile['assetId'] = props.existedAssetIds[i];
|
|
57
|
-
return updatefile;
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
props.onInstantUpload(updatedAssets);
|
|
61
|
-
setIndex(0);
|
|
62
|
-
setIsOpen(false);
|
|
63
|
-
} else if (curApplyToAll) {
|
|
64
|
-
const updatedAssets = [];
|
|
65
|
-
|
|
66
|
-
for (let i = 0; i < props.existedAssets.length; i++) {
|
|
67
|
-
const updateFile =
|
|
68
|
-
curIndex === 0
|
|
69
|
-
? props.existedAssets[i]
|
|
70
|
-
: [
|
|
71
|
-
...props.existedAssets.slice(0, curIndex - 1),
|
|
72
|
-
...props.existedAssets.slice(curIndex)
|
|
73
|
-
][i];
|
|
74
|
-
|
|
75
|
-
if (updateFile) {
|
|
76
|
-
updateFile['assetId'] =
|
|
77
|
-
curIndex === 0
|
|
78
|
-
? props.existedAssetIds[i]
|
|
79
|
-
: [
|
|
80
|
-
...props.existedAssetIds.slice(0, curIndex - 1),
|
|
81
|
-
...props.existedAssetIds.slice(curIndex)
|
|
82
|
-
][i];
|
|
83
|
-
updatedAssets.push(updateFile);
|
|
84
|
-
props.onInstantUpload(updatedAssets);
|
|
85
|
-
setIndex(0);
|
|
86
|
-
onClose();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
if (newIndex === props.existedAssets.length) {
|
|
91
|
-
setIndex(0);
|
|
92
|
-
onClose();
|
|
93
|
-
} else {
|
|
94
|
-
setIndex(newIndex);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const updateFile = file;
|
|
98
|
-
updateFile['assetId'] = assetId;
|
|
99
|
-
props.onUpload([updateFile]);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const onAsNewHandler = (curApplyToAll, curIndex, file) => {
|
|
104
|
-
const newIndex = curIndex + 1;
|
|
105
|
-
|
|
106
|
-
if (curApplyToAll) {
|
|
107
|
-
props.onUpload(
|
|
108
|
-
curIndex === 0 ? props.existedAssets : props.existedAssets.slice(curIndex)
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
setIndex(0);
|
|
112
|
-
onClose();
|
|
113
|
-
} else {
|
|
114
|
-
if (newIndex === props.existedAssets.length) {
|
|
115
|
-
setIndex(0);
|
|
116
|
-
onClose();
|
|
117
|
-
} else {
|
|
118
|
-
setIndex(newIndex);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
props.onUpload([file]);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const onApplyToAllHandler = (e) => {
|
|
126
|
-
setApplyToAll(e);
|
|
127
|
-
props.onApplyToAll(e);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const onReplace = useCallback(
|
|
131
|
-
(curApplyToAll, curIndex, file, assetId) =>
|
|
132
|
-
onReplaceHandler(curApplyToAll, curIndex, file, assetId),
|
|
133
|
-
[isOpen]
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
const onApplyToAll = useCallback((e) => onApplyToAllHandler(e), [isOpen]);
|
|
137
|
-
|
|
138
|
-
const onAsNew = useCallback(
|
|
139
|
-
(curApplyToAll, curIndex, file) => onAsNewHandler(curApplyToAll, curIndex, file),
|
|
140
|
-
[isOpen]
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
useEffect(() => {
|
|
144
|
-
window.addEventListener(replaceFilesModalEvent, onOpen);
|
|
145
|
-
return () => {
|
|
146
|
-
window.removeEventListener(replaceFilesModalEvent, onOpen);
|
|
147
|
-
};
|
|
148
|
-
}, []);
|
|
149
|
-
|
|
150
|
-
const modal = () => {
|
|
151
|
-
if (isOpen) {
|
|
152
|
-
const file = props.existedAssets[index];
|
|
153
|
-
const assetId = props.existedAssetIds[index];
|
|
154
|
-
const name = file.name.slice(0, file.name.lastIndexOf('.'));
|
|
155
|
-
return (
|
|
156
|
-
<Modal
|
|
157
|
-
onRequestClose={onClose}
|
|
158
|
-
wrapperStyle={{
|
|
159
|
-
left: '0px',
|
|
160
|
-
width: '100%'
|
|
161
|
-
}}
|
|
162
|
-
style={{
|
|
163
|
-
width: '400px',
|
|
164
|
-
height: `${height}px`,
|
|
165
|
-
top: 'calc(50% - 150px)',
|
|
166
|
-
left: 'calc((100% - 400px) / 2)'
|
|
167
|
-
}}
|
|
168
|
-
isOpen={true}>
|
|
169
|
-
<Section>
|
|
170
|
-
<div
|
|
171
|
-
className='replace-files-modal'
|
|
172
|
-
ref={replaceFileModalRef}>
|
|
173
|
-
<p>{copy.uploads.title.replace('[name]', name)}</p>
|
|
174
|
-
<div className='replace-files-buttons'>
|
|
175
|
-
<div className='checkbox'>
|
|
176
|
-
<CheckboxField
|
|
177
|
-
label={copy.uploads.applyAll}
|
|
178
|
-
value={applyToAll}
|
|
179
|
-
onChange={onApplyToAll}
|
|
180
|
-
/>
|
|
181
|
-
</div>
|
|
182
|
-
<div className='buttons'>
|
|
183
|
-
<Button
|
|
184
|
-
onClick={() => onAsNew(applyToAll, index, file)}
|
|
185
|
-
size='large'
|
|
186
|
-
style='bold'
|
|
187
|
-
color='primary'>
|
|
188
|
-
{copy.uploads.keepBoth}
|
|
189
|
-
</Button>
|
|
190
|
-
<Button
|
|
191
|
-
onClick={() => onReplace(applyToAll, index, file, assetId)}
|
|
192
|
-
size='large'
|
|
193
|
-
style='bold'
|
|
194
|
-
color='primary'>
|
|
195
|
-
{copy.uploads.replace}
|
|
196
|
-
</Button>
|
|
197
|
-
<Button
|
|
198
|
-
onClick={onClose}
|
|
199
|
-
size='large'
|
|
200
|
-
style='bold'
|
|
201
|
-
color='default'>
|
|
202
|
-
{copy.uploads.cancelButton}
|
|
203
|
-
</Button>
|
|
204
|
-
</div>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
</Section>
|
|
208
|
-
</Modal>
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const PortalContextComponent = () =>
|
|
214
|
-
ReactDOM.createPortal(modal(), document.querySelector('#react-root'));
|
|
215
|
-
|
|
216
|
-
return <PortalContextComponent />;
|
|
217
|
-
};
|