@capillarytech/creatives-library 7.0.8 → 7.1.3
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/config/app.js +2 -0
- package/index.js +7 -0
- package/package.json +1 -1
- package/reducers.js +2 -1
- package/services/api.js +7 -0
- package/utils/common.js +177 -0
- package/v2Components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/v2Components/TemplatePreview/index.js +3 -7
- package/v2Containers/App/constants.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +17 -1
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -0
- package/v2Containers/CreativesContainer/constants.js +2 -0
- package/v2Containers/CreativesContainer/index.js +12 -5
- package/v2Containers/FTP/_FTP.scss +103 -0
- package/v2Containers/FTP/actions.js +7 -0
- package/v2Containers/FTP/constants.js +3 -0
- package/v2Containers/FTP/index.js +501 -0
- package/v2Containers/FTP/messages.js +60 -0
- package/v2Containers/FTP/reducer.js +32 -0
- package/v2Containers/FTP/sagas.js +26 -0
- package/v2Containers/FTP/selectors.js +20 -0
- package/v2Containers/FTP/temp.js +11838 -0
- package/v2Containers/Templates/_templates.scss +2 -2
- package/v2Containers/TemplatesV2/index.js +13 -0
- package/v2Containers/TemplatesV2/messages.js +4 -0
- package/v2Containers/Viber/index.js +2 -3
- package/v2Containers/Viber/messages.js +0 -4
|
@@ -184,7 +184,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
184
184
|
"padding": '3.5px 0 0',
|
|
185
185
|
'border-radius': '8px',
|
|
186
186
|
'background-color': CAP_G15,
|
|
187
|
-
'width': '
|
|
187
|
+
'width': '79%',
|
|
188
188
|
};
|
|
189
189
|
const getVideoContent = ({
|
|
190
190
|
video,
|
|
@@ -614,17 +614,13 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
614
614
|
'background-color': CAP_PURPLE01,
|
|
615
615
|
"margin-top": '14px',
|
|
616
616
|
'text-align': 'center',
|
|
617
|
-
"width": '
|
|
617
|
+
"width": '132px',
|
|
618
618
|
"height": '20px',
|
|
619
|
-
"margin-left": "
|
|
619
|
+
"margin-left": "5px",
|
|
620
620
|
}}>
|
|
621
621
|
<p
|
|
622
622
|
style={{ 'font-size': '12px',
|
|
623
623
|
'font-weight': '500',
|
|
624
|
-
"display": '-webkit-box',
|
|
625
|
-
'-webkit-line-clamp': '1',
|
|
626
|
-
'-webkit-box-orient': 'vertical',
|
|
627
|
-
'overflow': 'hidden',
|
|
628
624
|
"color": CAP_WHITE }}
|
|
629
625
|
>
|
|
630
626
|
{buttonText || ''}</p>
|
|
@@ -19,6 +19,7 @@ import CallTask from '../CallTask';
|
|
|
19
19
|
import MobliPushEdit from '../MobilePush/Edit';
|
|
20
20
|
import * as constants from './constants';
|
|
21
21
|
import LineContainer from '../Line/Container';
|
|
22
|
+
import FTP from '../FTP';
|
|
22
23
|
import Viber from '../Viber';
|
|
23
24
|
const CreativesWrapper = styled.div`
|
|
24
25
|
.ant-popover,
|
|
@@ -134,6 +135,7 @@ function SlideBoxContent(props) {
|
|
|
134
135
|
selectedAccount,
|
|
135
136
|
onShowTemplates,
|
|
136
137
|
handleClose,
|
|
138
|
+
onFTPSubmit,
|
|
137
139
|
} = props;
|
|
138
140
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
139
141
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -173,6 +175,7 @@ function SlideBoxContent(props) {
|
|
|
173
175
|
let isEditCallTask = false;
|
|
174
176
|
let isEditMPush = false;
|
|
175
177
|
let isEditFacebook = false;
|
|
178
|
+
let isEditFTP = false;
|
|
176
179
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
|
|
177
180
|
if (templateData && channel) {
|
|
178
181
|
channel = templateData.type;// for edit mode with template data
|
|
@@ -185,6 +188,7 @@ function SlideBoxContent(props) {
|
|
|
185
188
|
isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE || channel === constants.VIBER);
|
|
186
189
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
187
190
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
191
|
+
isEditFTP = slidBoxContent === 'editTemplate' && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
|
|
188
192
|
}
|
|
189
193
|
|
|
190
194
|
const getChannelPreviewContent = (templateDataObject) => {
|
|
@@ -263,7 +267,6 @@ function SlideBoxContent(props) {
|
|
|
263
267
|
return get(templateDataObject, `versions.base.content`);
|
|
264
268
|
}
|
|
265
269
|
};
|
|
266
|
-
|
|
267
270
|
return (
|
|
268
271
|
<CreativesWrapper>
|
|
269
272
|
{!isFullMode && slidBoxContent === 'templates' && (
|
|
@@ -286,6 +289,10 @@ function SlideBoxContent(props) {
|
|
|
286
289
|
onCreateComplete={onCreateComplete}
|
|
287
290
|
getFormSubscriptionData={getFormData}
|
|
288
291
|
handleClose={handleClose}
|
|
292
|
+
onFTPSubmit={onFTPSubmit}
|
|
293
|
+
slidBoxContent={slidBoxContent}
|
|
294
|
+
FTPMode="create"
|
|
295
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
289
296
|
/>
|
|
290
297
|
)}
|
|
291
298
|
{isPreview && (
|
|
@@ -354,6 +361,14 @@ function SlideBoxContent(props) {
|
|
|
354
361
|
onTestContentClicked={onTestContentClicked}
|
|
355
362
|
/>
|
|
356
363
|
)}
|
|
364
|
+
{isEditFTP && (
|
|
365
|
+
<FTP
|
|
366
|
+
mode="edit"
|
|
367
|
+
onFTPSubmit={onFTPSubmit}
|
|
368
|
+
messageDetails={messageDetails}
|
|
369
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
370
|
+
/>
|
|
371
|
+
)}
|
|
357
372
|
{
|
|
358
373
|
isEditCallTask &&
|
|
359
374
|
<CallTask
|
|
@@ -608,5 +623,6 @@ SlideBoxContent.propTypes = {
|
|
|
608
623
|
onCreateComplete: PropTypes.func,
|
|
609
624
|
saveMessage: PropTypes.func,
|
|
610
625
|
selectedAccount: PropTypes.object,
|
|
626
|
+
onFTPSubmit: PropTypes.func,
|
|
611
627
|
};
|
|
612
628
|
export default SlideBoxContent;
|
|
@@ -13,6 +13,8 @@ export const CALL_TASK = "CALL_TASK";
|
|
|
13
13
|
export const MOBILE_PUSH = "MOBILEPUSH";
|
|
14
14
|
export const WECHAT = "WECHAT";
|
|
15
15
|
export const FACEBOOK = "FACEBOOK";
|
|
16
|
+
export const FTP = "FTP";
|
|
17
|
+
export const NO_COMMUNICATION = "NO_COMMUNICATION";
|
|
16
18
|
export const VIBER = "VIBER";
|
|
17
19
|
|
|
18
20
|
export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
|
|
@@ -142,6 +142,13 @@ class Creatives extends React.Component {
|
|
|
142
142
|
const {channel} = templateData;
|
|
143
143
|
let creativesTemplateData = {type: channel };
|
|
144
144
|
switch (channel) {
|
|
145
|
+
case constants.NO_COMMUNICATION: {
|
|
146
|
+
creativesTemplateData = {
|
|
147
|
+
type: channel,
|
|
148
|
+
...templateData,
|
|
149
|
+
};
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
145
152
|
case constants.SMS: {
|
|
146
153
|
const formData = {
|
|
147
154
|
"sms-editor": templateData.messageBody,
|
|
@@ -351,11 +358,10 @@ class Creatives extends React.Component {
|
|
|
351
358
|
break;
|
|
352
359
|
case constants.VIBER:
|
|
353
360
|
if (template.value) {
|
|
354
|
-
const { Templates
|
|
355
|
-
const { accountDetails: selectedAccountDetails, accountId: selectedAccountId } = templateDataProps || {};
|
|
361
|
+
const { Templates = {} } = this.props || {};
|
|
356
362
|
const selectedViberAccount = Templates && Templates.selectedViberAccount;
|
|
357
|
-
const accountDetails =
|
|
358
|
-
const accountId =
|
|
363
|
+
const accountDetails = selectedViberAccount ? JSON.stringify(selectedViberAccount) : '';
|
|
364
|
+
const accountId = selectedViberAccount ? selectedViberAccount.id : '';
|
|
359
365
|
const { versions } = template.value;
|
|
360
366
|
const content = cloneDeep(versions.base.content);
|
|
361
367
|
content.scenarioKey = get(accountDetails, 'configs.scenario_key');
|
|
@@ -641,6 +647,7 @@ class Creatives extends React.Component {
|
|
|
641
647
|
selectedAccount={this.props.selectedAccount}
|
|
642
648
|
onShowTemplates={this.onShowTemplates}
|
|
643
649
|
handleClose={this.handleCloseSlideBox}
|
|
650
|
+
onFTPSubmit={getCreativesData}
|
|
644
651
|
editor={editor}
|
|
645
652
|
/>
|
|
646
653
|
}
|
|
@@ -710,4 +717,4 @@ function mapDispatchToProps(dispatch) {
|
|
|
710
717
|
actions: bindActionCreators(actions, dispatch),
|
|
711
718
|
};
|
|
712
719
|
}
|
|
713
|
-
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
720
|
+
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
|
+
|
|
3
|
+
.selected-server-name{
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
margin-top: $CAP_SPACE_16;
|
|
7
|
+
.server-avtar, .server-name, .server-change{
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
.server-change{
|
|
11
|
+
margin-left: $CAP_SPACE_24;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
.select-server{
|
|
15
|
+
display: inline-block;
|
|
16
|
+
}
|
|
17
|
+
.configure-csv-container{
|
|
18
|
+
margin-top: $CAP_SPACE_32;
|
|
19
|
+
.configure-csv, .add-column{
|
|
20
|
+
display: inline-block;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
.column-selection-container{
|
|
24
|
+
width: 200px;
|
|
25
|
+
display: inline-block;
|
|
26
|
+
margin: $CAP_SPACE_04;
|
|
27
|
+
}
|
|
28
|
+
.column-selection-container-cid{
|
|
29
|
+
width: 120px;
|
|
30
|
+
display: inline-block;
|
|
31
|
+
}
|
|
32
|
+
.select-csv-column{
|
|
33
|
+
width: 80%;
|
|
34
|
+
border: 1px solid #d9d9d9 !important;
|
|
35
|
+
border-radius: 4px !important;
|
|
36
|
+
display: inline-block;
|
|
37
|
+
}
|
|
38
|
+
.select-csv-col-dropdown ul{
|
|
39
|
+
padding: 0 $CAP_SPACE_04;
|
|
40
|
+
}
|
|
41
|
+
.select-csv-col-dropdown ul li{
|
|
42
|
+
margin: $CAP_SPACE_08 0 !important;
|
|
43
|
+
padding: 0;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
list-style: none;
|
|
46
|
+
outline: 0;
|
|
47
|
+
}
|
|
48
|
+
.select-csv-col-dropdown {
|
|
49
|
+
.ant-select-tree-switcher-noop, .ant-select-tree-node-content-wrapper{
|
|
50
|
+
display: inline-block !important;
|
|
51
|
+
margin: 0 !important;
|
|
52
|
+
}
|
|
53
|
+
.ant-select-tree-child-tree-open {
|
|
54
|
+
display: block !important;
|
|
55
|
+
padding: 0 0 0 $CAP_SPACE_16 !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.remove-csv-column{
|
|
59
|
+
display: inline-block;
|
|
60
|
+
margin-left: $CAP_SPACE_08;
|
|
61
|
+
}
|
|
62
|
+
.scrollable-section{
|
|
63
|
+
height: calc(100vh - 220px);
|
|
64
|
+
overflow-y: auto;
|
|
65
|
+
}
|
|
66
|
+
.FTP-tagList {
|
|
67
|
+
position: absolute;
|
|
68
|
+
right: 0;
|
|
69
|
+
top: -10px;
|
|
70
|
+
}
|
|
71
|
+
.ftp-message-container{
|
|
72
|
+
margin-top: $CAP_SPACE_32;
|
|
73
|
+
.message-content-title{
|
|
74
|
+
margin-top: $CAP_SPACE_24;
|
|
75
|
+
position: relative;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ftp-preview-container{
|
|
80
|
+
.ftp-preview-message-title{
|
|
81
|
+
margin-top: $CAP_SPACE_16;
|
|
82
|
+
}
|
|
83
|
+
.ftp-preview-message-content{
|
|
84
|
+
max-width: 450px;
|
|
85
|
+
margin-top: 4px;
|
|
86
|
+
color: $FONT_COLOR_02;
|
|
87
|
+
}
|
|
88
|
+
.ftp-preview-data-title{
|
|
89
|
+
margin-top: $CAP_SPACE_40;
|
|
90
|
+
}
|
|
91
|
+
.ftp-preview-data-col-container{
|
|
92
|
+
margin-top: $CAP_SPACE_16;
|
|
93
|
+
.ant-tag.cap-tag-v2{
|
|
94
|
+
background-color: $CAP_WHITE;
|
|
95
|
+
font-weight: 500;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.manage-ftp-setting-div{
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: baseline;
|
|
103
|
+
}
|