@capillarytech/creatives-library 7.1.7 → 7.1.11
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/containers/Templates/index.js +1 -1
- package/favicon.ico +0 -0
- 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/index.js +18 -108
- package/v2Containers/App/constants.js +3 -5
- package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -84
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -5
- 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/old_favicon.ico +0 -0
- package/v2Components/TemplatePreview/assets/images/viberMobile.svg +0 -135
- package/v2Containers/FTP/_FTP.scss +0 -114
- package/v2Containers/FTP/actions.js +0 -7
- package/v2Containers/FTP/constants.js +0 -3
- package/v2Containers/FTP/index.js +0 -599
- package/v2Containers/FTP/messages.js +0 -68
- package/v2Containers/FTP/reducer.js +0 -32
- package/v2Containers/FTP/sagas.js +0 -26
- package/v2Containers/FTP/selectors.js +0 -20
- package/v2Containers/FTP/temp.js +0 -11838
- 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
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
|
-
import cloneDeep from 'lodash/cloneDeep';
|
|
6
5
|
import TemplatesV2 from '../TemplatesV2';
|
|
7
6
|
import TemplatePreview from '../../v2Components/TemplatePreview';
|
|
8
7
|
import SmsCreate from '../Sms/Create';
|
|
@@ -19,8 +18,6 @@ import CallTask from '../CallTask';
|
|
|
19
18
|
import MobliPushEdit from '../MobilePush/Edit';
|
|
20
19
|
import * as constants from './constants';
|
|
21
20
|
import LineContainer from '../Line/Container';
|
|
22
|
-
import FTP from '../FTP';
|
|
23
|
-
import Viber from '../Viber';
|
|
24
21
|
const CreativesWrapper = styled.div`
|
|
25
22
|
.ant-popover,
|
|
26
23
|
.ant-notification,
|
|
@@ -35,6 +32,7 @@ function getWechatTemplateType(mode, templateData, weChatTemplateType = '') {
|
|
|
35
32
|
}
|
|
36
33
|
return weChatTemplateType;
|
|
37
34
|
}
|
|
35
|
+
|
|
38
36
|
const getLineType = ({
|
|
39
37
|
slidBoxContent,
|
|
40
38
|
channel,
|
|
@@ -72,22 +70,6 @@ const getLineType = ({
|
|
|
72
70
|
}
|
|
73
71
|
return {};
|
|
74
72
|
};
|
|
75
|
-
const getViber = ({
|
|
76
|
-
slidBoxContent,
|
|
77
|
-
channel,
|
|
78
|
-
isFullMode,
|
|
79
|
-
templateData,
|
|
80
|
-
}) => {
|
|
81
|
-
if ((channel === constants.VIBER || (slidBoxContent === 'editTemplate' && templateData && templateData.type === constants.VIBER)) && slidBoxContent !== 'templates') {
|
|
82
|
-
const isCreate = slidBoxContent === 'createTemplate';
|
|
83
|
-
const isEdit = slidBoxContent === 'editTemplate';
|
|
84
|
-
return {
|
|
85
|
-
isCreate,
|
|
86
|
-
isEdit,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
return {};
|
|
90
|
-
};
|
|
91
73
|
|
|
92
74
|
function SlideBoxContent(props) {
|
|
93
75
|
const {
|
|
@@ -135,7 +117,6 @@ function SlideBoxContent(props) {
|
|
|
135
117
|
selectedAccount,
|
|
136
118
|
onShowTemplates,
|
|
137
119
|
handleClose,
|
|
138
|
-
onFTPSubmit,
|
|
139
120
|
} = props;
|
|
140
121
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
141
122
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -154,15 +135,6 @@ function SlideBoxContent(props) {
|
|
|
154
135
|
isFullMode,
|
|
155
136
|
templateData,
|
|
156
137
|
});
|
|
157
|
-
const {isCreate: isCreateViber = false,
|
|
158
|
-
isEdit: isEditViber = false } = getViber({
|
|
159
|
-
slidBoxContent,
|
|
160
|
-
channel,
|
|
161
|
-
isFullMode,
|
|
162
|
-
templateData,
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
|
|
166
138
|
const isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
|
|
167
139
|
const isCreateMPush = slidBoxContent === 'createTemplate' && channel === constants.MOBILE_PUSH;
|
|
168
140
|
const isCreateCallTask = slidBoxContent === 'createTemplate' && channel === constants.CALL_TASK;
|
|
@@ -175,7 +147,6 @@ function SlideBoxContent(props) {
|
|
|
175
147
|
let isEditCallTask = false;
|
|
176
148
|
let isEditMPush = false;
|
|
177
149
|
let isEditFacebook = false;
|
|
178
|
-
let isEditFTP = false;
|
|
179
150
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
|
|
180
151
|
if (templateData && channel) {
|
|
181
152
|
channel = templateData.type;// for edit mode with template data
|
|
@@ -185,10 +156,9 @@ function SlideBoxContent(props) {
|
|
|
185
156
|
isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
|
|
186
157
|
isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
|
|
187
158
|
isEditFacebook = slidBoxContent === 'editTemplate' && channel === constants.FACEBOOK;
|
|
188
|
-
isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE
|
|
159
|
+
isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE);
|
|
189
160
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
190
161
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
191
|
-
isEditFTP = slidBoxContent === 'editTemplate' && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
|
|
192
162
|
}
|
|
193
163
|
|
|
194
164
|
const getChannelPreviewContent = (templateDataObject) => {
|
|
@@ -253,20 +223,11 @@ function SlideBoxContent(props) {
|
|
|
253
223
|
return previewContent;
|
|
254
224
|
});
|
|
255
225
|
}
|
|
256
|
-
case constants.VIBER: {
|
|
257
|
-
const template = cloneDeep(templateDataObject);
|
|
258
|
-
const { text = "", imageURL = "", buttonText = "" } = get(template, 'versions.base.content.viber', {});
|
|
259
|
-
template.content = {
|
|
260
|
-
messageContent: text,
|
|
261
|
-
imageURL,
|
|
262
|
-
buttonText,
|
|
263
|
-
};
|
|
264
|
-
return template.content;
|
|
265
|
-
}
|
|
266
226
|
default:
|
|
267
227
|
return get(templateDataObject, `versions.base.content`);
|
|
268
228
|
}
|
|
269
229
|
};
|
|
230
|
+
|
|
270
231
|
return (
|
|
271
232
|
<CreativesWrapper>
|
|
272
233
|
{!isFullMode && slidBoxContent === 'templates' && (
|
|
@@ -289,17 +250,11 @@ function SlideBoxContent(props) {
|
|
|
289
250
|
onCreateComplete={onCreateComplete}
|
|
290
251
|
getFormSubscriptionData={getFormData}
|
|
291
252
|
handleClose={handleClose}
|
|
292
|
-
onFTPSubmit={onFTPSubmit}
|
|
293
|
-
slidBoxContent={slidBoxContent}
|
|
294
|
-
FTPMode="create"
|
|
295
|
-
selectedOfferDetails={selectedOfferDetails}
|
|
296
253
|
/>
|
|
297
254
|
)}
|
|
298
255
|
{isPreview && (
|
|
299
256
|
<TemplatePreview
|
|
300
257
|
content={getChannelPreviewContent(templateData)}
|
|
301
|
-
viberBrandName={selectedAccount || ""}
|
|
302
|
-
viberAccountName={(selectedAccount || "")[0]}
|
|
303
258
|
unicodeEnabled={get(templateData, `versions.base['unicode-validity']`)}
|
|
304
259
|
channel={(templateData.type || '').toLowerCase()}
|
|
305
260
|
charCounterEnabled={channel === constants.SMS}
|
|
@@ -361,14 +316,6 @@ function SlideBoxContent(props) {
|
|
|
361
316
|
onTestContentClicked={onTestContentClicked}
|
|
362
317
|
/>
|
|
363
318
|
)}
|
|
364
|
-
{isEditFTP && (
|
|
365
|
-
<FTP
|
|
366
|
-
mode="edit"
|
|
367
|
-
onFTPSubmit={onFTPSubmit}
|
|
368
|
-
messageDetails={messageDetails}
|
|
369
|
-
selectedOfferDetails={selectedOfferDetails}
|
|
370
|
-
/>
|
|
371
|
-
)}
|
|
372
319
|
{
|
|
373
320
|
isEditCallTask &&
|
|
374
321
|
<CallTask
|
|
@@ -553,33 +500,6 @@ function SlideBoxContent(props) {
|
|
|
553
500
|
/>
|
|
554
501
|
)
|
|
555
502
|
}
|
|
556
|
-
{isCreateViber && (
|
|
557
|
-
<Viber
|
|
558
|
-
location={creativesLocationProps}
|
|
559
|
-
onCreateComplete={onCreateComplete}
|
|
560
|
-
isFullMode={isFullMode}
|
|
561
|
-
handleClose={handleClose}
|
|
562
|
-
isGetFormData={isGetFormData}
|
|
563
|
-
getFormSubscriptionData={getFormData}
|
|
564
|
-
onShowTemplates={onShowTemplates}
|
|
565
|
-
templateData={templateData}
|
|
566
|
-
createNew/>
|
|
567
|
-
)}
|
|
568
|
-
|
|
569
|
-
{isEditViber && <Viber
|
|
570
|
-
location={creativesLocationProps}
|
|
571
|
-
params={{
|
|
572
|
-
id: templateData._id,
|
|
573
|
-
}}
|
|
574
|
-
onCreateComplete={onCreateComplete}
|
|
575
|
-
isFullMode={isFullMode}
|
|
576
|
-
handleClose={handleClose}
|
|
577
|
-
isGetFormData={isGetFormData}
|
|
578
|
-
getFormSubscriptionData={getFormData}
|
|
579
|
-
onShowTemplates={onShowTemplates}
|
|
580
|
-
templateData={templateData}
|
|
581
|
-
createNew/> }
|
|
582
|
-
|
|
583
503
|
</CreativesWrapper>
|
|
584
504
|
);
|
|
585
505
|
}
|
|
@@ -623,6 +543,5 @@ SlideBoxContent.propTypes = {
|
|
|
623
543
|
onCreateComplete: PropTypes.func,
|
|
624
544
|
saveMessage: PropTypes.func,
|
|
625
545
|
selectedAccount: PropTypes.object,
|
|
626
|
-
onFTPSubmit: PropTypes.func,
|
|
627
546
|
};
|
|
628
547
|
export default SlideBoxContent;
|
|
@@ -6,8 +6,6 @@ import moment from 'moment';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import messages from './messages';
|
|
8
8
|
import { MAP_TEMPLATE } from '../WeChat/Wrapper/constants';
|
|
9
|
-
import { NO_COMMUNICATION } from '../App/constants';
|
|
10
|
-
import { FTP } from '../FTP';
|
|
11
9
|
const PrefixWrapper = styled.div`
|
|
12
10
|
margin-right: 16px;
|
|
13
11
|
`;
|
|
@@ -17,8 +15,6 @@ function getChannelLabel(channel = '') {
|
|
|
17
15
|
email: 'Email',
|
|
18
16
|
mobilepush: 'Push notification',
|
|
19
17
|
wechat: 'Wechat',
|
|
20
|
-
no_communication: 'NO_COMMUNICATION',
|
|
21
|
-
ftp: 'FTP',
|
|
22
18
|
};
|
|
23
19
|
return labels[channel.toLowerCase()];
|
|
24
20
|
}
|
|
@@ -31,7 +27,7 @@ function SlideBoxHeader(props) {
|
|
|
31
27
|
{slidBoxContent === 'templates' && !showTemplateNameHeader && (
|
|
32
28
|
<CapHeader
|
|
33
29
|
title={<FormattedMessage {...messages.creativeTemplates} />}
|
|
34
|
-
description={
|
|
30
|
+
description={
|
|
35
31
|
<FormattedMessage {...messages.creativeTemplatesDesc} />
|
|
36
32
|
}
|
|
37
33
|
/>
|
|
@@ -13,9 +13,5 @@ export const CALL_TASK = "CALL_TASK";
|
|
|
13
13
|
export const MOBILE_PUSH = "MOBILEPUSH";
|
|
14
14
|
export const WECHAT = "WECHAT";
|
|
15
15
|
export const FACEBOOK = "FACEBOOK";
|
|
16
|
-
export const FTP = "FTP";
|
|
17
|
-
export const NO_COMMUNICATION = "NO_COMMUNICATION";
|
|
18
|
-
export const VIBER = "VIBER";
|
|
19
|
-
|
|
20
16
|
export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
|
|
21
17
|
export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from '@capillarytech/cap-ui-library';
|
|
6
6
|
import { injectIntl, FormattedMessage } from 'react-intl';
|
|
7
7
|
import classnames from 'classnames';
|
|
8
|
-
import {isEmpty, get, forEach
|
|
8
|
+
import {isEmpty, get, forEach} from 'lodash';
|
|
9
9
|
import { connect } from 'react-redux';
|
|
10
10
|
import { createStructuredSelector } from 'reselect';
|
|
11
11
|
import { bindActionCreators } from 'redux';
|
|
@@ -18,6 +18,7 @@ import SlideBoxHeader from './SlideBoxHeader';
|
|
|
18
18
|
import SlideBoxFooter from './SlideBoxFooter';
|
|
19
19
|
import * as constants from './constants';
|
|
20
20
|
import * as commonUtil from '../../utils/common';
|
|
21
|
+
|
|
21
22
|
import './index.scss';
|
|
22
23
|
import * as templateActions from '../Templates/actions';
|
|
23
24
|
import * as globalActions from '../Cap/actions';
|
|
@@ -142,13 +143,6 @@ class Creatives extends React.Component {
|
|
|
142
143
|
const {channel} = templateData;
|
|
143
144
|
let creativesTemplateData = {type: channel };
|
|
144
145
|
switch (channel) {
|
|
145
|
-
case constants.NO_COMMUNICATION: {
|
|
146
|
-
creativesTemplateData = {
|
|
147
|
-
type: channel,
|
|
148
|
-
...templateData,
|
|
149
|
-
};
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
146
|
case constants.SMS: {
|
|
153
147
|
const formData = {
|
|
154
148
|
"sms-editor": templateData.messageBody,
|
|
@@ -253,24 +247,6 @@ class Creatives extends React.Component {
|
|
|
253
247
|
};
|
|
254
248
|
break;
|
|
255
249
|
}
|
|
256
|
-
case constants.VIBER: {
|
|
257
|
-
const { messageBody, isDefault } = templateData;
|
|
258
|
-
const viber = JSON.parse(messageBody || '{}');
|
|
259
|
-
creativesTemplateData = {
|
|
260
|
-
type: constants.VIBER,
|
|
261
|
-
isDefault,
|
|
262
|
-
edit: true,
|
|
263
|
-
name: "",
|
|
264
|
-
versions: {
|
|
265
|
-
base: {
|
|
266
|
-
content: {
|
|
267
|
-
...viber,
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
};
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
250
|
default:
|
|
275
251
|
break;
|
|
276
252
|
}
|
|
@@ -356,24 +332,6 @@ class Creatives extends React.Component {
|
|
|
356
332
|
};
|
|
357
333
|
}
|
|
358
334
|
break;
|
|
359
|
-
case constants.VIBER:
|
|
360
|
-
if (template.value) {
|
|
361
|
-
const { Templates, templateData: templateDataProps } = this.props;
|
|
362
|
-
const { accountDetails: selectedAccountDetails, accountId: selectedAccountId } = templateDataProps || {};
|
|
363
|
-
const selectedViberAccount = Templates && Templates.selectedViberAccount;
|
|
364
|
-
const accountDetails = selectedAccountDetails || (selectedViberAccount ? JSON.stringify(selectedViberAccount) : '');
|
|
365
|
-
const accountId = selectedAccountId || (selectedViberAccount ? selectedViberAccount.id : '');
|
|
366
|
-
const { versions } = template.value;
|
|
367
|
-
const content = cloneDeep(versions.base.content);
|
|
368
|
-
content.scenarioKey = get(accountDetails, 'configs.scenario_key');
|
|
369
|
-
templateData = {
|
|
370
|
-
channel,
|
|
371
|
-
accountId,
|
|
372
|
-
accountDetails,
|
|
373
|
-
messageBody: JSON.stringify(content),
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
break;
|
|
377
335
|
default:
|
|
378
336
|
break;
|
|
379
337
|
}
|
|
@@ -488,8 +446,8 @@ class Creatives extends React.Component {
|
|
|
488
446
|
}
|
|
489
447
|
}
|
|
490
448
|
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
449
|
+
const isLineChannel = templateData && templateData.type === constants.LINE;
|
|
450
|
+
if (channel === constants.LINE || isLineChannel) {
|
|
493
451
|
showFooter = false;
|
|
494
452
|
}
|
|
495
453
|
|
|
@@ -648,7 +606,6 @@ class Creatives extends React.Component {
|
|
|
648
606
|
selectedAccount={this.props.selectedAccount}
|
|
649
607
|
onShowTemplates={this.onShowTemplates}
|
|
650
608
|
handleClose={this.handleCloseSlideBox}
|
|
651
|
-
onFTPSubmit={getCreativesData}
|
|
652
609
|
editor={editor}
|
|
653
610
|
/>
|
|
654
611
|
}
|
|
@@ -718,4 +675,4 @@ function mapDispatchToProps(dispatch) {
|
|
|
718
675
|
actions: bindActionCreators(actions, dispatch),
|
|
719
676
|
};
|
|
720
677
|
}
|
|
721
|
-
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
678
|
+
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
@@ -2358,7 +2358,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2358
2358
|
const response = {
|
|
2359
2359
|
action: "getFormData",
|
|
2360
2360
|
postAction: this.state.getFormDataValue || 'next',
|
|
2361
|
-
id : _.get(this.props, 'Email.templateDetails._id', ''),
|
|
2362
2361
|
value: this.transformFormData(passedData),
|
|
2363
2362
|
validity: this.state.isFormValid,
|
|
2364
2363
|
type: 'EMAIL',
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
|
+
|
|
3
|
+
.line-row{
|
|
4
|
+
margin-bottom: 16px;
|
|
5
|
+
}
|
|
6
|
+
.slidebox-content-container {
|
|
7
|
+
overflow-x: hidden;
|
|
8
|
+
}
|
|
9
|
+
.line-image {
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
.image-container {
|
|
13
|
+
display: flex;
|
|
14
|
+
& > div {
|
|
15
|
+
min-width: 516px;
|
|
16
|
+
}
|
|
17
|
+
border-radius: 5px;
|
|
18
|
+
.image-placeholder{
|
|
19
|
+
line-height: 150px;
|
|
20
|
+
}
|
|
21
|
+
img {
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
max-height: 100%;
|
|
25
|
+
height: auto !important;
|
|
26
|
+
width: auto !important;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pagination-container.gallery-upload {
|
|
31
|
+
height: calc(100vh - 60px);
|
|
32
|
+
|
|
33
|
+
.cap-custom-card-list-col {
|
|
34
|
+
max-width: 156px;
|
|
35
|
+
max-height: 156px;
|
|
36
|
+
display: inline-block;
|
|
37
|
+
margin-left: $CAP_SPACE_04;
|
|
38
|
+
margin-right: $CAP_SPACE_04;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ant-card-body {
|
|
42
|
+
padding-top: 0;
|
|
43
|
+
|
|
44
|
+
.ant-card-meta-description img {
|
|
45
|
+
height: 80px;
|
|
46
|
+
width: auto;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.gallery-image {
|
|
52
|
+
height: 156px;
|
|
53
|
+
width: 156px;
|
|
54
|
+
border-radius: 4px;
|
|
55
|
+
margin: 3px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.sms-text {
|
|
59
|
+
img {
|
|
60
|
+
display: block;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
object-fit: cover;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Create actions
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as types from './constants';
|
|
8
|
+
|
|
9
|
+
export function createTemplate(template, callback) {
|
|
10
|
+
console.log('action trigereed createtemplate');
|
|
11
|
+
return {
|
|
12
|
+
type: types.CREATE_TEMPLATE_REQUEST,
|
|
13
|
+
template,
|
|
14
|
+
callback,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function clearCreateResponse() {
|
|
19
|
+
console.log('clearCreateResponse');
|
|
20
|
+
return {
|
|
21
|
+
type: types.CLEAR_CREATE_RESPONSE_REQUEST,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function defaultAction() {
|
|
26
|
+
return {
|
|
27
|
+
type: types.DEFAULT_ACTION,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function uploadAsset(file, assetType, fileParams) {
|
|
32
|
+
return {
|
|
33
|
+
type: types.UPLOAD_ASSET_REQUEST,
|
|
34
|
+
file,
|
|
35
|
+
assetType,
|
|
36
|
+
fileParams,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function clearAsset() {
|
|
41
|
+
return {
|
|
42
|
+
type: types.CLEAR_ASSET,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
// FOR EDIT
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export function editTemplate(template, callback) {
|
|
51
|
+
console.log('action trigereed editTemplate line @@@');
|
|
52
|
+
return {
|
|
53
|
+
type: types.EDIT_TEMPLATE_REQUEST,
|
|
54
|
+
template,
|
|
55
|
+
callback,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function getTemplateDetails(id) {
|
|
60
|
+
console.log('getting template line @@@', id);
|
|
61
|
+
return {
|
|
62
|
+
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
63
|
+
id,
|
|
64
|
+
channel: 'LINE',
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function clearEditResponse() {
|
|
69
|
+
console.log('clearEditResponse');
|
|
70
|
+
return {
|
|
71
|
+
type: types.CLEAR_EDIT_RESPONSE_REQUEST,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function clearData() {
|
|
76
|
+
return {
|
|
77
|
+
type: types.CLEAR_DATA,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function getLineTemplatesList(channel, queryParams) {
|
|
82
|
+
return {
|
|
83
|
+
type: types.GET_LINE_TEMPLATES_LIST_REQUEST,
|
|
84
|
+
channel,
|
|
85
|
+
queryParams,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function setSelectedTemplate(templateData) {
|
|
90
|
+
return {
|
|
91
|
+
type: types.SET_SELECTED_TEMPLATE,
|
|
92
|
+
data: templateData,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Create constants
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_ACTION = 'app/Create/DEFAULT_ACTION';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export const CREATE_TEMPLATE_REQUEST = 'app/v2Containers/Line/Create/CREATE_TEMPLATE_REQUEST';
|
|
11
|
+
export const CREATE_TEMPLATE_SUCCESS = 'app/v2Containers/Line/Create/CREATE_TEMPLATE_SUCCESS';
|
|
12
|
+
export const CREATE_TEMPLATE_FAILURE = 'app/v2Containers/Line/Create/CREATE_TEMPLATE_FAILURE';
|
|
13
|
+
export const UPLOAD_ASSET_REQUEST = 'app/v2Containers/Line/Create/UPLOAD_ASSET_REQUEST';
|
|
14
|
+
export const UPLOAD_ASSET_SUCCESS = 'app/v2Containers/Line/Create/UPLOAD_ASSET_SUCCESS';
|
|
15
|
+
export const UPLOAD_ASSET_FAILURE = 'app/v2Containers/Line/Create/UPLOAD_ASSET_FAILURE';
|
|
16
|
+
export const CLEAR_ASSET = 'app/v2Containers/Line/Create/CLEAR_ASSET';
|
|
17
|
+
|
|
18
|
+
export const CLEAR_CREATE_RESPONSE_REQUEST = 'app/v2Containers/Line/Create/CLEAR_CREATE_RESPONSE_REQUEST';
|
|
19
|
+
export const CLEAR_CREATE_RESPONSE_SUCCESS = 'app/v2Containers/Line/Create/CLEAR_CREATE_RESPONSE_SUCCESS';
|
|
20
|
+
export const CLEAR_CREATE_RESPONSE_FAILURE = 'app/v2Containers/Line/Create/CLEAR_CREATE_RESPONSE_FAILURE';
|
|
21
|
+
|
|
22
|
+
export const LINE_IMG_HEIGHT = 400;
|
|
23
|
+
export const LINE_IMG_WIDTH = 300;
|
|
24
|
+
export const LINE_IMG_SIZE = 30000000;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// edit
|
|
28
|
+
|
|
29
|
+
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_REQUEST';
|
|
30
|
+
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
31
|
+
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_FAILURE';
|
|
32
|
+
|
|
33
|
+
export const EDIT_TEMPLATE_REQUEST = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_REQUEST';
|
|
34
|
+
export const EDIT_TEMPLATE_SUCCESS = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_SUCCESS';
|
|
35
|
+
export const EDIT_TEMPLATE_FAILURE = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_FAILURE';
|
|
36
|
+
|
|
37
|
+
export const CLEAR_EDIT_RESPONSE_REQUEST = 'app/v2Containers/line/Edit/CLEAR_EDIT_RESPONSE_REQUEST';
|
|
38
|
+
export const CLEAR_DATA = 'app/v2Containers/Line/Edit/CLEAR_DATA';
|
|
39
|
+
export const SET_SELECTED_TEMPLATE = 'app/v2Containers/Line/Edit/SET_SELECTED_TEMPLATE';
|
|
40
|
+
|
|
41
|
+
export const GET_LINE_TEMPLATES_LIST_REQUEST = 'app/v2Containers/Line/GET_LINE_TEMPLATES_LIST_REQUEST';
|
|
42
|
+
export const GET_LINE_TEMPLATES_LIST_SUCCESS = 'app/v2Containers/Line/GET_LINE_TEMPLATES_LIST_SUCCESS';
|
|
43
|
+
export const GET_LINE_TEMPLATES_LIST_FAILURE = 'app/v2Containers/Line/GET_LINE_TEMPLATES_LIST_FAILURE';
|