@capillarytech/creatives-library 6.12.10 → 6.12.12
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/package.json +2 -2
- package/telepresence.log +57 -0
- package/v2Components/BeeEditor/index.js +263 -0
- package/v2Components/BeeEditor/index.scss +11 -0
- package/v2Components/BeeEditor/messages.js +71 -0
- package/v2Components/BeeEditor/tests/index.test.js +10 -0
- package/v2Containers/Cap/constants.js +0 -4
- package/v2Containers/Cap/index.js +6 -210
- package/v2Containers/Cap/messages.js +0 -41
- package/v2Containers/Email/index.js +1 -2
- 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
|
@@ -2,15 +2,15 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Helmet from 'react-helmet';
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
|
-
import {
|
|
5
|
+
import {CapNotification} from '@capillarytech/cap-ui-library';
|
|
6
6
|
import { bindActionCreators } from 'redux';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { createStructuredSelector } from 'reselect';
|
|
9
9
|
import _ from 'lodash';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
// import 'moment/locale/zh-cn';
|
|
12
|
-
import { GA
|
|
13
|
-
import { injectIntl, FormattedMessage
|
|
12
|
+
import { GA } from '@capillarytech/cap-ui-utils';
|
|
13
|
+
import { injectIntl, FormattedMessage } from 'react-intl';
|
|
14
14
|
import messages from './messages';
|
|
15
15
|
import { makeSelectAuthenticated, makeSelectUser } from './selectors';
|
|
16
16
|
import * as actions from './actions';
|
|
@@ -25,24 +25,8 @@ import {
|
|
|
25
25
|
HELP_URL,
|
|
26
26
|
ORG_SETTINGS_URL,
|
|
27
27
|
CAMPAIGN_SETTINGS_URL,
|
|
28
|
-
ORG_REFRESH_SEC,
|
|
29
|
-
ORG_CHANGED
|
|
30
28
|
} from './constants';
|
|
31
|
-
import './_cap.scss';
|
|
32
|
-
import { BugsnagClient } from '../../app';
|
|
33
|
-
|
|
34
29
|
const gtm = window.dataLayer || [];
|
|
35
|
-
const {
|
|
36
|
-
logNewTab,
|
|
37
|
-
getOrgNameFromId,
|
|
38
|
-
tabBeforeUnloadEventHandler,
|
|
39
|
-
utilsHandleStorageChange,
|
|
40
|
-
isMultipleTabsOpen,
|
|
41
|
-
} = multipleOrgSwitch;
|
|
42
|
-
const {
|
|
43
|
-
loadSessionItem,
|
|
44
|
-
saveSessionItem,
|
|
45
|
-
} = utilsSessionStorageApi;
|
|
46
30
|
|
|
47
31
|
const CapWrapper = styled.div`
|
|
48
32
|
margin: 0 auto;
|
|
@@ -61,11 +45,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
61
45
|
this.state = {
|
|
62
46
|
switchedOrg: false,
|
|
63
47
|
isCreativesAccessible: true,
|
|
64
|
-
refreshSeconds: ORG_REFRESH_SEC,
|
|
65
|
-
selectedOrgId: null,
|
|
66
|
-
showRefreshModal: false,
|
|
67
|
-
showOrgChangeModal: false,
|
|
68
|
-
localStorageOrgInfo: { oldValue: null, newValue: null },
|
|
69
48
|
};
|
|
70
49
|
this.changeOrg = this.changeOrg.bind(this);
|
|
71
50
|
this.logout = this.logout.bind(this);
|
|
@@ -106,14 +85,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
106
85
|
//locale = 'zh';
|
|
107
86
|
console.log('Setting final locale as', locale);
|
|
108
87
|
moment.locale(locale);
|
|
109
|
-
window.addEventListener('storage', this.handleStorageChange, false);
|
|
110
|
-
document.addEventListener(
|
|
111
|
-
'visibilitychange',
|
|
112
|
-
this.handleVisibilityChange,
|
|
113
|
-
false,
|
|
114
|
-
);
|
|
115
|
-
window.addEventListener('pageshow', this.tabOnloadEventHandler, false);
|
|
116
|
-
window.addEventListener('pagehide', tabBeforeUnloadEventHandler, false);
|
|
117
88
|
}
|
|
118
89
|
|
|
119
90
|
componentWillReceiveProps(nextProps) {
|
|
@@ -148,41 +119,10 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
148
119
|
}
|
|
149
120
|
}
|
|
150
121
|
|
|
151
|
-
componentDidUpdate(prevProps) {
|
|
152
|
-
if (
|
|
153
|
-
!(prevProps.Global.currentOrgDetails) &&
|
|
154
|
-
this.props.Global.currentOrgDetails &&
|
|
155
|
-
loadSessionItem(ORG_CHANGED)
|
|
156
|
-
) {
|
|
157
|
-
this.showOrgChangeSnackBar();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
122
|
componentWillUnmount() {
|
|
162
123
|
this.setState({ switchedOrg: false });
|
|
163
124
|
this.props.actions.clearTopbarMenuData();
|
|
164
|
-
window.removeEventListener('storage', this.handleStorageChange, false);
|
|
165
|
-
document.removeEventListener(
|
|
166
|
-
'visibilitychange',
|
|
167
|
-
this.handleVisibilityChange,
|
|
168
|
-
false,
|
|
169
|
-
);
|
|
170
|
-
window.removeEventListener(
|
|
171
|
-
'pageshow',
|
|
172
|
-
this.tabOnloadEventHandler,
|
|
173
|
-
false,
|
|
174
|
-
);
|
|
175
|
-
window.removeEventListener(
|
|
176
|
-
'pagehide',
|
|
177
|
-
tabBeforeUnloadEventHandler,
|
|
178
|
-
false,
|
|
179
|
-
);
|
|
180
125
|
}
|
|
181
|
-
|
|
182
|
-
tabOnloadEventHandler = () => {
|
|
183
|
-
logNewTab(BugsnagClient);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
126
|
setDimensionData() {
|
|
187
127
|
const userGtmData = this.getUserGtmData();
|
|
188
128
|
Object.values(userGtmData).forEach((value, index) => {
|
|
@@ -218,7 +158,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
218
158
|
};
|
|
219
159
|
return map[locale];
|
|
220
160
|
}
|
|
221
|
-
|
|
222
161
|
handleRemoveMessage(messageIndex) {
|
|
223
162
|
this.props.actions.removeMessageFromQueue(messageIndex);
|
|
224
163
|
}
|
|
@@ -233,157 +172,17 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
233
172
|
this.props.actions.logout();
|
|
234
173
|
}
|
|
235
174
|
changeOrg(orgId) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this.setState({
|
|
239
|
-
showOrgChangeModal: true,
|
|
240
|
-
selectedOrgId: orgId,
|
|
241
|
-
});
|
|
242
|
-
} else {
|
|
243
|
-
this.props.actions.changeOrg(orgId);
|
|
244
|
-
}
|
|
175
|
+
this.props.actions.changeOrg(orgId);
|
|
176
|
+
this.navigateToDashboard();
|
|
245
177
|
}
|
|
246
178
|
|
|
247
|
-
showOrgChangeSnackBar = () => {
|
|
248
|
-
saveSessionItem(ORG_CHANGED, false);
|
|
249
|
-
const {
|
|
250
|
-
Global: {
|
|
251
|
-
currentOrgDetails: {
|
|
252
|
-
basic_details: { name: currentOrgName } = {},
|
|
253
|
-
} = {},
|
|
254
|
-
} = {},
|
|
255
|
-
intl: { formatMessage } = {},
|
|
256
|
-
} = this.props;
|
|
257
|
-
CapSnackBar.warning({
|
|
258
|
-
content: (
|
|
259
|
-
<div>
|
|
260
|
-
{formatMessage(messages.orgChangedText)}
|
|
261
|
-
<b>
|
|
262
|
-
{formatMessage(messages.newOrgName, {
|
|
263
|
-
newOrgName: currentOrgName,
|
|
264
|
-
})}
|
|
265
|
-
</b>
|
|
266
|
-
</div>
|
|
267
|
-
),
|
|
268
|
-
showCloseIcon: true,
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
handleVisibilityChange = () => {
|
|
273
|
-
const activeDoc = document.hidden || false;
|
|
274
|
-
const { showRefreshModal, refreshSeconds } = this.state;
|
|
275
|
-
if (
|
|
276
|
-
activeDoc === false &&
|
|
277
|
-
showRefreshModal &&
|
|
278
|
-
refreshSeconds === ORG_REFRESH_SEC
|
|
279
|
-
) {
|
|
280
|
-
const timer = setInterval(() => {
|
|
281
|
-
this.setState(prevState => ({
|
|
282
|
-
refreshSeconds: prevState.refreshSeconds - 1,
|
|
283
|
-
}));
|
|
284
|
-
}, 1000);
|
|
285
|
-
setTimeout(() => {
|
|
286
|
-
clearInterval(timer);
|
|
287
|
-
saveSessionItem(ORG_CHANGED, true);
|
|
288
|
-
this.navigateToDashboard();
|
|
289
|
-
}, refreshSeconds * 1000);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
handleStorageChange = (e) => {
|
|
294
|
-
const { oldValue, newValue } = e;
|
|
295
|
-
if (utilsHandleStorageChange(e, 'orgID')) {
|
|
296
|
-
const localStorageOrgInfo = { oldValue, newValue };
|
|
297
|
-
this.setState({ showRefreshModal: true, localStorageOrgInfo });
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
renderOrgRefreshModal = () => {
|
|
302
|
-
const {
|
|
303
|
-
localStorageOrgInfo: { oldValue: oldOrgId, newValue: newOrgId } = {},
|
|
304
|
-
showRefreshModal,
|
|
305
|
-
refreshSeconds,
|
|
306
|
-
} = this.state;
|
|
307
|
-
const {
|
|
308
|
-
Global: { user: { proxyOrgList } = {} } = {},
|
|
309
|
-
intl: { formatMessage } = {},
|
|
310
|
-
} = this.props;
|
|
311
|
-
const oldOrgName = getOrgNameFromId(Number(oldOrgId), proxyOrgList);
|
|
312
|
-
const newOrgName = getOrgNameFromId(Number(newOrgId), proxyOrgList);
|
|
313
|
-
const modalData = (
|
|
314
|
-
<CapModal
|
|
315
|
-
title={formatMessage(messages.orgRefreshHeading)}
|
|
316
|
-
visible={showRefreshModal}
|
|
317
|
-
closable={false}
|
|
318
|
-
centered
|
|
319
|
-
maskClosable={false}
|
|
320
|
-
footer={null}
|
|
321
|
-
>
|
|
322
|
-
<div className="modal-body">
|
|
323
|
-
<span className="title">
|
|
324
|
-
<FormattedHTMLMessage
|
|
325
|
-
{...messages.refreshOrgText}
|
|
326
|
-
values={{ oldOrgName, newOrgName }}
|
|
327
|
-
/>
|
|
328
|
-
</span>
|
|
329
|
-
<div className="content seconds-right">
|
|
330
|
-
{formatMessage(messages.refreshText, {
|
|
331
|
-
time: `${refreshSeconds}s`,
|
|
332
|
-
})}
|
|
333
|
-
</div>
|
|
334
|
-
</div>
|
|
335
|
-
</CapModal>
|
|
336
|
-
);
|
|
337
|
-
return modalData;
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
renderOrgChangeModal = () => {
|
|
341
|
-
const { selectedOrgId, showOrgChangeModal } = this.state;
|
|
342
|
-
const {
|
|
343
|
-
Global: { user: { proxyOrgList } = {},
|
|
344
|
-
currentOrgDetails: { basic_details: { name: oldOrgName } = {} } = {},
|
|
345
|
-
},
|
|
346
|
-
intl: { formatMessage } = {},
|
|
347
|
-
} = this.props;
|
|
348
|
-
const newOrgName = getOrgNameFromId(selectedOrgId, proxyOrgList);
|
|
349
|
-
return (
|
|
350
|
-
<CapModal
|
|
351
|
-
className="change-org-confirm"
|
|
352
|
-
title={formatMessage(messages.areYouSureText)}
|
|
353
|
-
visible={showOrgChangeModal}
|
|
354
|
-
onOk={this.handleOrgChangeOk}
|
|
355
|
-
onCancel={this.handleOrgChangeCancel}
|
|
356
|
-
centered
|
|
357
|
-
okText={formatMessage(messages.changeOk)}
|
|
358
|
-
cancelText={formatMessage(messages.cancel)}
|
|
359
|
-
>
|
|
360
|
-
<FormattedHTMLMessage
|
|
361
|
-
{...messages.orgChangeText}
|
|
362
|
-
values={{ oldOrgName, newOrgName }}
|
|
363
|
-
/>
|
|
364
|
-
</CapModal>
|
|
365
|
-
);
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
handleOrgChangeOk = () => {
|
|
369
|
-
const { selectedOrgId: orgId } = this.state;
|
|
370
|
-
if (orgId !== null) {
|
|
371
|
-
this.props.actions.changeOrg(orgId);
|
|
372
|
-
this.setState({ showOrgChangeModal: false });
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
|
|
376
|
-
handleOrgChangeCancel = () => {
|
|
377
|
-
this.setState({ showOrgChangeModal: false });
|
|
378
|
-
};
|
|
379
|
-
|
|
380
179
|
render() {
|
|
381
180
|
const { Global, location } = this.props;
|
|
382
181
|
const { topbarMenuData, isLoggedIn, currentOrgDetails } = Global;
|
|
383
182
|
const topbarMenuDataOptions = topbarMenuData && topbarMenuData.data ? topbarMenuData.data : [];
|
|
384
183
|
const type = this.props.location.query.type;
|
|
385
184
|
const toastMessages = this.props.Global.messages;
|
|
386
|
-
const { isCreativesAccessible
|
|
185
|
+
const { isCreativesAccessible } = this.state;
|
|
387
186
|
console.log('v2 locale loading', this.props.loader.localeLoading);
|
|
388
187
|
return (
|
|
389
188
|
<CapWrapper>
|
|
@@ -432,8 +231,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
432
231
|
)
|
|
433
232
|
}
|
|
434
233
|
</> }
|
|
435
|
-
{showRefreshModal && this.renderOrgRefreshModal()}
|
|
436
|
-
{showOrgChangeModal && this.renderOrgChangeModal()}
|
|
437
234
|
</CapWrapper>
|
|
438
235
|
);
|
|
439
236
|
}
|
|
@@ -447,7 +244,6 @@ Cap.propTypes = {
|
|
|
447
244
|
appActions: PropTypes.object,
|
|
448
245
|
locationActions: PropTypes.object,
|
|
449
246
|
location: PropTypes.object,
|
|
450
|
-
intl: intlShape.isRequired,
|
|
451
247
|
};
|
|
452
248
|
|
|
453
249
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -72,45 +72,4 @@ export default defineMessages({
|
|
|
72
72
|
id: 'creatives.containersV2.incentive',
|
|
73
73
|
defaultMessage: 'Incentive',
|
|
74
74
|
},
|
|
75
|
-
|
|
76
|
-
//refresh due to org change messages
|
|
77
|
-
|
|
78
|
-
"refreshOrgText": {
|
|
79
|
-
id: `creatives.containersV2.refreshOrgText`,
|
|
80
|
-
defaultMessage:
|
|
81
|
-
'Refreshing this page & changing the Org from <b>{oldOrgName}</b> to <b>{newOrgName}</b>. At a time only one Org can be selected on the browser.',
|
|
82
|
-
},
|
|
83
|
-
"refreshText": {
|
|
84
|
-
id: `creatives.containersV2.refreshText`,
|
|
85
|
-
defaultMessage: 'Refreshing in {time}...',
|
|
86
|
-
},
|
|
87
|
-
"areYouSureText": {
|
|
88
|
-
id: `creatives.containersV2.areYouSureText`,
|
|
89
|
-
defaultMessage: 'Are you sure?',
|
|
90
|
-
},
|
|
91
|
-
"changeOk": {
|
|
92
|
-
id: `creatives.containersV2.changeOk`,
|
|
93
|
-
defaultMessage: 'Ok, change',
|
|
94
|
-
},
|
|
95
|
-
"cancel": {
|
|
96
|
-
id: `creatives.containersV2.cancel`,
|
|
97
|
-
defaultMessage: 'Cancel',
|
|
98
|
-
},
|
|
99
|
-
"orgChangeText": {
|
|
100
|
-
id: `creatives.containersV2.orgChangeText`,
|
|
101
|
-
defaultMessage:
|
|
102
|
-
'Changing from <b>{oldOrgName}</b> to <b>{newOrgName}</b> will change the organisation for applications open in other tabs as well.<br/>Do you want to make the change to <b>{newOrgName}</b>?',
|
|
103
|
-
},
|
|
104
|
-
"orgChangedText": {
|
|
105
|
-
id: `creatives.containersV2.orgChangedText`,
|
|
106
|
-
defaultMessage: 'Organization changed to ',
|
|
107
|
-
},
|
|
108
|
-
"orgRefreshHeading": {
|
|
109
|
-
id: `creatives.containersV2.orgRefreshHeading`,
|
|
110
|
-
defaultMessage: 'Org refresh',
|
|
111
|
-
},
|
|
112
|
-
"newOrgName": {
|
|
113
|
-
id: `creatives.containersV2.newOrgName`,
|
|
114
|
-
defaultMessage: '{newOrgName}',
|
|
115
|
-
},
|
|
116
75
|
});
|
|
@@ -2666,8 +2666,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2666
2666
|
if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
|
|
2667
2667
|
tags = this.props.supportedTags;
|
|
2668
2668
|
}
|
|
2669
|
-
const
|
|
2670
|
-
const showTestAndPreview = !showImageSelectionBox && getDefaultTags === 'outbound';
|
|
2669
|
+
const showTestAndPreview = getDefaultTags === 'outbound';
|
|
2671
2670
|
return (
|
|
2672
2671
|
<div className="email-container">
|
|
2673
2672
|
<CapSpin spinning={isLoading}>
|
|
@@ -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';
|