@capillarytech/creatives-library 7.1.6 → 7.1.10
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 +0 -2
- package/index.js +1 -15
- package/package.json +1 -2
- package/reducers.js +1 -4
- package/routes.js +1 -7
- package/services/api.js +0 -11
- package/utils/common.js +0 -178
- package/v2Components/TemplatePreview/_templatePreview.scss +2 -8
- package/v2Components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/v2Components/TemplatePreview/index.js +18 -108
- package/v2Containers/App/constants.js +3 -5
- package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -84
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +0 -2
- package/v2Containers/CreativesContainer/constants.js +0 -4
- package/v2Containers/CreativesContainer/index.js +5 -48
- package/v2Containers/Email/index.js +0 -1
- package/v2Containers/Line/Create/_lineCreate.scss +64 -0
- package/v2Containers/Line/Create/actions.js +94 -0
- package/v2Containers/Line/Create/constants.js +43 -0
- package/v2Containers/Line/Create/index.js +1132 -0
- package/v2Containers/Line/Create/initialSchema.js +378 -0
- package/v2Containers/Line/Create/messages.js +229 -0
- package/v2Containers/Line/Create/reducer.js +99 -0
- package/v2Containers/Line/Create/sagas.js +113 -0
- package/v2Containers/Line/Create/selectors.js +30 -0
- package/v2Containers/Line/CreateWrapper/constants.js +2 -0
- package/v2Containers/Line/CreateWrapper/index.js +117 -0
- package/v2Containers/Line/CreateWrapper/messages.js +55 -0
- package/v2Containers/Line/Edit/_lineEdit.scss +23 -0
- package/v2Containers/Line/Edit/actions.js +79 -0
- package/v2Containers/Line/Edit/constants.js +27 -0
- package/v2Containers/Line/Edit/index.js +1051 -0
- package/v2Containers/Line/Edit/messages.js +173 -0
- package/v2Containers/Line/Edit/reducer.js +83 -0
- package/v2Containers/Line/Edit/sagas.js +81 -0
- package/v2Containers/Line/Edit/selectors.js +29 -0
- package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
- package/v2Containers/Line/Edit/tests/index.test.js +10 -0
- package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
- package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
- package/v2Containers/Line/Edit/tests/selectors.test.js +10 -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 +7 -88
- package/v2Containers/Templates/messages.js +0 -4
- package/v2Containers/Templates/reducer.js +0 -2
- package/v2Containers/TemplatesV2/index.js +1 -22
- package/v2Containers/TemplatesV2/messages.js +0 -8
- package/assets/viber.png +0 -0
- package/v2Components/TemplatePreview/assets/images/viberMobile.svg +0 -135
- package/v2Containers/FTP/_FTP.scss +0 -103
- package/v2Containers/FTP/actions.js +0 -7
- package/v2Containers/FTP/constants.js +0 -3
- package/v2Containers/FTP/index.js +0 -534
- package/v2Containers/FTP/messages.js +0 -60
- package/v2Containers/FTP/reducer.js +0 -32
- package/v2Containers/FTP/sagas.js +0 -26
- package/v2Containers/FTP/selectors.js +0 -20
- package/v2Containers/Viber/actions.js +0 -74
- package/v2Containers/Viber/constants.js +0 -30
- package/v2Containers/Viber/index.js +0 -727
- package/v2Containers/Viber/messages.js +0 -145
- package/v2Containers/Viber/reducer.js +0 -84
- package/v2Containers/Viber/sagas.js +0 -107
- package/v2Containers/Viber/selectors.js +0 -21
|
@@ -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,11 +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
|
-
activeMode = ACCOUNT_SELECTION_MODE;
|
|
175
|
-
this.props.actions.getWeCrmAccounts(channel);
|
|
176
|
-
break;
|
|
177
164
|
case LINE:
|
|
178
165
|
channel = "Line";
|
|
179
166
|
if (!this.props.isFullMode) {
|
|
@@ -198,7 +185,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
198
185
|
if (this.props.location.query.type === 'embedded') {
|
|
199
186
|
this.props.actions.resetAccount();
|
|
200
187
|
}
|
|
201
|
-
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))) {
|
|
202
189
|
const queryParams = {
|
|
203
190
|
// name: this.state.searchText,
|
|
204
191
|
// sortBy: this.state.sortBy,
|
|
@@ -258,14 +245,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
258
245
|
this.setState({defaultAccount: true});
|
|
259
246
|
nextProps.actions.getWeCrmAccounts(channel);
|
|
260
247
|
}
|
|
261
|
-
} else if (nextProps.route.name.toLowerCase() === VIBER_CHANNEL) {
|
|
262
|
-
channel = 'Viber';
|
|
263
|
-
this.setState({defaultAccount: true});
|
|
264
|
-
nextProps.actions.getWeCrmAccounts(channel);
|
|
265
248
|
}
|
|
266
|
-
|
|
267
249
|
this.setState({ channel }, () => {
|
|
268
|
-
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))) {
|
|
269
251
|
if (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount)) {
|
|
270
252
|
params.wecrmId = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_app_id;
|
|
271
253
|
params.wecrmToken = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_token;
|
|
@@ -286,22 +268,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
286
268
|
if ((this.state.channel || '').toLowerCase() === "mobilepush" && nextProps.Templates.selectedWeChatAccount) {
|
|
287
269
|
params.accountId = nextProps.Templates.selectedWeChatAccount.id;
|
|
288
270
|
}
|
|
289
|
-
if (this.state.channel.toLowerCase() === VIBER_CHANNEL && isEmpty(nextProps.Templates.selectedViberAccount)) {
|
|
290
|
-
let selectedAccount = '';
|
|
291
|
-
if (isEmpty(nextProps.Templates.weCrmAccounts)) {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
selectedAccount = nextProps.Templates.weCrmAccounts[0];
|
|
295
|
-
const { configs = {}, name = "" } = selectedAccount;
|
|
296
|
-
const { wecrm_app_id = "", wecrm_token = "", sourceAccountIdentifier = "" } = configs;
|
|
297
|
-
this.setState({selectedAccount: name}, () => {
|
|
298
|
-
params.wecrmId = wecrm_app_id;
|
|
299
|
-
params.wecrmToken = wecrm_token;
|
|
300
|
-
params.originalId = sourceAccountIdentifier;
|
|
301
|
-
this.props.actions.setViberAccount(nextProps.Templates.weCrmAccounts[0]);
|
|
302
|
-
this.getAllTemplates({params});
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
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")) {
|
|
306
272
|
let selectedAccount = '';
|
|
307
273
|
if (isEmpty(nextProps.Templates.weCrmAccounts)) {
|
|
@@ -370,8 +336,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
370
336
|
this.props.ebillActions.clearCreateResponse();
|
|
371
337
|
} else if (this.state.channel.toLowerCase() === "line") {
|
|
372
338
|
this.props.lineActions.clearCreateResponse();
|
|
373
|
-
} else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
374
|
-
this.props.viberActions.clearCreateResponse();
|
|
375
339
|
}
|
|
376
340
|
}
|
|
377
341
|
}
|
|
@@ -468,7 +432,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
468
432
|
} else if (this.state.channel.toLowerCase() === 'line') {
|
|
469
433
|
this.props.actions.setLineAccount(this.props.Templates.weCrmAccounts.find((item) => item.name === this.state.selectedAccount));
|
|
470
434
|
}
|
|
471
|
-
|
|
472
435
|
this.setState({activeMode: TEMPLATES_MODE});
|
|
473
436
|
console.log("getAllTemplates params: ", params);
|
|
474
437
|
this.getAllTemplates({params, resetPage: true});
|
|
@@ -688,7 +651,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
688
651
|
<video height="279">
|
|
689
652
|
<source src={originalVideoContentUrl} type="video/mp4" />
|
|
690
653
|
</video>
|
|
691
|
-
)
|
|
654
|
+
)
|
|
692
655
|
}
|
|
693
656
|
if (carouselTemplate) {
|
|
694
657
|
const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
|
|
@@ -714,26 +677,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
714
677
|
}
|
|
715
678
|
break;
|
|
716
679
|
}
|
|
717
|
-
case VIBER: {
|
|
718
|
-
const {
|
|
719
|
-
content: {
|
|
720
|
-
viber: {
|
|
721
|
-
text = '',
|
|
722
|
-
imageURL = '',
|
|
723
|
-
buttonURL = '',
|
|
724
|
-
buttonText = '',
|
|
725
|
-
} = {},
|
|
726
|
-
} = {},
|
|
727
|
-
} = template.versions.base;
|
|
728
|
-
templateData.content = text;
|
|
729
|
-
if (imageURL) {
|
|
730
|
-
templateData.url = imageURL;
|
|
731
|
-
}
|
|
732
|
-
if (buttonURL && buttonText) {
|
|
733
|
-
templateData.buttonText = buttonText;
|
|
734
|
-
}
|
|
735
|
-
break;
|
|
736
|
-
}
|
|
737
680
|
default:
|
|
738
681
|
templateData.content = "";
|
|
739
682
|
}
|
|
@@ -1231,15 +1174,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1231
1174
|
this.props.lineActions.clearCreateResponse();
|
|
1232
1175
|
}
|
|
1233
1176
|
});
|
|
1234
|
-
} else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
1235
|
-
this.props.viberActions.createTemplate(duplicateObj, (response) => {
|
|
1236
|
-
if (response && response.templateId) {
|
|
1237
|
-
const message = `${this.state.channel} ${this.props.intl.formatMessage(messages.templateDuplicateSuccess)}`;
|
|
1238
|
-
CapNotification.success({key: 'duplicateSucess', message});
|
|
1239
|
-
this.getAllTemplates({params, resetPage: true});
|
|
1240
|
-
this.props.viberActions.clearCreateResponse();
|
|
1241
|
-
}
|
|
1242
|
-
});
|
|
1243
1177
|
}
|
|
1244
1178
|
}
|
|
1245
1179
|
|
|
@@ -1321,9 +1255,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1321
1255
|
pathName += `/${options.account}`;
|
|
1322
1256
|
}
|
|
1323
1257
|
}
|
|
1324
|
-
if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
1325
|
-
pathName = `/viber/edit/${id}/`;
|
|
1326
|
-
}
|
|
1327
1258
|
if (this.state.channel.toUpperCase() === WECHAT) {
|
|
1328
1259
|
if (get(template, 'definition.msgcontent', '') === "RICH_MEDIA_WECHAT") {
|
|
1329
1260
|
pathName = `/wechat/richmedia/edit/${id}`;
|
|
@@ -1622,7 +1553,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1622
1553
|
} = Templates;
|
|
1623
1554
|
const lineLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'line');
|
|
1624
1555
|
const smsLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'sms');
|
|
1625
|
-
const viberLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === VIBER_CHANNEL);
|
|
1626
1556
|
const wechatLoader = (((this.state.selectedAccount !== '' && getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'wechat');
|
|
1627
1557
|
const mobilePushLoader = (((getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
|
|
1628
1558
|
const emailLoader = (
|
|
@@ -1636,8 +1566,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1636
1566
|
(emailLoader !== undefined ? emailLoader : false) ||
|
|
1637
1567
|
(ebillLoader !== undefined ? ebillLoader : false) ||
|
|
1638
1568
|
(mobilePushLoader !== undefined ? mobilePushLoader : false) ||
|
|
1639
|
-
(lineLoader !== undefined ? lineLoader : false)
|
|
1640
|
-
(viberLoader !== undefined ? viberLoader : false);
|
|
1569
|
+
(lineLoader !== undefined ? lineLoader : false);
|
|
1641
1570
|
return isLoading;
|
|
1642
1571
|
}
|
|
1643
1572
|
getChannelTypeIllustrationInfo = (type) => {
|
|
@@ -1719,7 +1648,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1719
1648
|
const isMobilePushChannel = channel === MOBILE_PUSH;
|
|
1720
1649
|
const isLineChannel = channel === LINE;
|
|
1721
1650
|
|
|
1722
|
-
|
|
1723
1651
|
if ((isWechatChannel || isMobilePushChannel || isLineChannel) && !isEmpty(weCrmAccounts)) {
|
|
1724
1652
|
forEach(weCrmAccounts, (account) => {
|
|
1725
1653
|
if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || isMobilePushChannel || isLineChannel) {
|
|
@@ -1778,10 +1706,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1778
1706
|
noAccountHeader = messages.noAccountsPresentLine;
|
|
1779
1707
|
break;
|
|
1780
1708
|
}
|
|
1781
|
-
case VIBER: {
|
|
1782
|
-
noAccountHeader = messages.noAccountsPresentViber;
|
|
1783
|
-
break;
|
|
1784
|
-
}
|
|
1785
1709
|
default:
|
|
1786
1710
|
break;
|
|
1787
1711
|
}
|
|
@@ -1840,9 +1764,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1840
1764
|
render() {
|
|
1841
1765
|
const isFullMode = this.isFullMode();
|
|
1842
1766
|
const { activeMode, channel, wechatFilter, lineFilter } = this.state;
|
|
1843
|
-
|
|
1844
|
-
(channel.toLowerCase() === VIBER_CHANNEL && !this.props.isFullMode && isEmpty(get(this.props, 'Templates.selectedViberAccount', {}))));
|
|
1845
|
-
if (activeMode === ACCOUNT_SELECTION_MODE && showForViber ) {
|
|
1767
|
+
if (activeMode === ACCOUNT_SELECTION_MODE) {
|
|
1846
1768
|
return this.renderAccountSelection();
|
|
1847
1769
|
}
|
|
1848
1770
|
const pageHeader = "";
|
|
@@ -2055,7 +1977,6 @@ Templates.propTypes = {
|
|
|
2055
1977
|
isFullMode: PropTypes.bool,
|
|
2056
1978
|
handlePeviewTemplate: PropTypes.func,
|
|
2057
1979
|
router: PropTypes.object,
|
|
2058
|
-
viberActions: PropTypes.object,
|
|
2059
1980
|
};
|
|
2060
1981
|
|
|
2061
1982
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -2068,7 +1989,6 @@ const mapStateToProps = createStructuredSelector({
|
|
|
2068
1989
|
EmailCreate: makeSelectCreateEmail(),
|
|
2069
1990
|
Global: makeSelectAuthenticated(),
|
|
2070
1991
|
Line: makeSelectLine(),
|
|
2071
|
-
Viber: makeSelectViber(),
|
|
2072
1992
|
});
|
|
2073
1993
|
|
|
2074
1994
|
function mapDispatchToProps(dispatch) {
|
|
@@ -2081,7 +2001,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
2081
2001
|
emailActions: bindActionCreators(emailActions, dispatch),
|
|
2082
2002
|
globalActions: bindActionCreators(globalActions, dispatch),
|
|
2083
2003
|
lineActions: bindActionCreators(lineActions, dispatch),
|
|
2084
|
-
viberActions: bindActionCreators(viberActions, dispatch),
|
|
2085
2004
|
};
|
|
2086
2005
|
}
|
|
2087
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,9 +22,7 @@ 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';
|
|
27
|
-
import FTP from '../FTP';
|
|
28
26
|
import Gallery from '../Assets/Gallery';
|
|
29
27
|
import withStyles from '../../hoc/withStyles';
|
|
30
28
|
import styles, { CapTabStyle } from './TemplatesV2.style';
|
|
@@ -54,8 +52,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
54
52
|
//'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
|
|
55
53
|
mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
|
|
56
54
|
line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
|
|
57
|
-
viber: {content: <></>, tab: intl.formatMessage(messages.viber), key: 'viber'},
|
|
58
|
-
|
|
59
55
|
|
|
60
56
|
};
|
|
61
57
|
let filteredPanes = Object.keys(defaultPanes)
|
|
@@ -73,10 +69,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
73
69
|
if (!channelsToHide.includes('facebook')) {
|
|
74
70
|
filteredPanes.push({content: <div></div>, tab: intl.formatMessage(messages.facebook), key: 'facebook'});
|
|
75
71
|
}
|
|
76
|
-
if (!channelsToHide.includes('FTP')) {
|
|
77
|
-
filteredPanes.push({content: <></>, tab: intl.formatMessage(messages.FTP), key: 'ftp'});
|
|
78
|
-
defaultChannel = 'FTP';
|
|
79
|
-
}
|
|
80
72
|
}
|
|
81
73
|
|
|
82
74
|
filteredPanes = filteredPanes.map( (pane) => {
|
|
@@ -160,12 +152,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
160
152
|
/>
|
|
161
153
|
);
|
|
162
154
|
}
|
|
163
|
-
|
|
164
|
-
<Viber
|
|
165
|
-
{...this.props}
|
|
166
|
-
isCreateFlow
|
|
167
|
-
></Viber>
|
|
168
|
-
)
|
|
155
|
+
|
|
169
156
|
getLineComponent = () => (
|
|
170
157
|
<Line
|
|
171
158
|
{...this.props}
|
|
@@ -173,10 +160,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
173
160
|
/>
|
|
174
161
|
)
|
|
175
162
|
|
|
176
|
-
getFTPComponent = () => (
|
|
177
|
-
<FTP mode={this.props.FTPMode} {...this.props} />
|
|
178
|
-
);
|
|
179
|
-
|
|
180
163
|
getTemplatesComponent(channel) {
|
|
181
164
|
// const templates = this.props.Templates[`${channel}Templates`];
|
|
182
165
|
let query = {};
|
|
@@ -185,9 +168,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
185
168
|
if (channel === 'line') {
|
|
186
169
|
return this.getLineComponent();
|
|
187
170
|
}
|
|
188
|
-
if (channel === 'ftp') {
|
|
189
|
-
return this.getFTPComponent();
|
|
190
|
-
}
|
|
191
171
|
}
|
|
192
172
|
const location = {pathname: `/${channel}`, search: '', query};
|
|
193
173
|
switch (channel) {
|
|
@@ -286,7 +266,6 @@ TemplatesV2.propTypes = {
|
|
|
286
266
|
messageDetails: PropTypes.object,
|
|
287
267
|
cap: PropTypes.object,
|
|
288
268
|
authData: PropTypes.object,
|
|
289
|
-
FTPMode: PropTypes.string,
|
|
290
269
|
};
|
|
291
270
|
|
|
292
271
|
TemplatesV2.defaultProps = {
|
|
@@ -34,10 +34,6 @@ 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
|
-
},
|
|
41
37
|
pushNotification: {
|
|
42
38
|
id: 'creatives.containersV2.TemplatesV2.pushNotification',
|
|
43
39
|
defaultMessage: 'Push notification',
|
|
@@ -50,10 +46,6 @@ export default defineMessages({
|
|
|
50
46
|
id: 'creatives.containersV2.TemplatesV2.facebook',
|
|
51
47
|
defaultMessage: 'Facebook',
|
|
52
48
|
},
|
|
53
|
-
viber: {
|
|
54
|
-
id: 'creatives.containersV2.TemplatesV2.viber',
|
|
55
|
-
defaultMessage: 'Viber',
|
|
56
|
-
},
|
|
57
49
|
gallery: {
|
|
58
50
|
id: 'creatives.containersV2.TemplatesV2.gallery',
|
|
59
51
|
defaultMessage: 'Gallery',
|
package/assets/viber.png
DELETED
|
Binary file
|