@capillarytech/creatives-library 7.0.1 → 7.0.5
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 +67 -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 +85 -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 +727 -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,11 @@ 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
|
+
activeMode = ACCOUNT_SELECTION_MODE;
|
|
175
|
+
this.props.actions.getWeCrmAccounts(channel);
|
|
176
|
+
break;
|
|
164
177
|
case LINE:
|
|
165
178
|
channel = "Line";
|
|
166
179
|
if (!this.props.isFullMode) {
|
|
@@ -185,7 +198,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
185
198
|
if (this.props.location.query.type === 'embedded') {
|
|
186
199
|
this.props.actions.resetAccount();
|
|
187
200
|
}
|
|
188
|
-
if ((
|
|
201
|
+
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
202
|
const queryParams = {
|
|
190
203
|
// name: this.state.searchText,
|
|
191
204
|
// sortBy: this.state.sortBy,
|
|
@@ -245,9 +258,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
245
258
|
this.setState({defaultAccount: true});
|
|
246
259
|
nextProps.actions.getWeCrmAccounts(channel);
|
|
247
260
|
}
|
|
261
|
+
} else if (nextProps.route.name.toLowerCase() === VIBER_CHANNEL) {
|
|
262
|
+
channel = 'Viber';
|
|
263
|
+
this.setState({defaultAccount: true});
|
|
264
|
+
nextProps.actions.getWeCrmAccounts(channel);
|
|
248
265
|
}
|
|
266
|
+
|
|
249
267
|
this.setState({ channel }, () => {
|
|
250
|
-
if (
|
|
268
|
+
if (['line', VIBER_CHANNEL, 'sms', 'email', 'ebill'].includes(this.state.channel.toLowerCase()) || (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount))) {
|
|
251
269
|
if (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount)) {
|
|
252
270
|
params.wecrmId = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_app_id;
|
|
253
271
|
params.wecrmToken = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_token;
|
|
@@ -268,6 +286,20 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
268
286
|
if ((this.state.channel || '').toLowerCase() === "mobilepush" && nextProps.Templates.selectedWeChatAccount) {
|
|
269
287
|
params.accountId = nextProps.Templates.selectedWeChatAccount.id;
|
|
270
288
|
}
|
|
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
|
+
this.setState({selectedAccount: selectedAccount.name}, () => {
|
|
296
|
+
params.wecrmId = selectedAccount.configs.wecrm_app_id;
|
|
297
|
+
params.wecrmToken = selectedAccount.configs.wecrm_token;
|
|
298
|
+
params.originalId = selectedAccount.sourceAccountIdentifier;
|
|
299
|
+
this.props.actions.setViberAccount(nextProps.Templates.weCrmAccounts[0]);
|
|
300
|
+
this.getAllTemplates({params});
|
|
301
|
+
});
|
|
302
|
+
}
|
|
271
303
|
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
304
|
let selectedAccount = '';
|
|
273
305
|
if (isEmpty(nextProps.Templates.weCrmAccounts)) {
|
|
@@ -336,6 +368,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
336
368
|
this.props.ebillActions.clearCreateResponse();
|
|
337
369
|
} else if (this.state.channel.toLowerCase() === "line") {
|
|
338
370
|
this.props.lineActions.clearCreateResponse();
|
|
371
|
+
} else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
372
|
+
this.props.viberActions.clearCreateResponse();
|
|
339
373
|
}
|
|
340
374
|
}
|
|
341
375
|
}
|
|
@@ -432,6 +466,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
432
466
|
} else if (this.state.channel.toLowerCase() === 'line') {
|
|
433
467
|
this.props.actions.setLineAccount(this.props.Templates.weCrmAccounts.find((item) => item.name === this.state.selectedAccount));
|
|
434
468
|
}
|
|
469
|
+
|
|
435
470
|
this.setState({activeMode: TEMPLATES_MODE});
|
|
436
471
|
console.log("getAllTemplates params: ", params);
|
|
437
472
|
this.getAllTemplates({params, resetPage: true});
|
|
@@ -651,7 +686,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
651
686
|
<video height="279">
|
|
652
687
|
<source src={originalVideoContentUrl} type="video/mp4" />
|
|
653
688
|
</video>
|
|
654
|
-
)
|
|
689
|
+
);
|
|
655
690
|
}
|
|
656
691
|
if (carouselTemplate) {
|
|
657
692
|
const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
|
|
@@ -677,6 +712,26 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
677
712
|
}
|
|
678
713
|
break;
|
|
679
714
|
}
|
|
715
|
+
case VIBER: {
|
|
716
|
+
const {
|
|
717
|
+
content: {
|
|
718
|
+
viber: {
|
|
719
|
+
text = '',
|
|
720
|
+
imageURL = '',
|
|
721
|
+
buttonURL = '',
|
|
722
|
+
buttonText = '',
|
|
723
|
+
} = {},
|
|
724
|
+
} = {},
|
|
725
|
+
} = template.versions.base;
|
|
726
|
+
templateData.content = text;
|
|
727
|
+
if (imageURL) {
|
|
728
|
+
templateData.url = imageURL;
|
|
729
|
+
}
|
|
730
|
+
if (buttonURL && buttonText) {
|
|
731
|
+
templateData.buttonText = buttonText;
|
|
732
|
+
}
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
680
735
|
default:
|
|
681
736
|
templateData.content = "";
|
|
682
737
|
}
|
|
@@ -1174,6 +1229,15 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1174
1229
|
this.props.lineActions.clearCreateResponse();
|
|
1175
1230
|
}
|
|
1176
1231
|
});
|
|
1232
|
+
} else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
1233
|
+
this.props.viberActions.createTemplate(duplicateObj, (response) => {
|
|
1234
|
+
if (response && response.templateId) {
|
|
1235
|
+
const message = `${this.state.channel} ${this.props.intl.formatMessage(messages.templateDuplicateSuccess)}`;
|
|
1236
|
+
CapNotification.success({key: 'duplicateSucess', message});
|
|
1237
|
+
this.getAllTemplates({params, resetPage: true});
|
|
1238
|
+
this.props.viberActions.clearCreateResponse();
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1177
1241
|
}
|
|
1178
1242
|
}
|
|
1179
1243
|
|
|
@@ -1255,6 +1319,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1255
1319
|
pathName += `/${options.account}`;
|
|
1256
1320
|
}
|
|
1257
1321
|
}
|
|
1322
|
+
if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
|
|
1323
|
+
pathName = `/viber/edit/${id}/`;
|
|
1324
|
+
}
|
|
1258
1325
|
if (this.state.channel.toUpperCase() === WECHAT) {
|
|
1259
1326
|
if (get(template, 'definition.msgcontent', '') === "RICH_MEDIA_WECHAT") {
|
|
1260
1327
|
pathName = `/wechat/richmedia/edit/${id}`;
|
|
@@ -1553,6 +1620,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1553
1620
|
} = Templates;
|
|
1554
1621
|
const lineLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'line');
|
|
1555
1622
|
const smsLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'sms');
|
|
1623
|
+
const viberLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === VIBER_CHANNEL);
|
|
1556
1624
|
const wechatLoader = (((this.state.selectedAccount !== '' && getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'wechat');
|
|
1557
1625
|
const mobilePushLoader = (((getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
|
|
1558
1626
|
const emailLoader = (
|
|
@@ -1566,7 +1634,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1566
1634
|
(emailLoader !== undefined ? emailLoader : false) ||
|
|
1567
1635
|
(ebillLoader !== undefined ? ebillLoader : false) ||
|
|
1568
1636
|
(mobilePushLoader !== undefined ? mobilePushLoader : false) ||
|
|
1569
|
-
(lineLoader !== undefined ? lineLoader : false)
|
|
1637
|
+
(lineLoader !== undefined ? lineLoader : false) ||
|
|
1638
|
+
(viberLoader !== undefined ? viberLoader : false);
|
|
1570
1639
|
return isLoading;
|
|
1571
1640
|
}
|
|
1572
1641
|
getChannelTypeIllustrationInfo = (type) => {
|
|
@@ -1648,6 +1717,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1648
1717
|
const isMobilePushChannel = channel === MOBILE_PUSH;
|
|
1649
1718
|
const isLineChannel = channel === LINE;
|
|
1650
1719
|
|
|
1720
|
+
|
|
1651
1721
|
if ((isWechatChannel || isMobilePushChannel || isLineChannel) && !isEmpty(weCrmAccounts)) {
|
|
1652
1722
|
forEach(weCrmAccounts, (account) => {
|
|
1653
1723
|
if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || isMobilePushChannel || isLineChannel) {
|
|
@@ -1706,6 +1776,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1706
1776
|
noAccountHeader = messages.noAccountsPresentLine;
|
|
1707
1777
|
break;
|
|
1708
1778
|
}
|
|
1779
|
+
case VIBER: {
|
|
1780
|
+
noAccountHeader = messages.noAccountsPresentViber;
|
|
1781
|
+
break;
|
|
1782
|
+
}
|
|
1709
1783
|
default:
|
|
1710
1784
|
break;
|
|
1711
1785
|
}
|
|
@@ -1764,7 +1838,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1764
1838
|
render() {
|
|
1765
1839
|
const isFullMode = this.isFullMode();
|
|
1766
1840
|
const { activeMode, channel, wechatFilter, lineFilter } = this.state;
|
|
1767
|
-
|
|
1841
|
+
const showForViber = (channel.toLowerCase() !== VIBER_CHANNEL || (channel.toLowerCase() === VIBER_CHANNEL && isEmpty(get(this.props, 'Templates.selectedViberAccount', {}))));
|
|
1842
|
+
if (activeMode === ACCOUNT_SELECTION_MODE && showForViber ) {
|
|
1768
1843
|
return this.renderAccountSelection();
|
|
1769
1844
|
}
|
|
1770
1845
|
const pageHeader = "";
|
|
@@ -1977,6 +2052,7 @@ Templates.propTypes = {
|
|
|
1977
2052
|
isFullMode: PropTypes.bool,
|
|
1978
2053
|
handlePeviewTemplate: PropTypes.func,
|
|
1979
2054
|
router: PropTypes.object,
|
|
2055
|
+
viberActions: PropTypes.object,
|
|
1980
2056
|
};
|
|
1981
2057
|
|
|
1982
2058
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1989,6 +2065,7 @@ const mapStateToProps = createStructuredSelector({
|
|
|
1989
2065
|
EmailCreate: makeSelectCreateEmail(),
|
|
1990
2066
|
Global: makeSelectAuthenticated(),
|
|
1991
2067
|
Line: makeSelectLine(),
|
|
2068
|
+
Viber: makeSelectViber(),
|
|
1992
2069
|
});
|
|
1993
2070
|
|
|
1994
2071
|
function mapDispatchToProps(dispatch) {
|
|
@@ -2001,6 +2078,7 @@ function mapDispatchToProps(dispatch) {
|
|
|
2001
2078
|
emailActions: bindActionCreators(emailActions, dispatch),
|
|
2002
2079
|
globalActions: bindActionCreators(globalActions, dispatch),
|
|
2003
2080
|
lineActions: bindActionCreators(lineActions, dispatch),
|
|
2081
|
+
viberActions: bindActionCreators(viberActions, dispatch),
|
|
2004
2082
|
};
|
|
2005
2083
|
}
|
|
2006
2084
|
|
|
@@ -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
|
+
|