@capillarytech/creatives-library 7.10.57 → 7.10.59
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/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +0 -2
- package/containers/Email/index.js +2 -3
- package/index.js +0 -6
- package/package.json +2 -1
- package/routes.js +0 -5
- package/services/api.js +1 -6
- package/utils/v2common.js +0 -13
- package/v2Components/TemplatePreview/_templatePreview.scss +2 -24
- package/v2Components/TemplatePreview/index.js +8 -87
- package/v2Components/TemplatePreview/messages.js +0 -12
- package/v2Containers/App/constants.js +1 -4
- package/v2Containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +0 -2
- package/v2Containers/Cap/messages.js +1 -12
- package/v2Containers/CreativesContainer/SlideBoxContent.js +7 -42
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +14 -55
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +4 -93
- package/v2Containers/CreativesContainer/messages.js +0 -8
- package/v2Containers/Email/index.js +1 -3
- package/v2Containers/Line/Container/index.js +1 -1
- package/v2Containers/Templates/_templates.scss +0 -64
- package/v2Containers/Templates/actions.js +10 -12
- package/v2Containers/Templates/constants.js +1 -3
- package/v2Containers/Templates/index.js +72 -419
- package/v2Containers/Templates/messages.js +2 -58
- package/v2Containers/Templates/reducer.js +1 -3
- package/v2Containers/TemplatesV2/index.js +0 -17
- package/v2Containers/TemplatesV2/messages.js +0 -4
|
@@ -31,7 +31,6 @@ import { IMAGE as LINE_IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, VIDEO as LINE_VIDEO, TE
|
|
|
31
31
|
import {IMAGE, VIDEO } from '../Facebook/Advertisement/constant';
|
|
32
32
|
import { CREATIVE } from '../Facebook/constants';
|
|
33
33
|
import { LOYALTY } from '../App/constants';
|
|
34
|
-
import { WHATSAPP_STATUSES } from '../Whatsapp/constants';
|
|
35
34
|
|
|
36
35
|
|
|
37
36
|
const classPrefix = 'add-creatives-section';
|
|
@@ -365,42 +364,6 @@ class Creatives extends React.Component {
|
|
|
365
364
|
};
|
|
366
365
|
break;
|
|
367
366
|
}
|
|
368
|
-
case constants.WHATSAPP: {
|
|
369
|
-
const {
|
|
370
|
-
templateConfigs: {
|
|
371
|
-
name,
|
|
372
|
-
template,
|
|
373
|
-
varMapped,
|
|
374
|
-
language,
|
|
375
|
-
category,
|
|
376
|
-
mediaType
|
|
377
|
-
}
|
|
378
|
-
} = templateData;
|
|
379
|
-
creativesTemplateData = {
|
|
380
|
-
type: constants.WHATSAPP,
|
|
381
|
-
edit: true,
|
|
382
|
-
name,
|
|
383
|
-
versions: {
|
|
384
|
-
base: {
|
|
385
|
-
content: {
|
|
386
|
-
whatsapp: {
|
|
387
|
-
status: WHATSAPP_STATUSES.approved,
|
|
388
|
-
category,
|
|
389
|
-
varMapped,
|
|
390
|
-
mediaType,
|
|
391
|
-
languages: [
|
|
392
|
-
{
|
|
393
|
-
language,
|
|
394
|
-
content: `$'${template}'`,
|
|
395
|
-
}
|
|
396
|
-
]
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
};
|
|
402
|
-
break;
|
|
403
|
-
}
|
|
404
367
|
default:
|
|
405
368
|
break;
|
|
406
369
|
}
|
|
@@ -457,8 +420,8 @@ class Creatives extends React.Component {
|
|
|
457
420
|
if (get(template, "value.versions.base")) {
|
|
458
421
|
const mobilpushTemplate = template.value;
|
|
459
422
|
templateData.accountId = get(mobilpushTemplate, 'definition.accountId');
|
|
460
|
-
const type = (get(this.props,
|
|
461
|
-
if
|
|
423
|
+
const type = (get(this.props,"messageDetails.type") || '').toLowerCase();
|
|
424
|
+
if(type === LOYALTY){
|
|
462
425
|
templateData.licenseCode = get(mobilpushTemplate, 'definition.licenseCode');
|
|
463
426
|
}
|
|
464
427
|
const androidContent = get(mobilpushTemplate, 'versions.base.ANDROID');
|
|
@@ -532,38 +495,6 @@ class Creatives extends React.Component {
|
|
|
532
495
|
};
|
|
533
496
|
}
|
|
534
497
|
break;
|
|
535
|
-
case constants.WHATSAPP:
|
|
536
|
-
if (template.value) {
|
|
537
|
-
const { Templates, templateData: templateDataProps } = this.props;
|
|
538
|
-
const { accountDetails: selectedAccountDetails, accountId: selectedAccountId } = templateDataProps || {};
|
|
539
|
-
const selectedWhatsappAccount = Templates?.selectedWhatsappAccount;
|
|
540
|
-
const accountDetails = (selectedWhatsappAccount ? selectedWhatsappAccount : selectedAccountDetails);
|
|
541
|
-
const accountId = selectedAccountId || (selectedWhatsappAccount?.id || '');
|
|
542
|
-
const { versions } = template.value;
|
|
543
|
-
const {
|
|
544
|
-
languages,
|
|
545
|
-
mediaType,
|
|
546
|
-
category,
|
|
547
|
-
templateEditor,
|
|
548
|
-
varMapped
|
|
549
|
-
} = cloneDeep(versions.base.content.whatsapp);
|
|
550
|
-
templateData = {
|
|
551
|
-
channel,
|
|
552
|
-
accountId,
|
|
553
|
-
accountName: accountDetails.name,
|
|
554
|
-
messageBody: languages[0].content,
|
|
555
|
-
templateConfigs: {
|
|
556
|
-
id: template._id,
|
|
557
|
-
name: template?.value?.name,
|
|
558
|
-
template: templateEditor,
|
|
559
|
-
varMapped,
|
|
560
|
-
category,
|
|
561
|
-
language: languages[0].language,
|
|
562
|
-
mediaType,
|
|
563
|
-
},
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
break;
|
|
567
498
|
case constants.FACEBOOK: {
|
|
568
499
|
if (template.value) {
|
|
569
500
|
const FacebookAd = template?.value?.versions?.base?.content?.FacebookAd;
|
|
@@ -729,13 +660,11 @@ class Creatives extends React.Component {
|
|
|
729
660
|
});
|
|
730
661
|
}
|
|
731
662
|
handleCloseSlideBox = () => {
|
|
732
|
-
const { currentChannel = '', slidBoxContent = '' } = this.state;
|
|
733
|
-
const reloadTemplates = currentChannel === constants.WHATSAPP && slidBoxContent === 'editTemplate';
|
|
734
663
|
this.setState((prevState) => ({
|
|
735
664
|
...prevState,
|
|
736
665
|
templateData: undefined,
|
|
737
666
|
showSlideBox: false,
|
|
738
|
-
}),
|
|
667
|
+
}), this.props.handleCloseCreatives);
|
|
739
668
|
};
|
|
740
669
|
saveMessage = () => {
|
|
741
670
|
this.setState({ isGetFormData: true });
|
|
@@ -890,24 +819,7 @@ class Creatives extends React.Component {
|
|
|
890
819
|
}
|
|
891
820
|
render() {
|
|
892
821
|
const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
|
|
893
|
-
const {
|
|
894
|
-
isFullMode,
|
|
895
|
-
creativesMode,
|
|
896
|
-
cap,
|
|
897
|
-
isUploading,
|
|
898
|
-
channelsToHide,
|
|
899
|
-
selectedWeChatAccount,
|
|
900
|
-
forwardedTags,
|
|
901
|
-
channelsToDisable,
|
|
902
|
-
selectedOfferDetails,
|
|
903
|
-
onTestContentClicked,
|
|
904
|
-
onPreviewContentClicked,
|
|
905
|
-
getCreativesData,
|
|
906
|
-
fetchingCmsData,
|
|
907
|
-
editor,
|
|
908
|
-
smsRegister,
|
|
909
|
-
enableNewChannels,
|
|
910
|
-
} = this.props;
|
|
822
|
+
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData, editor, smsRegister} = this.props;
|
|
911
823
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
912
824
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
913
825
|
return (
|
|
@@ -988,7 +900,6 @@ class Creatives extends React.Component {
|
|
|
988
900
|
smsRegister={smsRegister}
|
|
989
901
|
messageStrategy={this.props.strategy}
|
|
990
902
|
orgUnitId={this.props.orgUnitId}
|
|
991
|
-
enableNewChannels={enableNewChannels}
|
|
992
903
|
/>
|
|
993
904
|
}
|
|
994
905
|
footer={this.shouldShowFooter() &&
|
|
@@ -306,12 +306,4 @@ export default defineMessages({
|
|
|
306
306
|
id: `${scope}.UploadSMStemplates`,
|
|
307
307
|
defaultMessage: `Upload SMS templates`,
|
|
308
308
|
},
|
|
309
|
-
"whatsappOverview": {
|
|
310
|
-
id: `${scope}.whatsappOverview`,
|
|
311
|
-
defaultMessage: `WhatsApp template overview`,
|
|
312
|
-
},
|
|
313
|
-
"whatsappTemplate": {
|
|
314
|
-
id: `${scope}.whatsappTemplate`,
|
|
315
|
-
defaultMessage: `WhatsApp template`,
|
|
316
|
-
},
|
|
317
309
|
});
|
|
@@ -2179,9 +2179,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2179
2179
|
} else {
|
|
2180
2180
|
this.setState({injectedTags: data.tags});
|
|
2181
2181
|
}
|
|
2182
|
-
|
|
2183
|
-
this.props.globalActions.setInjectedTags(data.tags);
|
|
2184
|
-
}
|
|
2182
|
+
this.props.globalActions.setInjectedTags(data.tags);
|
|
2185
2183
|
}
|
|
2186
2184
|
|
|
2187
2185
|
startLoading = (ifEdit) => {
|
|
@@ -83,7 +83,7 @@ export const LineContainer = ({
|
|
|
83
83
|
|
|
84
84
|
const onAccountSelect = (account) => {
|
|
85
85
|
const { value } = account.target;
|
|
86
|
-
templateActions.
|
|
86
|
+
templateActions.setLineAccount(Templates.weCrmAccounts.find((item) => item.name === value));
|
|
87
87
|
updateSelectedAccount(value);
|
|
88
88
|
updateAccountSelectFlow(false);
|
|
89
89
|
createNew();
|
|
@@ -19,25 +19,6 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.creatives-templates-list {
|
|
22
|
-
|
|
23
|
-
.delete-template-confirm {
|
|
24
|
-
.ant-modal-footer {
|
|
25
|
-
padding: $CAP_SPACE_16 $CAP_SPACE_24 $CAP_SPACE_24 $CAP_SPACE_24;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.ant-modal-header {
|
|
29
|
-
padding: $CAP_SPACE_24 $CAP_SPACE_24 $CAP_SPACE_08 $CAP_SPACE_24;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.ant-modal-body {
|
|
33
|
-
padding: 0 $CAP_SPACE_24;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.ant-modal-close-x {
|
|
37
|
-
padding: $CAP_SPACE_12;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
22
|
.pagination-container {
|
|
42
23
|
.FACEBOOK {
|
|
43
24
|
.ant-card-body {
|
|
@@ -151,20 +132,6 @@
|
|
|
151
132
|
|
|
152
133
|
}
|
|
153
134
|
}
|
|
154
|
-
|
|
155
|
-
.create-new-link{
|
|
156
|
-
.ant-anchor-link {
|
|
157
|
-
display: flex;
|
|
158
|
-
|
|
159
|
-
.ant-anchor-link-title {
|
|
160
|
-
margin: 0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.cap-link-v2-suffix {
|
|
164
|
-
margin-top: -2px;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
135
|
}
|
|
169
136
|
|
|
170
137
|
.card-title {
|
|
@@ -532,34 +499,3 @@
|
|
|
532
499
|
box-shadow: none;
|
|
533
500
|
}
|
|
534
501
|
}
|
|
535
|
-
|
|
536
|
-
.whatsapp-filters {
|
|
537
|
-
display: flex;
|
|
538
|
-
width: 100%;
|
|
539
|
-
padding-left: 8px;
|
|
540
|
-
padding-bottom: 16px;
|
|
541
|
-
.cap-select-filter-v2 {
|
|
542
|
-
margin: 0 8px;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
.selected-whatsapp-filters {
|
|
547
|
-
margin-top: -16px;
|
|
548
|
-
|
|
549
|
-
.cap-tag-v2{
|
|
550
|
-
font-size: 12px;
|
|
551
|
-
color: $CAP_G04;
|
|
552
|
-
white-space: pre-wrap;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
.ant-anchor-link-title {
|
|
556
|
-
font-size: 12px;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.whatsapp-illustration-desc {
|
|
561
|
-
font-size: 14px;
|
|
562
|
-
color: rgba(0, 0, 0, 0.87);
|
|
563
|
-
margin: 8px 0;
|
|
564
|
-
white-space: pre-wrap;
|
|
565
|
-
}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as types from './constants';
|
|
8
|
-
import { LINE, WHATSAPP } from '../CreativesContainer/constants';
|
|
9
8
|
|
|
10
9
|
export function getAllTemplates(channel, queryParams) {
|
|
10
|
+
//
|
|
11
11
|
return {
|
|
12
12
|
type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
|
|
13
13
|
};
|
|
@@ -26,6 +26,7 @@ export function resetAccount() {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function deleteTemplate(channel, id) {
|
|
29
|
+
|
|
29
30
|
return {
|
|
30
31
|
type: types.DELETE_TEMPLATE_REQUEST, channel, id,
|
|
31
32
|
};
|
|
@@ -50,23 +51,18 @@ export function getAccountsSettings() {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export function setWeChatAccount(weChatAccount) {
|
|
54
|
+
|
|
53
55
|
return {
|
|
54
56
|
type: types.SET_WECHAT_ACCOUNT,
|
|
55
57
|
weChatAccount,
|
|
56
58
|
};
|
|
57
59
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
|
|
61
|
+
export function setLineAccount(lineAccount) {
|
|
62
|
+
return {
|
|
63
|
+
type: types.SET_LINE_ACCOUNT,
|
|
64
|
+
lineAccount,
|
|
62
65
|
};
|
|
63
|
-
if (channelTypeMapping[channel]) {
|
|
64
|
-
return {
|
|
65
|
-
type: channelTypeMapping[channel],
|
|
66
|
-
account,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
return {};
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
export function setViberAccount(viberAccount) {
|
|
@@ -118,6 +114,7 @@ export function setBEETemplate(template) {
|
|
|
118
114
|
};
|
|
119
115
|
}
|
|
120
116
|
export function getTemplateDetails(id, channel) {
|
|
117
|
+
|
|
121
118
|
return {
|
|
122
119
|
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
123
120
|
id,
|
|
@@ -132,6 +129,7 @@ export function resetTemplateData() {
|
|
|
132
129
|
}
|
|
133
130
|
|
|
134
131
|
export function resetUploadData() {
|
|
132
|
+
|
|
135
133
|
return {
|
|
136
134
|
type: types.RESET_UPLOAD_DATA,
|
|
137
135
|
};
|
|
@@ -45,7 +45,7 @@ export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPL
|
|
|
45
45
|
export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
|
|
46
46
|
export const SET_VIBER_ACCOUNT = "app/v2Containers/Templates/SET_VIBER_ACCOUNT";
|
|
47
47
|
export const SET_FACEBOOK_ACCOUNT = "app/v2Containers/Templates/SET_FACEBOOK_ACCOUNT";
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
|
|
50
50
|
export const GET_DEAFULT_BEE_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_REQUEST';
|
|
51
51
|
export const GET_DEAFULT_BEE_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_SUCCESS';
|
|
@@ -57,5 +57,3 @@ export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_SUCCESS =
|
|
|
57
57
|
'app/v2Containers/Templates/GET_ORG_LEVEL_CAMPAIGN_SETTINGS_SUCCESS';
|
|
58
58
|
export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE =
|
|
59
59
|
'app/v2Containers/Templates/GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE';
|
|
60
|
-
|
|
61
|
-
export const MAX_WHATSAPP_TEMPLATES = 250;
|