@capillarytech/creatives-library 7.9.19 → 7.9.20
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/package.json
CHANGED
|
@@ -18,7 +18,6 @@ import CapNotification from '@capillarytech/cap-ui-library/CapNotification';
|
|
|
18
18
|
import Papa from 'papaparse';
|
|
19
19
|
import cloneDeep from 'lodash/cloneDeep';
|
|
20
20
|
import {
|
|
21
|
-
CAP_SPACE_12,
|
|
22
21
|
CAP_SPACE_16,
|
|
23
22
|
CAP_SPACE_24,
|
|
24
23
|
CAP_SPACE_32,
|
|
@@ -48,7 +47,13 @@ import messages from './messages';
|
|
|
48
47
|
import withCreatives from '../../../hoc/withCreatives';
|
|
49
48
|
|
|
50
49
|
export const SmsTraiCreate = (props) => {
|
|
51
|
-
const {
|
|
50
|
+
const {
|
|
51
|
+
intl,
|
|
52
|
+
actions,
|
|
53
|
+
onCreateComplete,
|
|
54
|
+
isFullMode,
|
|
55
|
+
onShowTemplates,
|
|
56
|
+
} = props;
|
|
52
57
|
const { formatMessage } = intl;
|
|
53
58
|
const [files, setFiles] = useState([]);
|
|
54
59
|
const [errorText, setErrorText] = useState('');
|
|
@@ -361,9 +366,7 @@ export const SmsTraiCreate = (props) => {
|
|
|
361
366
|
tempArray.push(fileData[row]);
|
|
362
367
|
}
|
|
363
368
|
}
|
|
364
|
-
tempArray = tempArray.map((row) =>
|
|
365
|
-
return row.map((cell) => cell.replace(',', ' '));
|
|
366
|
-
});
|
|
369
|
+
tempArray = tempArray.map((row) => row.map((cell) => cell.replace(',', ' ')));
|
|
367
370
|
csvContent = tempArray
|
|
368
371
|
.map((e) => e.join(','))
|
|
369
372
|
.map((e) => e.replace(/(\r\n|\n|\r)/gm, ' '))
|
|
@@ -453,7 +456,11 @@ export const SmsTraiCreate = (props) => {
|
|
|
453
456
|
{ templates: savedData },
|
|
454
457
|
(resp, errorMessage) => {
|
|
455
458
|
createCallback({ errorMessage });
|
|
456
|
-
|
|
459
|
+
if (isFullMode) {
|
|
460
|
+
onCreateComplete();
|
|
461
|
+
} else {
|
|
462
|
+
onShowTemplates();
|
|
463
|
+
}
|
|
457
464
|
},
|
|
458
465
|
);
|
|
459
466
|
};
|
|
@@ -531,7 +538,7 @@ export const SmsTraiCreate = (props) => {
|
|
|
531
538
|
{previewFileIndex !== null && (
|
|
532
539
|
<>
|
|
533
540
|
<CapRow span={24} className="upload-type-group-create-container">
|
|
534
|
-
|
|
541
|
+
<>
|
|
535
542
|
<CapDivider
|
|
536
543
|
type="horizontal"
|
|
537
544
|
className="upload-file-preview-divider-1"
|
|
@@ -636,7 +643,7 @@ export const SmsTraiCreate = (props) => {
|
|
|
636
643
|
className="upload-file-preview-divider-2"
|
|
637
644
|
/>
|
|
638
645
|
{errorText && <CapError>{errorText}</CapError>}
|
|
639
|
-
|
|
646
|
+
</>
|
|
640
647
|
</CapRow>
|
|
641
648
|
</>
|
|
642
649
|
)}
|
|
@@ -28,6 +28,7 @@ const SmsWrapper = (props) => {
|
|
|
28
28
|
onCreateComplete,
|
|
29
29
|
handleClose,
|
|
30
30
|
smsRegister,
|
|
31
|
+
onShowTemplates,
|
|
31
32
|
} = props;
|
|
32
33
|
|
|
33
34
|
const smsProps = {
|
|
@@ -50,7 +51,9 @@ const SmsWrapper = (props) => {
|
|
|
50
51
|
isCreateSms && (isTraiDlt ?
|
|
51
52
|
<SmsTraiCreate
|
|
52
53
|
isComponent
|
|
53
|
-
{...smsProps}
|
|
54
|
+
{...smsProps}
|
|
55
|
+
onShowTemplates={onShowTemplates}
|
|
56
|
+
/> :
|
|
54
57
|
<SmsCreate
|
|
55
58
|
isComponent {
|
|
56
59
|
...smsProps
|