@capillarytech/creatives-library 7.0.1 → 7.0.4
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/assets/viber.png +0 -0
- package/index.js +8 -1
- package/package.json +2 -1
- package/reducers.js +2 -0
- package/routes.js +7 -1
- package/services/api.js +5 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +8 -2
- package/v2Components/TemplatePreview/assets/images/viberMobile.svg +135 -0
- package/v2Components/TemplatePreview/index.js +104 -18
- package/v2Containers/App/constants.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +65 -2
- package/v2Containers/CreativesContainer/constants.js +2 -0
- package/v2Containers/CreativesContainer/index.js +38 -4
- package/v2Containers/Templates/_templates.scss +57 -0
- package/v2Containers/Templates/actions.js +117 -110
- package/v2Containers/Templates/constants.js +2 -0
- package/v2Containers/Templates/index.js +89 -7
- package/v2Containers/Templates/messages.js +4 -0
- package/v2Containers/Templates/reducer.js +2 -0
- package/v2Containers/TemplatesV2/index.js +9 -1
- package/v2Containers/TemplatesV2/messages.js +4 -0
- package/v2Containers/Viber/actions.js +74 -0
- package/v2Containers/Viber/constants.js +30 -0
- package/v2Containers/Viber/index.js +719 -0
- package/v2Containers/Viber/messages.js +145 -0
- package/v2Containers/Viber/reducer.js +84 -0
- package/v2Containers/Viber/sagas.js +107 -0
- package/v2Containers/Viber/selectors.js +21 -0
- package/v2Components/TemplatePreview/assets/images/mobile.svg +0 -24
- package/v2Containers/Line/Create/_lineCreate.scss +0 -64
- package/v2Containers/Line/Create/actions.js +0 -94
- package/v2Containers/Line/Create/constants.js +0 -43
- package/v2Containers/Line/Create/index.js +0 -1132
- package/v2Containers/Line/Create/initialSchema.js +0 -378
- package/v2Containers/Line/Create/messages.js +0 -229
- package/v2Containers/Line/Create/reducer.js +0 -99
- package/v2Containers/Line/Create/sagas.js +0 -113
- package/v2Containers/Line/Create/selectors.js +0 -30
- package/v2Containers/Line/CreateWrapper/constants.js +0 -2
- package/v2Containers/Line/CreateWrapper/index.js +0 -117
- package/v2Containers/Line/CreateWrapper/messages.js +0 -55
- package/v2Containers/Line/Edit/_lineEdit.scss +0 -23
- package/v2Containers/Line/Edit/actions.js +0 -79
- package/v2Containers/Line/Edit/constants.js +0 -27
- package/v2Containers/Line/Edit/index.js +0 -1051
- package/v2Containers/Line/Edit/messages.js +0 -173
- package/v2Containers/Line/Edit/reducer.js +0 -83
- package/v2Containers/Line/Edit/sagas.js +0 -81
- package/v2Containers/Line/Edit/selectors.js +0 -29
- package/v2Containers/Line/Edit/tests/actions.test.js +0 -18
- package/v2Containers/Line/Edit/tests/index.test.js +0 -10
- package/v2Containers/Line/Edit/tests/reducer.test.js +0 -9
- package/v2Containers/Line/Edit/tests/sagas.test.js +0 -15
- package/v2Containers/Line/Edit/tests/selectors.test.js +0 -10
|
@@ -30,6 +30,7 @@ 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';
|
|
33
34
|
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
34
35
|
import messages from './messages';
|
|
35
36
|
import {checkUnicode} from '../../utils/smsCharCountV2';
|
|
@@ -40,6 +41,8 @@ import * as smsEditActions from '../Sms/Edit/actions';
|
|
|
40
41
|
import * as ebillActions from '../Ebill/actions';
|
|
41
42
|
import * as emailActions from '../Email/actions';
|
|
42
43
|
import * as lineActions from '../Line/Container/actions';
|
|
44
|
+
import * as viberActions from '../Viber/actions';
|
|
45
|
+
|
|
43
46
|
import CardGrid from '../../v2Components/CardGrid';
|
|
44
47
|
import config from '../../config/app';
|
|
45
48
|
import './_templates.scss';
|
|
@@ -50,8 +53,13 @@ import Pagination from '../../v2Components/Pagination';
|
|
|
50
53
|
import EmailPreview from '../../v2Components/EmailPreview';
|
|
51
54
|
import CreativesContainer from '../CreativesContainer';
|
|
52
55
|
import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
|
|
53
|
-
import {
|
|
54
|
-
|
|
56
|
+
import {
|
|
57
|
+
CHANNEL_CREATE_TRACK_MAPPING,
|
|
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
|
+
|
|
55
63
|
import emailIllustration from '../Assets/images/emailIllustration.svg';
|
|
56
64
|
import smsIllustration from '../Assets/images/smsIllustration.svg';
|
|
57
65
|
import pushIllustration from '../Assets/images/pushIllustration.svg';
|
|
@@ -161,6 +169,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
161
169
|
case EBILL:
|
|
162
170
|
channel = 'Ebill';
|
|
163
171
|
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;
|
|
164
179
|
case LINE:
|
|
165
180
|
channel = "Line";
|
|
166
181
|
if (!this.props.isFullMode) {
|
|
@@ -185,7 +200,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
185
200
|
if (this.props.location.query.type === 'embedded') {
|
|
186
201
|
this.props.actions.resetAccount();
|
|
187
202
|
}
|
|
188
|
-
if ((
|
|
203
|
+
if ((['line', VIBER_CHANNEL, 'sms', 'email', 'ebill'].includes((this.state.channel || '').toLowerCase())) || ((['wechat', 'mobilepush'].includes(this.state.channel.toLowerCase()) && !isEmpty(this.props.Templates.selectedWeChatAccount)))) {
|
|
189
204
|
const queryParams = {
|
|
190
205
|
// name: this.state.searchText,
|
|
191
206
|
// sortBy: this.state.sortBy,
|
|
@@ -245,9 +260,16 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
245
260
|
this.setState({defaultAccount: true});
|
|
246
261
|
nextProps.actions.getWeCrmAccounts(channel);
|
|
247
262
|
}
|
|
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
|
+
}
|
|
248
269
|
}
|
|
270
|
+
|
|
249
271
|
this.setState({ channel }, () => {
|
|
250
|
-
if (
|
|
272
|
+
if (['line', VIBER_CHANNEL, 'sms', 'email', 'ebill'].includes(this.state.channel.toLowerCase()) || (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount))) {
|
|
251
273
|
if (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount)) {
|
|
252
274
|
params.wecrmId = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_app_id;
|
|
253
275
|
params.wecrmToken = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_token;
|
|
@@ -268,6 +290,20 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
268
290
|
if ((this.state.channel || '').toLowerCase() === "mobilepush" && nextProps.Templates.selectedWeChatAccount) {
|
|
269
291
|
params.accountId = nextProps.Templates.selectedWeChatAccount.id;
|
|
270
292
|
}
|
|
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
|
+
}
|
|
271
307
|
if ((this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === 'mobilepush') && isEmpty(nextProps.Templates.selectedWeChatAccount) && (this.props.location.query.type === 'embedded') && !this.isEnabledInLibraryModule("showAccountSelection")) {
|
|
272
308
|
let selectedAccount = '';
|
|
273
309
|
if (isEmpty(nextProps.Templates.weCrmAccounts)) {
|
|
@@ -336,6 +372,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
336
372
|
this.props.ebillActions.clearCreateResponse();
|
|
337
373
|
} else if (this.state.channel.toLowerCase() === "line") {
|
|
338
374
|
this.props.lineActions.clearCreateResponse();
|
|
375
|
+
} else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
376
|
+
this.props.viberActions.clearCreateResponse();
|
|
339
377
|
}
|
|
340
378
|
}
|
|
341
379
|
}
|
|
@@ -432,6 +470,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
432
470
|
} else if (this.state.channel.toLowerCase() === 'line') {
|
|
433
471
|
this.props.actions.setLineAccount(this.props.Templates.weCrmAccounts.find((item) => item.name === this.state.selectedAccount));
|
|
434
472
|
}
|
|
473
|
+
|
|
435
474
|
this.setState({activeMode: TEMPLATES_MODE});
|
|
436
475
|
console.log("getAllTemplates params: ", params);
|
|
437
476
|
this.getAllTemplates({params, resetPage: true});
|
|
@@ -651,7 +690,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
651
690
|
<video height="279">
|
|
652
691
|
<source src={originalVideoContentUrl} type="video/mp4" />
|
|
653
692
|
</video>
|
|
654
|
-
)
|
|
693
|
+
);
|
|
655
694
|
}
|
|
656
695
|
if (carouselTemplate) {
|
|
657
696
|
const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
|
|
@@ -677,6 +716,26 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
677
716
|
}
|
|
678
717
|
break;
|
|
679
718
|
}
|
|
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
|
+
}
|
|
680
739
|
default:
|
|
681
740
|
templateData.content = "";
|
|
682
741
|
}
|
|
@@ -1174,6 +1233,15 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1174
1233
|
this.props.lineActions.clearCreateResponse();
|
|
1175
1234
|
}
|
|
1176
1235
|
});
|
|
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
|
+
});
|
|
1177
1245
|
}
|
|
1178
1246
|
}
|
|
1179
1247
|
|
|
@@ -1255,6 +1323,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1255
1323
|
pathName += `/${options.account}`;
|
|
1256
1324
|
}
|
|
1257
1325
|
}
|
|
1326
|
+
if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
1327
|
+
pathName = `/viber/edit/${id}/`;
|
|
1328
|
+
}
|
|
1258
1329
|
if (this.state.channel.toUpperCase() === WECHAT) {
|
|
1259
1330
|
if (get(template, 'definition.msgcontent', '') === "RICH_MEDIA_WECHAT") {
|
|
1260
1331
|
pathName = `/wechat/richmedia/edit/${id}`;
|
|
@@ -1553,6 +1624,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1553
1624
|
} = Templates;
|
|
1554
1625
|
const lineLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'line');
|
|
1555
1626
|
const smsLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'sms');
|
|
1627
|
+
const viberLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === VIBER_CHANNEL);
|
|
1556
1628
|
const wechatLoader = (((this.state.selectedAccount !== '' && getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'wechat');
|
|
1557
1629
|
const mobilePushLoader = (((getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
|
|
1558
1630
|
const emailLoader = (
|
|
@@ -1566,7 +1638,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1566
1638
|
(emailLoader !== undefined ? emailLoader : false) ||
|
|
1567
1639
|
(ebillLoader !== undefined ? ebillLoader : false) ||
|
|
1568
1640
|
(mobilePushLoader !== undefined ? mobilePushLoader : false) ||
|
|
1569
|
-
(lineLoader !== undefined ? lineLoader : false)
|
|
1641
|
+
(lineLoader !== undefined ? lineLoader : false) ||
|
|
1642
|
+
(viberLoader !== undefined ? viberLoader : false);
|
|
1570
1643
|
return isLoading;
|
|
1571
1644
|
}
|
|
1572
1645
|
getChannelTypeIllustrationInfo = (type) => {
|
|
@@ -1648,6 +1721,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1648
1721
|
const isMobilePushChannel = channel === MOBILE_PUSH;
|
|
1649
1722
|
const isLineChannel = channel === LINE;
|
|
1650
1723
|
|
|
1724
|
+
|
|
1651
1725
|
if ((isWechatChannel || isMobilePushChannel || isLineChannel) && !isEmpty(weCrmAccounts)) {
|
|
1652
1726
|
forEach(weCrmAccounts, (account) => {
|
|
1653
1727
|
if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || isMobilePushChannel || isLineChannel) {
|
|
@@ -1706,6 +1780,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1706
1780
|
noAccountHeader = messages.noAccountsPresentLine;
|
|
1707
1781
|
break;
|
|
1708
1782
|
}
|
|
1783
|
+
case VIBER: {
|
|
1784
|
+
noAccountHeader = messages.noAccountsPresentViber;
|
|
1785
|
+
break;
|
|
1786
|
+
}
|
|
1709
1787
|
default:
|
|
1710
1788
|
break;
|
|
1711
1789
|
}
|
|
@@ -1764,7 +1842,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1764
1842
|
render() {
|
|
1765
1843
|
const isFullMode = this.isFullMode();
|
|
1766
1844
|
const { activeMode, channel, wechatFilter, lineFilter } = this.state;
|
|
1767
|
-
|
|
1845
|
+
const showForViber = (channel.toLowerCase() !== VIBER_CHANNEL || (channel.toLowerCase() === VIBER_CHANNEL && isEmpty(get(this.props, 'Templates.selectedViberAccount', {}))));
|
|
1846
|
+
if (activeMode === ACCOUNT_SELECTION_MODE && showForViber ) {
|
|
1768
1847
|
return this.renderAccountSelection();
|
|
1769
1848
|
}
|
|
1770
1849
|
const pageHeader = "";
|
|
@@ -1977,6 +2056,7 @@ Templates.propTypes = {
|
|
|
1977
2056
|
isFullMode: PropTypes.bool,
|
|
1978
2057
|
handlePeviewTemplate: PropTypes.func,
|
|
1979
2058
|
router: PropTypes.object,
|
|
2059
|
+
viberActions: PropTypes.object,
|
|
1980
2060
|
};
|
|
1981
2061
|
|
|
1982
2062
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1989,6 +2069,7 @@ const mapStateToProps = createStructuredSelector({
|
|
|
1989
2069
|
EmailCreate: makeSelectCreateEmail(),
|
|
1990
2070
|
Global: makeSelectAuthenticated(),
|
|
1991
2071
|
Line: makeSelectLine(),
|
|
2072
|
+
Viber: makeSelectViber(),
|
|
1992
2073
|
});
|
|
1993
2074
|
|
|
1994
2075
|
function mapDispatchToProps(dispatch) {
|
|
@@ -2001,6 +2082,7 @@ function mapDispatchToProps(dispatch) {
|
|
|
2001
2082
|
emailActions: bindActionCreators(emailActions, dispatch),
|
|
2002
2083
|
globalActions: bindActionCreators(globalActions, dispatch),
|
|
2003
2084
|
lineActions: bindActionCreators(lineActions, dispatch),
|
|
2085
|
+
viberActions: bindActionCreators(viberActions, dispatch),
|
|
2004
2086
|
};
|
|
2005
2087
|
}
|
|
2006
2088
|
|
|
@@ -366,4 +366,8 @@ 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
|
+
},
|
|
369
373
|
});
|
|
@@ -73,6 +73,8 @@ 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));
|
|
76
78
|
case types.RESET_ACCOUNT:
|
|
77
79
|
return state
|
|
78
80
|
.remove('selectedWeChatAccount')
|
|
@@ -22,6 +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';
|
|
25
26
|
import Line from '../Line/Container';
|
|
26
27
|
import Gallery from '../Assets/Gallery';
|
|
27
28
|
import withStyles from '../../hoc/withStyles';
|
|
@@ -52,6 +53,8 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
52
53
|
//'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
|
|
53
54
|
mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
|
|
54
55
|
line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
|
|
56
|
+
viber: {content: <></>, tab: intl.formatMessage(messages.viber), key: 'viber'},
|
|
57
|
+
|
|
55
58
|
|
|
56
59
|
};
|
|
57
60
|
let filteredPanes = Object.keys(defaultPanes)
|
|
@@ -152,7 +155,12 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
152
155
|
/>
|
|
153
156
|
);
|
|
154
157
|
}
|
|
155
|
-
|
|
158
|
+
getViberComponent =() => (
|
|
159
|
+
<Viber
|
|
160
|
+
{...this.props}
|
|
161
|
+
isCreateFlow
|
|
162
|
+
></Viber>
|
|
163
|
+
)
|
|
156
164
|
getLineComponent = () => (
|
|
157
165
|
<Line
|
|
158
166
|
{...this.props}
|
|
@@ -46,6 +46,10 @@ export default defineMessages({
|
|
|
46
46
|
id: 'creatives.containersV2.TemplatesV2.facebook',
|
|
47
47
|
defaultMessage: 'Facebook',
|
|
48
48
|
},
|
|
49
|
+
viber: {
|
|
50
|
+
id: 'creatives.containersV2.TemplatesV2.viber',
|
|
51
|
+
defaultMessage: 'Viber',
|
|
52
|
+
},
|
|
49
53
|
gallery: {
|
|
50
54
|
id: 'creatives.containersV2.TemplatesV2.gallery',
|
|
51
55
|
defaultMessage: 'Gallery',
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
import * as types from './constants';
|
|
3
|
+
|
|
4
|
+
export function defaultAction() {
|
|
5
|
+
return {
|
|
6
|
+
type: types.DEFAULT_ACTION,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const uploadViberAsset = (file, assetType, fileParams, templateType) => ({
|
|
11
|
+
type: types.UPLOAD_VIBER_ASSET_REQUEST,
|
|
12
|
+
file,
|
|
13
|
+
assetType,
|
|
14
|
+
fileParams,
|
|
15
|
+
templateType,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export function createTemplate(template, callback) {
|
|
20
|
+
return {
|
|
21
|
+
type: types.CREATE_VIBER_TEMPLATE_REQUEST,
|
|
22
|
+
template,
|
|
23
|
+
callback,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// FOR EDIT
|
|
29
|
+
|
|
30
|
+
export function editTemplate(template, callback) {
|
|
31
|
+
console.log('action trigereed editTemplate viber @@@');
|
|
32
|
+
return {
|
|
33
|
+
type: types.EDIT_VIBER_TEMPLATE_REQUEST,
|
|
34
|
+
template,
|
|
35
|
+
callback,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getTemplateDetails(id, callback) {
|
|
40
|
+
console.log('getting template viber @@@', id);
|
|
41
|
+
return {
|
|
42
|
+
type: types.GET_VIBER_TEMPLATE_DETAILS_REQUEST,
|
|
43
|
+
id,
|
|
44
|
+
channel: 'VIBER',
|
|
45
|
+
callback,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function clearData() {
|
|
50
|
+
return {
|
|
51
|
+
type: types.CLEAR_VIBER_DATA,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function clearEditResponse() {
|
|
56
|
+
return {
|
|
57
|
+
type: types.CLEAR_VIBER_EDIT_RESPONSE_REQUEST,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export function clearCreateResponse() {
|
|
63
|
+
return {
|
|
64
|
+
type: types.CLEAR_VIBER_CREATE_RESPONSE_REQUEST,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function clearViberAsset(templateType) {
|
|
69
|
+
return {
|
|
70
|
+
type: types.CLEAR_VIBER_ASSET,
|
|
71
|
+
templateType,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const DEFAULT_ACTION = 'app/v2Containers/Viber/DEFAULT_ACTION';
|
|
2
|
+
export const ALLOWED_EXTENSIONS_REGEX = (/\.(jpe?g|png)$/i);
|
|
3
|
+
export const VIBER_IMG_HEIGHT = 400;
|
|
4
|
+
export const VIBER_IMG_WIDTH = 300;
|
|
5
|
+
export const VIBER_IMG_SIZE = 10000000;
|
|
6
|
+
export const charLimit = 1000;
|
|
7
|
+
|
|
8
|
+
export const UPLOAD_VIBER_ASSET_REQUEST = 'app/v2Containers/Viber/UPLOAD_ASSET_REQUEST';
|
|
9
|
+
export const UPLOAD_VIBER_ASSET_SUCCESS = 'app/v2Containers/Viber/UPLOAD_ASSET_SUCCESS';
|
|
10
|
+
export const UPLOAD_VIBER_ASSET_FAILURE = 'app/v2Containers/Viber/UPLOAD_ASSET_FAILURE';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const CREATE_VIBER_TEMPLATE_REQUEST = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_REQUEST';
|
|
14
|
+
export const CREATE_VIBER_TEMPLATE_SUCCESS = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_SUCCESS';
|
|
15
|
+
export const CREATE_VIBER_TEMPLATE_FAILURE = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_FAILURE';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export const GET_VIBER_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Viber/EDIT/CREATE_VIBER_TEMPLATE_DETAILS_REQUEST';
|
|
19
|
+
export const GET_VIBER_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Viber/EDIT/CREATE_VIBER_TEMPLATE_DETAILS_SUCCESS';
|
|
20
|
+
export const GET_VIBER_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Viber/EDIT/CREATE_VIBER_TEMPLATE_DETAILS_FAILURE';
|
|
21
|
+
|
|
22
|
+
export const EDIT_VIBER_TEMPLATE_REQUEST = 'app/v2Containers/VIBER/Edit/EDIT_VIBER_TEMPLATE_REQUEST';
|
|
23
|
+
export const EDIT_VIBER_TEMPLATE_SUCCESS = 'app/v2Containers/VIBER/Edit/EDIT_VIBER_TEMPLATE_SUCCESS';
|
|
24
|
+
export const EDIT_VIBER_TEMPLATE_FAILURE = 'app/v2Containers/VIBER/Edit/EDIT_VIBER_TEMPLATE_FAILURE';
|
|
25
|
+
|
|
26
|
+
export const CLEAR_VIBER_EDIT_RESPONSE_REQUEST = 'app/v2Containers/VIBER/Edit/CLEAR_EDIT_RESPONSE_REQUEST';
|
|
27
|
+
export const CLEAR_VIBER_DATA = 'app/v2Containers/VIBER/Edit/CLEAR_DATA';
|
|
28
|
+
export const CLEAR_VIBER_CREATE_RESPONSE_REQUEST = 'app/v2Containers/VIBER/Create/CLEAR_EDIT_RESPONSE_REQUEST';
|
|
29
|
+
export const CLEAR_VIBER_ASSET = 'app/v2Containers/Viber/CLEAR_ASSET';
|
|
30
|
+
|