@capillarytech/creatives-library 6.13.9 → 6.14.1
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/app.js +2 -5
- package/config/app.js +2 -0
- package/containers/Templates/index.js +3 -0
- package/index.js +8 -8
- package/package.json +2 -2
- package/reducers.js +2 -3
- package/routes.js +1 -7
- package/services/api.js +7 -5
- package/utils/common.js +118 -0
- package/v2Components/FormBuilder/index.js +2 -4
- package/v2Components/TemplatePreview/_templatePreview.scss +2 -8
- package/v2Components/TemplatePreview/index.js +18 -104
- package/v2Containers/App/constants.js +2 -2
- package/v2Containers/CreativesContainer/SlideBoxContent.js +19 -66
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -0
- package/v2Containers/CreativesContainer/constants.js +2 -2
- package/v2Containers/CreativesContainer/index.js +12 -38
- package/v2Containers/FTP/_FTP.scss +92 -0
- package/v2Containers/FTP/actions.js +7 -0
- package/v2Containers/FTP/constants.js +3 -0
- package/v2Containers/FTP/index.js +517 -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/Templates/_templates.scss +0 -57
- package/v2Containers/Templates/actions.js +110 -117
- package/v2Containers/Templates/constants.js +0 -2
- package/v2Containers/Templates/index.js +6 -86
- package/v2Containers/Templates/messages.js +0 -4
- package/v2Containers/Templates/reducer.js +0 -2
- package/v2Containers/TemplatesV2/index.js +14 -9
- package/v2Containers/TemplatesV2/messages.js +4 -4
- package/v2Containers/WeChat/MapTemplates/index.js +1 -1
- package/assets/viber.png +0 -0
- package/utils/ignoredErrorMessages.js +0 -4
- package/v2Containers/Viber/_viber.scss +0 -3
- package/v2Containers/Viber/actions.js +0 -74
- package/v2Containers/Viber/constants.js +0 -30
- package/v2Containers/Viber/index.js +0 -707
- package/v2Containers/Viber/messages.js +0 -137
- package/v2Containers/Viber/reducer.js +0 -84
- package/v2Containers/Viber/sagas.js +0 -107
- package/v2Containers/Viber/selectors.js +0 -21
|
@@ -46,63 +46,6 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
.VIBER {
|
|
50
|
-
&.cap-custom-card{
|
|
51
|
-
height: 241px;
|
|
52
|
-
.ant-card-body {
|
|
53
|
-
padding:0px 24px 0px;
|
|
54
|
-
.button-content {
|
|
55
|
-
.ant-card-meta-description {
|
|
56
|
-
min-width: 108px;
|
|
57
|
-
max-width: 160px;
|
|
58
|
-
height: 24px;
|
|
59
|
-
padding: 1px 23px 2px 22px;
|
|
60
|
-
border-radius: 16px;
|
|
61
|
-
font-size: 14px;
|
|
62
|
-
font-weight: 500;
|
|
63
|
-
background-color:$CAP_PURPLE01;
|
|
64
|
-
color:$CAP_WHITE;
|
|
65
|
-
text-align:center;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
.truncate-text-viber{
|
|
69
|
-
.ant-card-meta-description{
|
|
70
|
-
display: -webkit-box;
|
|
71
|
-
-webkit-line-clamp: 9;
|
|
72
|
-
-webkit-box-orient: vertical;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
.truncate-text-with-button{
|
|
76
|
-
.ant-card-meta-description{
|
|
77
|
-
-webkit-line-clamp: 8;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
.truncate-text-with-image{
|
|
81
|
-
.ant-card-meta-description{
|
|
82
|
-
-webkit-line-clamp: 2;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.no-image .ant-card-meta {
|
|
89
|
-
.ant-card-meta-description {
|
|
90
|
-
word-wrap: break-word;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
&.carousel-img-section {
|
|
96
|
-
.ant-card-body {
|
|
97
|
-
padding: $CAP_SPACE_24 0;
|
|
98
|
-
}
|
|
99
|
-
.ant-card-meta {
|
|
100
|
-
padding: 0;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}
|
|
106
49
|
}
|
|
107
50
|
}
|
|
108
51
|
|
|
@@ -4,126 +4,119 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import * as types from './constants';
|
|
8
|
-
|
|
9
|
-
export function getAllTemplates(channel, queryParams) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function resetTemplate() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function resetAccount() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function deleteTemplate(channel, id) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function getUserList() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function getWeCrmAccounts(source) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function setWeChatAccount(weChatAccount) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function setLineAccount(lineAccount) {
|
|
7
|
+
import * as types from './constants';
|
|
8
|
+
|
|
9
|
+
export function getAllTemplates(channel, queryParams) {
|
|
10
|
+
console.log('get all templates action trigereed', channel, queryParams);
|
|
11
|
+
return {
|
|
12
|
+
type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function resetTemplate() {
|
|
17
|
+
return {
|
|
18
|
+
type: types.RESET_TEMPLATE,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function resetAccount() {
|
|
23
|
+
return {
|
|
24
|
+
type: types.RESET_ACCOUNT,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function deleteTemplate(channel, id) {
|
|
29
|
+
console.log('delete template action trigereed', channel, id);
|
|
30
|
+
return {
|
|
31
|
+
type: types.DELETE_TEMPLATE_REQUEST, channel, id,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getUserList() {
|
|
36
|
+
return {
|
|
37
|
+
type: types.GET_USER_LIST_REQUEST,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getWeCrmAccounts(source) {
|
|
42
|
+
return {
|
|
43
|
+
type: types.GET_WECRM_ACCOUNTS_REQUEST, source,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function setWeChatAccount(weChatAccount) {
|
|
48
|
+
console.log('setting wechat account', weChatAccount);
|
|
49
|
+
return {
|
|
50
|
+
type: types.SET_WECHAT_ACCOUNT,
|
|
51
|
+
weChatAccount,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function setLineAccount(lineAccount) {
|
|
56
56
|
return {
|
|
57
57
|
type: types.SET_LINE_ACCOUNT,
|
|
58
58
|
lineAccount,
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function resetTemplateStoreData() {
|
|
126
|
-
return {
|
|
127
|
-
type: types.CLEAR_TEMPLATE_STORE_DATA,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
62
|
+
export function handleHtmlUpload(selectedTemplate) {
|
|
63
|
+
return {
|
|
64
|
+
type: types.SET_SELECTED_LAYOUT,
|
|
65
|
+
selectedTemplate,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function handleZipUpload(selectedFile, successHandler, errorHandler) {
|
|
70
|
+
return {
|
|
71
|
+
type: types.SEND_ZIPPED_FILE_REQUEST,
|
|
72
|
+
selectedFile,
|
|
73
|
+
successHandler,
|
|
74
|
+
errorHandler,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function getDefaultBeeTemplates() {
|
|
79
|
+
return {
|
|
80
|
+
type: types.GET_DEAFULT_BEE_TEMPLATES_REQUEST,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function setEdmTemplate(template) {
|
|
85
|
+
return {
|
|
86
|
+
type: types.SET_EDM_TEMPLATE,
|
|
87
|
+
template,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export function setBEETemplate(template) {
|
|
91
|
+
return {
|
|
92
|
+
type: types.SET_BEE_TEMPLATE,
|
|
93
|
+
template,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function getTemplateDetails(id, channel) {
|
|
97
|
+
console.log('getting template', id, channel);
|
|
98
|
+
return {
|
|
99
|
+
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
100
|
+
id,
|
|
101
|
+
channel,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function resetTemplateData() {
|
|
106
|
+
return {
|
|
107
|
+
type: types.RESET_TEMPLATE_DATA,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function resetUploadData() {
|
|
112
|
+
console.log('clearing upload data');
|
|
113
|
+
return {
|
|
114
|
+
type: types.RESET_UPLOAD_DATA,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function resetTemplateStoreData() {
|
|
119
|
+
return {
|
|
120
|
+
type: types.CLEAR_TEMPLATE_STORE_DATA,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -43,8 +43,6 @@ export const RESET_UPLOAD_DATA = "app/v2Containers/Templates/RESET_UPLOAD_DATA";
|
|
|
43
43
|
export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPLATE_STORE_DATA";
|
|
44
44
|
|
|
45
45
|
export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
|
|
46
|
-
export const SET_VIBER_ACCOUNT = "app/v2Containers/Templates/SET_VIBER_ACCOUNT";
|
|
47
|
-
|
|
48
46
|
|
|
49
47
|
export const GET_DEAFULT_BEE_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_REQUEST';
|
|
50
48
|
export const GET_DEAFULT_BEE_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_SUCCESS';
|
|
@@ -30,7 +30,6 @@ import { makeSelectEbill as makeSelectCreateEbill } from '../Ebill/selectors';
|
|
|
30
30
|
import { makeSelectEmail as makeSelectCreateEmail } from '../Email/selectors';
|
|
31
31
|
import { makeSelectEdit } from '../Sms/Edit/selectors';
|
|
32
32
|
import { makeSelectLine } from '../Line/Container/selectors';
|
|
33
|
-
import { makeSelectViber } from '../Viber/selectors';
|
|
34
33
|
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
35
34
|
import messages from './messages';
|
|
36
35
|
import {checkUnicode} from '../../utils/smsCharCountV2';
|
|
@@ -41,8 +40,6 @@ import * as smsEditActions from '../Sms/Edit/actions';
|
|
|
41
40
|
import * as ebillActions from '../Ebill/actions';
|
|
42
41
|
import * as emailActions from '../Email/actions';
|
|
43
42
|
import * as lineActions from '../Line/Container/actions';
|
|
44
|
-
import * as viberActions from '../Viber/actions';
|
|
45
|
-
|
|
46
43
|
import CardGrid from '../../v2Components/CardGrid';
|
|
47
44
|
import config from '../../config/app';
|
|
48
45
|
import './_templates.scss';
|
|
@@ -53,13 +50,8 @@ import Pagination from '../../v2Components/Pagination';
|
|
|
53
50
|
import EmailPreview from '../../v2Components/EmailPreview';
|
|
54
51
|
import CreativesContainer from '../CreativesContainer';
|
|
55
52
|
import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
|
|
56
|
-
import {
|
|
57
|
-
|
|
58
|
-
CHANNEL_EDIT_TRACK_MAPPING,
|
|
59
|
-
VIBER as VIBER_CHANNEL,
|
|
60
|
-
} from '../App/constants';
|
|
61
|
-
import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE, VIBER } from '../CreativesContainer/constants';
|
|
62
|
-
|
|
53
|
+
import { CHANNEL_CREATE_TRACK_MAPPING, CHANNEL_EDIT_TRACK_MAPPING } from '../App/constants';
|
|
54
|
+
import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE } from '../CreativesContainer/constants';
|
|
63
55
|
import emailIllustration from '../Assets/images/emailIllustration.svg';
|
|
64
56
|
import smsIllustration from '../Assets/images/smsIllustration.svg';
|
|
65
57
|
import pushIllustration from '../Assets/images/pushIllustration.svg';
|
|
@@ -169,13 +161,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
169
161
|
case EBILL:
|
|
170
162
|
channel = 'Ebill';
|
|
171
163
|
break;
|
|
172
|
-
case VIBER:
|
|
173
|
-
channel = 'Viber';
|
|
174
|
-
if (!this.props.isFullMode) {
|
|
175
|
-
activeMode = ACCOUNT_SELECTION_MODE;
|
|
176
|
-
this.props.actions.getWeCrmAccounts(channel);
|
|
177
|
-
}
|
|
178
|
-
break;
|
|
179
164
|
case LINE:
|
|
180
165
|
channel = "Line";
|
|
181
166
|
if (!this.props.isFullMode) {
|
|
@@ -200,7 +185,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
200
185
|
if (this.props.location.query.type === 'embedded') {
|
|
201
186
|
this.props.actions.resetAccount();
|
|
202
187
|
}
|
|
203
|
-
if ((
|
|
188
|
+
if ((this.state.channel && (this.state.channel.toLowerCase() === 'line' || this.state.channel.toLowerCase() === 'sms' || this.state.channel.toLowerCase() === 'email' || this.state.channel.toLowerCase() === 'ebill')) || ((this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === 'mobilepush') && !isEmpty(this.props.Templates.selectedWeChatAccount))) {
|
|
204
189
|
const queryParams = {
|
|
205
190
|
// name: this.state.searchText,
|
|
206
191
|
// sortBy: this.state.sortBy,
|
|
@@ -260,16 +245,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
260
245
|
this.setState({defaultAccount: true});
|
|
261
246
|
nextProps.actions.getWeCrmAccounts(channel);
|
|
262
247
|
}
|
|
263
|
-
} else if (nextProps.route.name.toLowerCase() === VIBER_CHANNEL) {
|
|
264
|
-
channel = 'Viber';
|
|
265
|
-
if (!this.props.isFullMode) {
|
|
266
|
-
this.setState({defaultAccount: true});
|
|
267
|
-
nextProps.actions.getWeCrmAccounts(channel);
|
|
268
|
-
}
|
|
269
248
|
}
|
|
270
|
-
|
|
271
249
|
this.setState({ channel }, () => {
|
|
272
|
-
if (
|
|
250
|
+
if ((this.state.channel.toLowerCase() === 'line' || this.state.channel.toLowerCase() === 'sms' || this.state.channel.toLowerCase() === 'email' || this.state.channel.toLowerCase() === 'ebill') || (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount))) {
|
|
273
251
|
if (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount)) {
|
|
274
252
|
params.wecrmId = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_app_id;
|
|
275
253
|
params.wecrmToken = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_token;
|
|
@@ -290,20 +268,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
290
268
|
if ((this.state.channel || '').toLowerCase() === "mobilepush" && nextProps.Templates.selectedWeChatAccount) {
|
|
291
269
|
params.accountId = nextProps.Templates.selectedWeChatAccount.id;
|
|
292
270
|
}
|
|
293
|
-
if (this.state.channel.toLowerCase() === VIBER_CHANNEL && isEmpty(nextProps.Templates.selectedViberAccount)) {
|
|
294
|
-
let selectedAccount = '';
|
|
295
|
-
if (isEmpty(nextProps.Templates.weCrmAccounts)) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
selectedAccount = nextProps.Templates.weCrmAccounts[0];
|
|
299
|
-
this.setState({selectedAccount: selectedAccount.name}, () => {
|
|
300
|
-
params.wecrmId = selectedAccount.configs.wecrm_app_id;
|
|
301
|
-
params.wecrmToken = selectedAccount.configs.wecrm_token;
|
|
302
|
-
params.originalId = selectedAccount.sourceAccountIdentifier;
|
|
303
|
-
this.props.actions.setViberAccount(nextProps.Templates.weCrmAccounts[0]);
|
|
304
|
-
this.getAllTemplates({params});
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
271
|
if ((this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === 'mobilepush') && isEmpty(nextProps.Templates.selectedWeChatAccount) && (this.props.location.query.type === 'embedded') && !this.isEnabledInLibraryModule("showAccountSelection")) {
|
|
308
272
|
let selectedAccount = '';
|
|
309
273
|
if (isEmpty(nextProps.Templates.weCrmAccounts)) {
|
|
@@ -372,8 +336,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
372
336
|
this.props.ebillActions.clearCreateResponse();
|
|
373
337
|
} else if (this.state.channel.toLowerCase() === "line") {
|
|
374
338
|
this.props.lineActions.clearCreateResponse();
|
|
375
|
-
} else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
376
|
-
this.props.viberActions.clearCreateResponse();
|
|
377
339
|
}
|
|
378
340
|
}
|
|
379
341
|
}
|
|
@@ -470,7 +432,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
470
432
|
} else if (this.state.channel.toLowerCase() === 'line') {
|
|
471
433
|
this.props.actions.setLineAccount(this.props.Templates.weCrmAccounts.find((item) => item.name === this.state.selectedAccount));
|
|
472
434
|
}
|
|
473
|
-
|
|
474
435
|
this.setState({activeMode: TEMPLATES_MODE});
|
|
475
436
|
console.log("getAllTemplates params: ", params);
|
|
476
437
|
this.getAllTemplates({params, resetPage: true});
|
|
@@ -690,7 +651,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
690
651
|
<video height="279">
|
|
691
652
|
<source src={originalVideoContentUrl} type="video/mp4" />
|
|
692
653
|
</video>
|
|
693
|
-
)
|
|
654
|
+
)
|
|
694
655
|
}
|
|
695
656
|
if (carouselTemplate) {
|
|
696
657
|
const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
|
|
@@ -716,26 +677,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
716
677
|
}
|
|
717
678
|
break;
|
|
718
679
|
}
|
|
719
|
-
case VIBER: {
|
|
720
|
-
const {
|
|
721
|
-
content: {
|
|
722
|
-
viber: {
|
|
723
|
-
text = '',
|
|
724
|
-
imageURL = '',
|
|
725
|
-
buttonURL = '',
|
|
726
|
-
buttonText = '',
|
|
727
|
-
} = {},
|
|
728
|
-
} = {},
|
|
729
|
-
} = template.versions.base;
|
|
730
|
-
templateData.content = text;
|
|
731
|
-
if (imageURL) {
|
|
732
|
-
templateData.url = imageURL;
|
|
733
|
-
}
|
|
734
|
-
if (buttonURL && buttonText) {
|
|
735
|
-
templateData.buttonText = buttonText;
|
|
736
|
-
}
|
|
737
|
-
break;
|
|
738
|
-
}
|
|
739
680
|
default:
|
|
740
681
|
templateData.content = "";
|
|
741
682
|
}
|
|
@@ -1233,15 +1174,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1233
1174
|
this.props.lineActions.clearCreateResponse();
|
|
1234
1175
|
}
|
|
1235
1176
|
});
|
|
1236
|
-
} else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
1237
|
-
this.props.viberActions.createTemplate(duplicateObj, (response) => {
|
|
1238
|
-
if (response && response.templateId) {
|
|
1239
|
-
const message = `${this.state.channel} ${this.props.intl.formatMessage(messages.templateDuplicateSuccess)}`;
|
|
1240
|
-
CapNotification.success({key: 'duplicateSucess', message});
|
|
1241
|
-
this.getAllTemplates({params, resetPage: true});
|
|
1242
|
-
this.props.viberActions.clearCreateResponse();
|
|
1243
|
-
}
|
|
1244
|
-
});
|
|
1245
1177
|
}
|
|
1246
1178
|
}
|
|
1247
1179
|
|
|
@@ -1323,9 +1255,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1323
1255
|
pathName += `/${options.account}`;
|
|
1324
1256
|
}
|
|
1325
1257
|
}
|
|
1326
|
-
if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
1327
|
-
pathName = `/viber/edit/${id}/`;
|
|
1328
|
-
}
|
|
1329
1258
|
if (this.state.channel.toUpperCase() === WECHAT) {
|
|
1330
1259
|
if (get(template, 'definition.msgcontent', '') === "RICH_MEDIA_WECHAT") {
|
|
1331
1260
|
pathName = `/wechat/richmedia/edit/${id}`;
|
|
@@ -1624,7 +1553,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1624
1553
|
} = Templates;
|
|
1625
1554
|
const lineLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'line');
|
|
1626
1555
|
const smsLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'sms');
|
|
1627
|
-
const viberLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === VIBER_CHANNEL);
|
|
1628
1556
|
const wechatLoader = (((this.state.selectedAccount !== '' && getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'wechat');
|
|
1629
1557
|
const mobilePushLoader = (((getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
|
|
1630
1558
|
const emailLoader = (
|
|
@@ -1638,8 +1566,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1638
1566
|
(emailLoader !== undefined ? emailLoader : false) ||
|
|
1639
1567
|
(ebillLoader !== undefined ? ebillLoader : false) ||
|
|
1640
1568
|
(mobilePushLoader !== undefined ? mobilePushLoader : false) ||
|
|
1641
|
-
(lineLoader !== undefined ? lineLoader : false)
|
|
1642
|
-
(viberLoader !== undefined ? viberLoader : false);
|
|
1569
|
+
(lineLoader !== undefined ? lineLoader : false);
|
|
1643
1570
|
return isLoading;
|
|
1644
1571
|
}
|
|
1645
1572
|
getChannelTypeIllustrationInfo = (type) => {
|
|
@@ -1779,10 +1706,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1779
1706
|
noAccountHeader = messages.noAccountsPresentLine;
|
|
1780
1707
|
break;
|
|
1781
1708
|
}
|
|
1782
|
-
case VIBER: {
|
|
1783
|
-
noAccountHeader = messages.noAccountsPresentViber;
|
|
1784
|
-
break;
|
|
1785
|
-
}
|
|
1786
1709
|
default:
|
|
1787
1710
|
break;
|
|
1788
1711
|
}
|
|
@@ -2054,7 +1977,6 @@ Templates.propTypes = {
|
|
|
2054
1977
|
isFullMode: PropTypes.bool,
|
|
2055
1978
|
handlePeviewTemplate: PropTypes.func,
|
|
2056
1979
|
router: PropTypes.object,
|
|
2057
|
-
viberActions: PropTypes.object,
|
|
2058
1980
|
};
|
|
2059
1981
|
|
|
2060
1982
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -2067,7 +1989,6 @@ const mapStateToProps = createStructuredSelector({
|
|
|
2067
1989
|
EmailCreate: makeSelectCreateEmail(),
|
|
2068
1990
|
Global: makeSelectAuthenticated(),
|
|
2069
1991
|
Line: makeSelectLine(),
|
|
2070
|
-
Viber: makeSelectViber(),
|
|
2071
1992
|
});
|
|
2072
1993
|
|
|
2073
1994
|
function mapDispatchToProps(dispatch) {
|
|
@@ -2080,7 +2001,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
2080
2001
|
emailActions: bindActionCreators(emailActions, dispatch),
|
|
2081
2002
|
globalActions: bindActionCreators(globalActions, dispatch),
|
|
2082
2003
|
lineActions: bindActionCreators(lineActions, dispatch),
|
|
2083
|
-
viberActions: bindActionCreators(viberActions, dispatch),
|
|
2084
2004
|
};
|
|
2085
2005
|
}
|
|
2086
2006
|
|
|
@@ -366,8 +366,4 @@ export default defineMessages({
|
|
|
366
366
|
id: `${scope}.duplicatingTemplate`,
|
|
367
367
|
defaultMessage: 'Duplicating template...'
|
|
368
368
|
},
|
|
369
|
-
noAccountsPresentViber: {
|
|
370
|
-
id: `${scope}.noAccountsPresentViber`,
|
|
371
|
-
defaultMessage: "Viber accounts are not setup for your brand",
|
|
372
|
-
},
|
|
373
369
|
});
|
|
@@ -73,8 +73,6 @@ function templatesReducer(state = initialState, action) {
|
|
|
73
73
|
.set('selectedWeChatAccount', fromJS(action.weChatAccount));
|
|
74
74
|
case types.SET_LINE_ACCOUNT:
|
|
75
75
|
return state.set('selectedLineAccount', fromJS(action.lineAccount));
|
|
76
|
-
case types.SET_VIBER_ACCOUNT:
|
|
77
|
-
return state.set('selectedViberAccount', fromJS(action.viberAccount));
|
|
78
76
|
case types.RESET_ACCOUNT:
|
|
79
77
|
return state
|
|
80
78
|
.remove('selectedWeChatAccount')
|
|
@@ -22,8 +22,8 @@ import * as actions from './actions';
|
|
|
22
22
|
import Templates from '../Templates';
|
|
23
23
|
import CallTask from '../CallTask';
|
|
24
24
|
import Facebook from '../Facebook';
|
|
25
|
-
import Viber from '../Viber';
|
|
26
25
|
import Line from '../Line/Container';
|
|
26
|
+
import FTP from '../FTP';
|
|
27
27
|
import Gallery from '../Assets/Gallery';
|
|
28
28
|
import withStyles from '../../hoc/withStyles';
|
|
29
29
|
import styles, { CapTabStyle } from './TemplatesV2.style';
|
|
@@ -53,8 +53,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
53
53
|
//'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
|
|
54
54
|
mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
|
|
55
55
|
line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
|
|
56
|
-
viber: {content: <></>, tab: intl.formatMessage(messages.viber), key: 'viber'},
|
|
57
|
-
|
|
58
56
|
|
|
59
57
|
};
|
|
60
58
|
let filteredPanes = Object.keys(defaultPanes)
|
|
@@ -72,6 +70,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
72
70
|
if (!channelsToHide.includes('facebook')) {
|
|
73
71
|
filteredPanes.push({content: <div></div>, tab: intl.formatMessage(messages.facebook), key: 'facebook'});
|
|
74
72
|
}
|
|
73
|
+
if (!channelsToHide.includes('FTP')) {
|
|
74
|
+
filteredPanes.push({content: <></>, tab: intl.formatMessage(messages.FTP), key: 'ftp'});
|
|
75
|
+
defaultChannel = 'FTP';
|
|
76
|
+
}
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
filteredPanes = filteredPanes.map( (pane) => {
|
|
@@ -155,12 +157,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
155
157
|
/>
|
|
156
158
|
);
|
|
157
159
|
}
|
|
158
|
-
|
|
159
|
-
<Viber
|
|
160
|
-
{...this.props}
|
|
161
|
-
isCreateFlow
|
|
162
|
-
></Viber>
|
|
163
|
-
)
|
|
160
|
+
|
|
164
161
|
getLineComponent = () => (
|
|
165
162
|
<Line
|
|
166
163
|
{...this.props}
|
|
@@ -168,6 +165,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
168
165
|
/>
|
|
169
166
|
)
|
|
170
167
|
|
|
168
|
+
getFTPComponent = () => (
|
|
169
|
+
<FTP mode={this.props.FTPMode} {...this.props} />
|
|
170
|
+
);
|
|
171
|
+
|
|
171
172
|
getTemplatesComponent(channel) {
|
|
172
173
|
// const templates = this.props.Templates[`${channel}Templates`];
|
|
173
174
|
let query = {};
|
|
@@ -176,6 +177,9 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
176
177
|
if (channel === 'line') {
|
|
177
178
|
return this.getLineComponent();
|
|
178
179
|
}
|
|
180
|
+
if (channel === 'ftp') {
|
|
181
|
+
return this.getFTPComponent();
|
|
182
|
+
}
|
|
179
183
|
}
|
|
180
184
|
const location = {pathname: `/${channel}`, search: '', query};
|
|
181
185
|
switch (channel) {
|
|
@@ -274,6 +278,7 @@ TemplatesV2.propTypes = {
|
|
|
274
278
|
messageDetails: PropTypes.object,
|
|
275
279
|
cap: PropTypes.object,
|
|
276
280
|
authData: PropTypes.object,
|
|
281
|
+
FTPMode: PropTypes.string,
|
|
277
282
|
};
|
|
278
283
|
|
|
279
284
|
TemplatesV2.defaultProps = {
|
|
@@ -34,6 +34,10 @@ export default defineMessages({
|
|
|
34
34
|
id: 'creatives.containersV2.TemplatesV2.email',
|
|
35
35
|
defaultMessage: 'Email',
|
|
36
36
|
},
|
|
37
|
+
FTP: {
|
|
38
|
+
id: 'creatives.containersV2.TemplatesV2.FTP',
|
|
39
|
+
defaultMessage: 'FTP',
|
|
40
|
+
},
|
|
37
41
|
pushNotification: {
|
|
38
42
|
id: 'creatives.containersV2.TemplatesV2.pushNotification',
|
|
39
43
|
defaultMessage: 'Push notification',
|
|
@@ -46,10 +50,6 @@ export default defineMessages({
|
|
|
46
50
|
id: 'creatives.containersV2.TemplatesV2.facebook',
|
|
47
51
|
defaultMessage: 'Facebook',
|
|
48
52
|
},
|
|
49
|
-
viber: {
|
|
50
|
-
id: 'creatives.containersV2.TemplatesV2.viber',
|
|
51
|
-
defaultMessage: 'Viber',
|
|
52
|
-
},
|
|
53
53
|
gallery: {
|
|
54
54
|
id: 'creatives.containersV2.TemplatesV2.gallery',
|
|
55
55
|
defaultMessage: 'Gallery',
|
|
@@ -876,7 +876,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
876
876
|
}
|
|
877
877
|
|
|
878
878
|
getMappedEvent(id, event) {
|
|
879
|
-
return
|
|
879
|
+
return this.state.map[id][event];
|
|
880
880
|
}
|
|
881
881
|
|
|
882
882
|
handleOnTagsContextChange = (data) => {
|
package/assets/viber.png
DELETED
|
Binary file
|