@capillarytech/creatives-library 7.17.208-alpha.1 → 7.17.208
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 +1 -1
- package/utils/tagValidations.js +12 -11
- package/utils/tests/tagValidations.test.js +23 -1
- package/v2Components/FormBuilder/index.js +1 -13
- package/v2Containers/BeeEditor/index.js +0 -3
- package/v2Containers/Cap/mockData.js +1 -1
- package/v2Containers/Cap/reducer.js +24 -3
- package/v2Containers/CreativesContainer/SlideBoxContent.js +26 -47
- package/v2Containers/CreativesContainer/index.js +0 -3
- package/v2Containers/Email/index.js +0 -1
- package/v2Containers/EmailWrapper/index.js +0 -3
- package/v2Containers/MobilePush/Create/index.js +0 -2
- package/v2Containers/MobilePush/Edit/index.js +0 -2
- package/v2Containers/MobilepushWrapper/index.js +1 -5
- package/v2Containers/Sms/Create/index.js +0 -2
- package/v2Containers/Sms/Edit/index.js +0 -2
- package/v2Containers/SmsTrai/Edit/index.js +0 -3
- package/v2Containers/SmsWrapper/index.js +0 -2
- package/v2Containers/TagList/index.js +2 -26
- package/v2Containers/TagList/messages.js +0 -4
- package/v2Containers/Viber/index.js +0 -2
- package/v2Containers/Whatsapp/index.js +1 -4
- package/v2Containers/Zalo/index.js +0 -3
package/package.json
CHANGED
package/utils/tagValidations.js
CHANGED
|
@@ -17,11 +17,10 @@ const SUBTAGS = 'subtags';
|
|
|
17
17
|
* @param {Object} response - The response object to check.
|
|
18
18
|
* @param {Object} tagObject - The tagLookupMap.
|
|
19
19
|
*/
|
|
20
|
-
export const checkSupport = (response = {}, tagObject = {}
|
|
20
|
+
export const checkSupport = (response = {}, tagObject = {}) => {
|
|
21
21
|
const supportedList = [];
|
|
22
22
|
// Verifies the presence of the tag in the 'Add Labels' section.
|
|
23
|
-
|
|
24
|
-
const checkNameInTagObjectOrEventContext = (name) => !!tagObject[name] || eventContextTags?.some((tag) => tag?.tagName === name);
|
|
23
|
+
const checkNameInTagObject = (name) => !!tagObject[name];
|
|
25
24
|
|
|
26
25
|
// Verify if childTag is a valid sub-tag of parentTag from the 'Add Labels' section or if it's unsupported.
|
|
27
26
|
const checkSubtags = (parentTag, childName) => {
|
|
@@ -48,7 +47,7 @@ export const checkSupport = (response = {}, tagObject = {}, eventContextTags = [
|
|
|
48
47
|
|
|
49
48
|
//Checks if the tag is present in the Add Label Section
|
|
50
49
|
for (const item of response?.data || []) {
|
|
51
|
-
if (
|
|
50
|
+
if (checkNameInTagObject(item?.name)) {
|
|
52
51
|
supportedList?.push(item?.name);
|
|
53
52
|
}
|
|
54
53
|
//Repeat the process for subtags
|
|
@@ -94,7 +93,6 @@ export const validateTags = ({
|
|
|
94
93
|
injectedTagsParams,
|
|
95
94
|
location,
|
|
96
95
|
tagModule,
|
|
97
|
-
eventContextTags,
|
|
98
96
|
}) => {
|
|
99
97
|
const tags = tagsParam;
|
|
100
98
|
const injectedTags = transformInjectedTags(injectedTagsParams);
|
|
@@ -147,12 +145,6 @@ export const validateTags = ({
|
|
|
147
145
|
}
|
|
148
146
|
}
|
|
149
147
|
}
|
|
150
|
-
// Journey Event Context Tags support
|
|
151
|
-
eventContextTags?.forEach((tag) => {
|
|
152
|
-
if (tagValue === tag?.tagName) {
|
|
153
|
-
ifSupported = true;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
148
|
ifSupported = ifSupported || checkIfSupportedTag(tagValue, injectedTags);
|
|
157
149
|
if (!ifSupported) {
|
|
158
150
|
response.unsupportedTags.push(tagValue);
|
|
@@ -273,4 +265,13 @@ export const preprocessHtml = (content) => {
|
|
|
273
265
|
|
|
274
266
|
// Step 2: Perform the standard replacements on the entire content
|
|
275
267
|
return contentWithStyleFixes?.replace(/'|"|&|<|>|"|\n/g, match => replacements[match]);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
//this is used to get the subtags from custom or extended tags
|
|
271
|
+
export const getTagMapValue = (object = {}) => {
|
|
272
|
+
return Object.values(
|
|
273
|
+
object
|
|
274
|
+
).reduce((acc, current) => {
|
|
275
|
+
return { ...acc?.subtags ?? {}, ...current?.subtags ?? {} };
|
|
276
|
+
}, {});
|
|
276
277
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '@testing-library/jest-dom';
|
|
3
|
-
import { checkSupport, extractNames, preprocessHtml, validateIfTagClosed,validateTags} from '../tagValidations';
|
|
3
|
+
import { checkSupport, extractNames, getTagMapValue, preprocessHtml, validateIfTagClosed,validateTags} from '../tagValidations';
|
|
4
4
|
|
|
5
5
|
describe("check if curly brackets are balanced", () => {
|
|
6
6
|
it("test for balanced curly brackets", () => {
|
|
@@ -421,4 +421,26 @@ describe('preprocessHtml', () => {
|
|
|
421
421
|
expect(preprocessHtml(input)).toEqual(expectedOutput);
|
|
422
422
|
});
|
|
423
423
|
|
|
424
|
+
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
describe("getTagMapValue", () => {
|
|
429
|
+
it("should return an empty object when no object is provided", () => {
|
|
430
|
+
const result = getTagMapValue();
|
|
431
|
+
expect(result).toEqual({});
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
it("should return the tag map value when an object is provided", () => {
|
|
435
|
+
const object = {
|
|
436
|
+
"key 1": {
|
|
437
|
+
name: "23",
|
|
438
|
+
subtags: {
|
|
439
|
+
name: "233",
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
const result = getTagMapValue(object);
|
|
444
|
+
expect(result).toEqual({ name: "233" });
|
|
445
|
+
});
|
|
424
446
|
});
|
|
@@ -1120,8 +1120,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1120
1120
|
// Extracts the supported liquid tags from the given content.
|
|
1121
1121
|
const supportedLiquidTags = checkSupport(
|
|
1122
1122
|
result,
|
|
1123
|
-
this.props?.metaEntities?.tagLookupMap
|
|
1124
|
-
this.props?.eventContextTags
|
|
1123
|
+
this.props?.metaEntities?.tagLookupMap
|
|
1125
1124
|
);
|
|
1126
1125
|
const unsupportedLiquidTags = extractedLiquidTags?.filter(
|
|
1127
1126
|
(tag) => !supportedLiquidTags?.includes(tag) && !this.skipTags(tag)
|
|
@@ -1284,14 +1283,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1284
1283
|
}
|
|
1285
1284
|
}
|
|
1286
1285
|
}
|
|
1287
|
-
|
|
1288
|
-
// Event Context Tags support
|
|
1289
|
-
this.props?.eventContextTags?.forEach((tag) => {
|
|
1290
|
-
if (tagValue === tag?.tagName) {
|
|
1291
|
-
ifSupported = true;
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
|
|
1295
1286
|
ifSupported = ifSupported || this.checkIfSupportedTag(tagValue, injectedTags);
|
|
1296
1287
|
if (!ifSupported && !this.liquidFlow) {
|
|
1297
1288
|
response.unsupportedTags.push(tagValue);
|
|
@@ -2619,7 +2610,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2619
2610
|
id={val.id}
|
|
2620
2611
|
userLocale={this.props.userLocale}
|
|
2621
2612
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
2622
|
-
eventContextTags={this.props.eventContextTags}
|
|
2623
2613
|
/>
|
|
2624
2614
|
</CapColumn>
|
|
2625
2615
|
);
|
|
@@ -3241,7 +3231,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3241
3231
|
userLocale={this.state.translationLang}
|
|
3242
3232
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
3243
3233
|
channel={channel}
|
|
3244
|
-
eventContextTags={this.props.eventContextTags}
|
|
3245
3234
|
/>
|
|
3246
3235
|
</CapColumn>
|
|
3247
3236
|
);
|
|
@@ -3516,7 +3505,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3516
3505
|
saveBeeData={this.props.saveBeeData}
|
|
3517
3506
|
onContextChange={this.props.onContextChange}
|
|
3518
3507
|
moduleFilterEnabled={isModuleFilterEnabled}
|
|
3519
|
-
eventContextTags={this.props.eventContextTags}
|
|
3520
3508
|
/>
|
|
3521
3509
|
</CapColumn>
|
|
3522
3510
|
);
|
|
@@ -48,7 +48,6 @@ function BeeEditor(props) {
|
|
|
48
48
|
actions,
|
|
49
49
|
BEESelect,
|
|
50
50
|
currentOrgDetails,
|
|
51
|
-
eventContextTags,
|
|
52
51
|
} = props;
|
|
53
52
|
const { saveRowRequest } = BEESelect;
|
|
54
53
|
const {formatMessage} = intl;
|
|
@@ -281,7 +280,6 @@ function BeeEditor(props) {
|
|
|
281
280
|
className: "bee-editor-tag-list",
|
|
282
281
|
}}
|
|
283
282
|
onContextChange={onContextChange}
|
|
284
|
-
eventContextTags={eventContextTags}
|
|
285
283
|
/>
|
|
286
284
|
<CapModal
|
|
287
285
|
className="custom-row-modal"
|
|
@@ -325,7 +323,6 @@ BeeEditor.propTypes = {
|
|
|
325
323
|
injectedTags: PropTypes.object,
|
|
326
324
|
onContextChange: PropTypes.func,
|
|
327
325
|
userLocale: PropTypes.string,
|
|
328
|
-
eventContextTags: PropTypes.array,
|
|
329
326
|
};
|
|
330
327
|
|
|
331
328
|
const mapStateToProps = () => createStructuredSelector({
|
|
@@ -7,6 +7,7 @@ import * as types from './constants';
|
|
|
7
7
|
import initialState from '../../initialState';
|
|
8
8
|
import { FAILURE } from '../App/constants';
|
|
9
9
|
import { TAG } from '../Whatsapp/constants';
|
|
10
|
+
import { getTagMapValue } from '../../utils/tagValidations';
|
|
10
11
|
|
|
11
12
|
function capReducer(state = fromJS(initialState.cap), action) {
|
|
12
13
|
switch (action.type) {
|
|
@@ -96,14 +97,34 @@ function capReducer(state = fromJS(initialState.cap), action) {
|
|
|
96
97
|
return state
|
|
97
98
|
.set('fetchingLiquidTags', false)
|
|
98
99
|
case types.GET_SCHEMA_FOR_ENTITY_SUCCESS: {
|
|
99
|
-
|
|
100
|
-
const
|
|
100
|
+
//Process standard tags (same as before)
|
|
101
|
+
const standardTagMapInitial = _.keyBy(
|
|
102
|
+
action?.data?.metaEntities?.standard,
|
|
103
|
+
item => item?.definition?.value
|
|
104
|
+
);
|
|
105
|
+
// Mapping only the `definition` object instead of the entire item, to reduce space used
|
|
106
|
+
const standardTagMap = _.mapValues(standardTagMapInitial, item => ({
|
|
107
|
+
definition: item?.definition ?? {},
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
// Process custom tags
|
|
111
|
+
const customSubtags = getTagMapValue(action?.data?.metaEntities?.custom)
|
|
112
|
+
// Process extended tags
|
|
113
|
+
const extendedSubtags = getTagMapValue(action?.data?.metaEntities?.extended);
|
|
114
|
+
|
|
115
|
+
// Combine all maps
|
|
116
|
+
const combinedTagMap = {
|
|
117
|
+
...standardTagMap,
|
|
118
|
+
...customSubtags,
|
|
119
|
+
...extendedSubtags
|
|
120
|
+
};
|
|
121
|
+
const stateMeta = state.get("metaEntities");
|
|
101
122
|
return state
|
|
102
123
|
.set('fetchingSchema', false)
|
|
103
124
|
.set('metaEntities', {
|
|
104
125
|
layouts: action.data && action.entityType === 'LAYOUT' ? action.data.metaEntities : stateMeta.layouts,
|
|
105
126
|
tags: action.data && action.entityType === 'TAG' ? action.data.metaEntities : stateMeta.tags,
|
|
106
|
-
tagLookupMap: action?.data && action?.entityType === TAG ?
|
|
127
|
+
tagLookupMap: action?.data && action?.entityType === TAG ? combinedTagMap : stateMeta?.tagLookupMap,
|
|
107
128
|
})
|
|
108
129
|
.set('fetchingSchemaError', false);
|
|
109
130
|
}
|
|
@@ -155,7 +155,6 @@ export function SlideBoxContent(props) {
|
|
|
155
155
|
moduleType,
|
|
156
156
|
showLiquidErrorInFooter,
|
|
157
157
|
creativesMode,
|
|
158
|
-
eventContextTags,
|
|
159
158
|
} = props;
|
|
160
159
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
161
160
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -396,7 +395,6 @@ export function SlideBoxContent(props) {
|
|
|
396
395
|
onCreateComplete,
|
|
397
396
|
selectedOfferDetails,
|
|
398
397
|
getFormData,
|
|
399
|
-
eventContextTags,
|
|
400
398
|
};
|
|
401
399
|
|
|
402
400
|
return (
|
|
@@ -431,7 +429,6 @@ export function SlideBoxContent(props) {
|
|
|
431
429
|
smsRegister={smsRegister}
|
|
432
430
|
enableNewChannels={enableNewChannels}
|
|
433
431
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
434
|
-
eventContextTags={eventContextTags}
|
|
435
432
|
/>
|
|
436
433
|
)}
|
|
437
434
|
{isPreview && (
|
|
@@ -511,7 +508,6 @@ export function SlideBoxContent(props) {
|
|
|
511
508
|
handleClose={handleClose}
|
|
512
509
|
onCreateComplete={onCreateComplete}
|
|
513
510
|
smsRegister={smsRegister}
|
|
514
|
-
eventContextTags={eventContextTags}
|
|
515
511
|
/>
|
|
516
512
|
)}
|
|
517
513
|
{isEditFTP && (
|
|
@@ -547,7 +543,6 @@ export function SlideBoxContent(props) {
|
|
|
547
543
|
query,
|
|
548
544
|
search: '',
|
|
549
545
|
}}
|
|
550
|
-
eventContextTags={eventContextTags}
|
|
551
546
|
/>
|
|
552
547
|
}
|
|
553
548
|
{
|
|
@@ -578,7 +573,6 @@ export function SlideBoxContent(props) {
|
|
|
578
573
|
onCreateComplete={onCreateComplete}
|
|
579
574
|
smsRegister={smsRegister}
|
|
580
575
|
onShowTemplates={onShowTemplates}
|
|
581
|
-
eventContextTags={eventContextTags}
|
|
582
576
|
/>
|
|
583
577
|
)}
|
|
584
578
|
|
|
@@ -610,7 +604,6 @@ export function SlideBoxContent(props) {
|
|
|
610
604
|
getCmsTemplatesInProgress={getCmsTemplatesInProgress}
|
|
611
605
|
moduleType={moduleType}
|
|
612
606
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
613
|
-
eventContextTags={eventContextTags}
|
|
614
607
|
/>
|
|
615
608
|
)}
|
|
616
609
|
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
@@ -639,7 +632,6 @@ export function SlideBoxContent(props) {
|
|
|
639
632
|
onTestContentClicked={onTestContentClicked}
|
|
640
633
|
moduleType={moduleType}
|
|
641
634
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
642
|
-
eventContextTags={eventContextTags}
|
|
643
635
|
/>
|
|
644
636
|
)}
|
|
645
637
|
{isEditMPush &&
|
|
@@ -665,38 +657,35 @@ export function SlideBoxContent(props) {
|
|
|
665
657
|
type={type}
|
|
666
658
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
667
659
|
creativesMode={creativesMode}
|
|
668
|
-
eventContextTags={eventContextTags}
|
|
669
660
|
/>
|
|
670
661
|
}
|
|
671
662
|
{isCreateMPush &&
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
/>
|
|
699
|
-
}
|
|
663
|
+
<MobilepushWrapper
|
|
664
|
+
key="creatives-mobilepush-wrapper"
|
|
665
|
+
date={new Date().getMilliseconds()}
|
|
666
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
667
|
+
onMobilepushModeChange={onMobilepushModeChange}
|
|
668
|
+
mobilePushCreateMode={mobilePushCreateMode}
|
|
669
|
+
isGetFormData={isGetFormData}
|
|
670
|
+
getFormData={getFormData}
|
|
671
|
+
templateData={templateData}
|
|
672
|
+
type={type}
|
|
673
|
+
step={templateStep}
|
|
674
|
+
showNextStep={onCreateNextStep}
|
|
675
|
+
isFullMode={isFullMode}
|
|
676
|
+
onEnterTemplateName={onEnterTemplateName}
|
|
677
|
+
onRemoveTemplateName={onRemoveTemplateName}
|
|
678
|
+
cap={cap}
|
|
679
|
+
onResetStep={onResetStep}
|
|
680
|
+
showTemplateName={showTemplateName}
|
|
681
|
+
query={query}
|
|
682
|
+
forwardedTags={forwardedTags}
|
|
683
|
+
onValidationFail={onValidationFail}
|
|
684
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
685
|
+
onPreviewContentClicked={onPreviewContentClicked}
|
|
686
|
+
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
687
|
+
onTestContentClicked={onTestContentClicked}/>
|
|
688
|
+
}
|
|
700
689
|
{
|
|
701
690
|
isCreateFacebook && (
|
|
702
691
|
<Facebook
|
|
@@ -713,7 +702,6 @@ export function SlideBoxContent(props) {
|
|
|
713
702
|
fbAdManager={fbAdManager}
|
|
714
703
|
onSelectTemplate={onSelectTemplate}
|
|
715
704
|
orgUnitId={orgUnitId}
|
|
716
|
-
eventContextTags={eventContextTags}
|
|
717
705
|
/>
|
|
718
706
|
)
|
|
719
707
|
}
|
|
@@ -733,7 +721,6 @@ export function SlideBoxContent(props) {
|
|
|
733
721
|
getFormSubscriptionData={getFormData}
|
|
734
722
|
fbAdManager={fbAdManager}
|
|
735
723
|
onSelectTemplate={onSelectTemplate}
|
|
736
|
-
eventContextTags={eventContextTags}
|
|
737
724
|
/>
|
|
738
725
|
)
|
|
739
726
|
}
|
|
@@ -755,7 +742,6 @@ export function SlideBoxContent(props) {
|
|
|
755
742
|
selectedAccount={selectedAccount}
|
|
756
743
|
handleClose={handleClose}
|
|
757
744
|
selectedOfferDetails={selectedOfferDetails}
|
|
758
|
-
eventContextTags={eventContextTags}
|
|
759
745
|
/>
|
|
760
746
|
)
|
|
761
747
|
}
|
|
@@ -774,7 +760,6 @@ export function SlideBoxContent(props) {
|
|
|
774
760
|
createNew
|
|
775
761
|
handleClose={handleClose}
|
|
776
762
|
selectedOfferDetails={selectedOfferDetails}
|
|
777
|
-
eventContextTags={eventContextTags}
|
|
778
763
|
/>
|
|
779
764
|
)
|
|
780
765
|
}
|
|
@@ -789,7 +774,6 @@ export function SlideBoxContent(props) {
|
|
|
789
774
|
onShowTemplates={onShowTemplates}
|
|
790
775
|
templateData={templateData}
|
|
791
776
|
selectedOfferDetails={selectedOfferDetails}
|
|
792
|
-
eventContextTags={eventContextTags}
|
|
793
777
|
createNew/>
|
|
794
778
|
)}
|
|
795
779
|
|
|
@@ -806,13 +790,11 @@ export function SlideBoxContent(props) {
|
|
|
806
790
|
onShowTemplates={onShowTemplates}
|
|
807
791
|
templateData={templateData}
|
|
808
792
|
selectedOfferDetails={selectedOfferDetails}
|
|
809
|
-
eventContextTags={eventContextTags}
|
|
810
793
|
createNew/> }
|
|
811
794
|
|
|
812
795
|
{isCreateWhatsapp && (<Whatsapp
|
|
813
796
|
isFullMode={isFullMode}
|
|
814
797
|
onCreateComplete={onCreateComplete}
|
|
815
|
-
eventContextTags={eventContextTags}
|
|
816
798
|
handleClose={handleClose}/>
|
|
817
799
|
)}
|
|
818
800
|
|
|
@@ -823,7 +805,6 @@ export function SlideBoxContent(props) {
|
|
|
823
805
|
getDefaultTags={type}
|
|
824
806
|
forwardedTags={forwardedTags}
|
|
825
807
|
selectedOfferDetails={selectedOfferDetails}
|
|
826
|
-
eventContextTags={eventContextTags}
|
|
827
808
|
params={{
|
|
828
809
|
id: templateData._id,
|
|
829
810
|
}}
|
|
@@ -847,7 +828,6 @@ export function SlideBoxContent(props) {
|
|
|
847
828
|
isGetFormData={isGetFormData}
|
|
848
829
|
templateData={templateData}
|
|
849
830
|
getDefaultTags={type}
|
|
850
|
-
eventContextTags={eventContextTags}
|
|
851
831
|
/>
|
|
852
832
|
)}
|
|
853
833
|
|
|
@@ -859,7 +839,6 @@ export function SlideBoxContent(props) {
|
|
|
859
839
|
forwardedTags={forwardedTags}
|
|
860
840
|
onCreateComplete={onCreateComplete}
|
|
861
841
|
selectedOfferDetails={selectedOfferDetails}
|
|
862
|
-
eventContextTags={eventContextTags}
|
|
863
842
|
params={{
|
|
864
843
|
id: templateData._id,
|
|
865
844
|
}}
|
|
@@ -1213,7 +1213,6 @@ export class Creatives extends React.Component {
|
|
|
1213
1213
|
editor,
|
|
1214
1214
|
smsRegister,
|
|
1215
1215
|
enableNewChannels,
|
|
1216
|
-
eventContextTags,
|
|
1217
1216
|
} = this.props;
|
|
1218
1217
|
const mapTemplateCreate =
|
|
1219
1218
|
slidBoxContent === "createTemplate" &&
|
|
@@ -1314,7 +1313,6 @@ export class Creatives extends React.Component {
|
|
|
1314
1313
|
moduleType={this.props.messageDetails?.type}
|
|
1315
1314
|
showLiquidErrorInFooter={this.showLiquidErrorInFooter}
|
|
1316
1315
|
creativesMode={creativesMode} // An existing prop that we're using here. Required to ensure correct account details in Edit or Preview in case of Embedded mode.
|
|
1317
|
-
eventContextTags={eventContextTags}
|
|
1318
1316
|
/>
|
|
1319
1317
|
}
|
|
1320
1318
|
footer={this.shouldShowFooter() &&
|
|
@@ -1373,7 +1371,6 @@ Creatives.propTypes = {
|
|
|
1373
1371
|
selectedAccount: PropTypes.object,
|
|
1374
1372
|
strategy: PropTypes.string,
|
|
1375
1373
|
orgUnitId: PropTypes.number,
|
|
1376
|
-
eventContextTags: PropTypes.array,
|
|
1377
1374
|
};
|
|
1378
1375
|
const mapStatesToProps = () => createStructuredSelector({
|
|
1379
1376
|
isLoading: isLoadingSelector(),
|
|
@@ -2733,7 +2733,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2733
2733
|
isEmailLoading={isLoading}
|
|
2734
2734
|
moduleType={moduleType}
|
|
2735
2735
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
2736
|
-
eventContextTags={this.props?.eventContextTags}
|
|
2737
2736
|
/> : ''}
|
|
2738
2737
|
</Col>
|
|
2739
2738
|
</Row>
|
|
@@ -215,7 +215,6 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
215
215
|
currentOrgDetails,
|
|
216
216
|
moduleType,
|
|
217
217
|
showLiquidErrorInFooter,
|
|
218
|
-
eventContextTags,
|
|
219
218
|
} = this.props;
|
|
220
219
|
const {
|
|
221
220
|
templateName,
|
|
@@ -288,7 +287,6 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
288
287
|
onTestContentClicked={onTestContentClicked}
|
|
289
288
|
editor={editor}
|
|
290
289
|
moduleType={moduleType}
|
|
291
|
-
eventContextTags={eventContextTags}
|
|
292
290
|
/>}
|
|
293
291
|
{!isShowEmailCreate && (
|
|
294
292
|
<CmsTemplatesComponent
|
|
@@ -334,7 +332,6 @@ EmailWrapper.propTypes = {
|
|
|
334
332
|
moduleType: PropTypes.string,
|
|
335
333
|
onEnterTemplateName: PropTypes.func,
|
|
336
334
|
onRemoveTemplateName: PropTypes.func,
|
|
337
|
-
eventContextTags: PropTypes.array,
|
|
338
335
|
};
|
|
339
336
|
|
|
340
337
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1789,7 +1789,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1789
1789
|
templateData={this.props.templateData}
|
|
1790
1790
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
1791
1791
|
isFullMode={this.props.isFullMode}
|
|
1792
|
-
eventContextTags={this.props?.eventContextTags}
|
|
1793
1792
|
/>
|
|
1794
1793
|
</CapColumn>
|
|
1795
1794
|
{this.props.iosCtasData && this.state.showIosCtaTable &&
|
|
@@ -1881,7 +1880,6 @@ Create.propTypes = {
|
|
|
1881
1880
|
getFormLibraryData: PropTypes.func,
|
|
1882
1881
|
onPreviewContentClicked: PropTypes.func,
|
|
1883
1882
|
onTestContentClicked: PropTypes.func,
|
|
1884
|
-
eventContextTags: PropTypes.array,
|
|
1885
1883
|
};
|
|
1886
1884
|
|
|
1887
1885
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1951,7 +1951,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1951
1951
|
templateData={this.props.templateData}
|
|
1952
1952
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
1953
1953
|
isFullMode={this.props.isFullMode}
|
|
1954
|
-
eventContextTags={this.props?.eventContextTags}
|
|
1955
1954
|
/>}
|
|
1956
1955
|
</CapColumn>
|
|
1957
1956
|
{this.props.iosCtasData && this.state.showIosCtaTable &&
|
|
@@ -2047,7 +2046,6 @@ Edit.propTypes = {
|
|
|
2047
2046
|
onPreviewContentClicked: PropTypes.func,
|
|
2048
2047
|
onTestContentClicked: PropTypes.func,
|
|
2049
2048
|
creativesMode: PropTypes.string,
|
|
2050
|
-
eventContextTags: PropTypes.array,
|
|
2051
2049
|
};
|
|
2052
2050
|
|
|
2053
2051
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -72,9 +72,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
render() {
|
|
75
|
-
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData
|
|
76
|
-
eventContextTags,
|
|
77
|
-
} = this.props;
|
|
75
|
+
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData} = this.props;
|
|
78
76
|
const {templateName} = this.state;
|
|
79
77
|
const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
|
|
80
78
|
return (
|
|
@@ -121,7 +119,6 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
121
119
|
onTestContentClicked={onTestContentClicked}
|
|
122
120
|
templateData={templateData}
|
|
123
121
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
124
|
-
eventContextTags={eventContextTags}
|
|
125
122
|
/>
|
|
126
123
|
|
|
127
124
|
|
|
@@ -147,7 +144,6 @@ MobilepushWrapper.propTypes = {
|
|
|
147
144
|
showTemplateName: PropTypes.func,
|
|
148
145
|
type: PropTypes.string,
|
|
149
146
|
onValidationFail: PropTypes.func,
|
|
150
|
-
eventContextTags: PropTypes.array,
|
|
151
147
|
};
|
|
152
148
|
|
|
153
149
|
|
|
@@ -989,7 +989,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
989
989
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
990
990
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
991
991
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
992
|
-
eventContextTags={this.props?.eventContextTags}
|
|
993
992
|
/>
|
|
994
993
|
</CapColumn>
|
|
995
994
|
</CapRow>
|
|
@@ -1016,7 +1015,6 @@ Create.propTypes = {
|
|
|
1016
1015
|
getFormSubscriptionData: PropTypes.func,
|
|
1017
1016
|
isLoadingMetaEntities: PropTypes.bool,
|
|
1018
1017
|
selectedOfferDetails: PropTypes.array,
|
|
1019
|
-
eventContextTags: PropTypes.array,
|
|
1020
1018
|
};
|
|
1021
1019
|
|
|
1022
1020
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -987,7 +987,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
987
987
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
988
988
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
989
989
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
990
|
-
eventContextTags={this.props.eventContextTags}
|
|
991
990
|
/>
|
|
992
991
|
</CapColumn>
|
|
993
992
|
</CapRow>
|
|
@@ -1017,7 +1016,6 @@ Edit.propTypes = {
|
|
|
1017
1016
|
// route: PropTypes.object,
|
|
1018
1017
|
injectedTags: PropTypes.object,
|
|
1019
1018
|
selectedOfferDetails: PropTypes.array,
|
|
1020
|
-
eventContextTags: PropTypes.array,
|
|
1021
1019
|
};
|
|
1022
1020
|
|
|
1023
1021
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -71,7 +71,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
71
71
|
getFormSubscriptionData,
|
|
72
72
|
templateData = {},
|
|
73
73
|
selectedOfferDetails,
|
|
74
|
-
eventContextTags,
|
|
75
74
|
} = props || {};
|
|
76
75
|
const { formatMessage } = intl;
|
|
77
76
|
const [loading, updateLoading] = useState(true);
|
|
@@ -227,7 +226,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
227
226
|
injectedTagsParams: injectedTags,
|
|
228
227
|
location,
|
|
229
228
|
tagModule: getDefaultTags,
|
|
230
|
-
eventContextTags,
|
|
231
229
|
}) || {};
|
|
232
230
|
updateIsTagValidationError(
|
|
233
231
|
tagValidationResponse.unsupportedTags.length > 0,
|
|
@@ -571,7 +569,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
571
569
|
injectedTags={injectedTags || {}}
|
|
572
570
|
hidePopover={disablehandler()}
|
|
573
571
|
selectedOfferDetails={selectedOfferDetails}
|
|
574
|
-
eventContextTags={eventContextTags}
|
|
575
572
|
/>
|
|
576
573
|
}
|
|
577
574
|
/>
|
|
@@ -29,7 +29,6 @@ const SmsWrapper = (props) => {
|
|
|
29
29
|
handleClose,
|
|
30
30
|
smsRegister,
|
|
31
31
|
onShowTemplates,
|
|
32
|
-
eventContextTags,
|
|
33
32
|
} = props;
|
|
34
33
|
|
|
35
34
|
const smsProps = {
|
|
@@ -45,7 +44,6 @@ const SmsWrapper = (props) => {
|
|
|
45
44
|
selectedOfferDetails,
|
|
46
45
|
onPreviewContentClicked,
|
|
47
46
|
onTestContentClicked,
|
|
48
|
-
eventContextTags,
|
|
49
47
|
};
|
|
50
48
|
const isTraiDlt = isTraiDLTEnable(isFullMode, smsRegister);
|
|
51
49
|
return <>
|
|
@@ -22,7 +22,6 @@ import './_tagList.scss';
|
|
|
22
22
|
import { selectCurrentOrgDetails, makeSelectFetchingSchemaError } from '../Cap/selectors';
|
|
23
23
|
import { injectIntl } from 'react-intl';
|
|
24
24
|
import { scope } from './messages';
|
|
25
|
-
import messages from './messages';
|
|
26
25
|
import { handleInjectedData, hasGiftVoucherFeature, hasPromoFeature, hasBadgesFeature, transformBadgeTags } from '../../utils/common';
|
|
27
26
|
import { GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS, BADGES_ENROLL, BADGES_ISSUE } from '../../containers/App/constants';
|
|
28
27
|
|
|
@@ -84,9 +83,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
84
83
|
generateTags = (props) => {
|
|
85
84
|
let tags = {};
|
|
86
85
|
let injectedTags = {};
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
const {selectedOfferDetails, eventContextTags } = props;
|
|
86
|
+
const {selectedOfferDetails } = props;
|
|
90
87
|
if (props.injectedTags && !_.isEmpty(props.injectedTags)) {
|
|
91
88
|
const formattedInjectedTags = handleInjectedData(
|
|
92
89
|
props.injectedTags,
|
|
@@ -104,27 +101,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
104
101
|
this.transformCouponTags(selectedOfferDetails, tags);
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
|
-
|
|
108
|
-
const TAG_HEADER_MSG_LABEL = this.props.intl.formatMessage(messages.tagsBasedOnEntryTriggerEvent);
|
|
109
|
-
eventContextTagsObj.EventContextTags = {
|
|
110
|
-
name: TAG_HEADER_MSG_LABEL,
|
|
111
|
-
desc: TAG_HEADER_MSG_LABEL,
|
|
112
|
-
resolved: true,
|
|
113
|
-
'tag-header': true,
|
|
114
|
-
subtags: {},
|
|
115
|
-
};
|
|
116
|
-
// Journey event context tags also should be displayed in the Add Labels.
|
|
117
|
-
eventContextTags.forEach((tag) => {
|
|
118
|
-
if (tag?.tagName) {
|
|
119
|
-
eventContextTagsObj.EventContextTags.subtags[tag?.tagName] = {
|
|
120
|
-
name: tag?.tagName,
|
|
121
|
-
desc: tag?.tagName,
|
|
122
|
-
resolved: true
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
this.setState({tags: _.merge( {}, tags, injectedTags, eventContextTagsObj )});
|
|
104
|
+
this.setState({tags: _.merge( {}, tags, injectedTags)});
|
|
128
105
|
}
|
|
129
106
|
populateTags(tagsList) {
|
|
130
107
|
const mainTags = {};
|
|
@@ -341,7 +318,6 @@ TagList.propTypes = {
|
|
|
341
318
|
channel: PropTypes.string,
|
|
342
319
|
disabled: PropTypes.bool,
|
|
343
320
|
fetchingSchemaError: PropTypes.bool,
|
|
344
|
-
eventContextTags: PropTypes.array,
|
|
345
321
|
};
|
|
346
322
|
|
|
347
323
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -11,8 +11,4 @@ export default defineMessages({
|
|
|
11
11
|
id: `${scope}.header`,
|
|
12
12
|
defaultMessage: 'This is TagList container !',
|
|
13
13
|
},
|
|
14
|
-
tagsBasedOnEntryTriggerEvent: {
|
|
15
|
-
id: `${scope}.tagsBasedOnEntryTriggerEvent`,
|
|
16
|
-
defaultMessage: 'Tags based on entry trigger event',
|
|
17
|
-
},
|
|
18
14
|
});
|
|
@@ -71,7 +71,6 @@ export const Viber = (props) => {
|
|
|
71
71
|
viberData = {},
|
|
72
72
|
selectedOfferDetails = [],
|
|
73
73
|
currentOrgDetails,
|
|
74
|
-
eventContextTags,
|
|
75
74
|
} = props || {};
|
|
76
75
|
|
|
77
76
|
const { formatMessage } = intl;
|
|
@@ -271,7 +270,6 @@ export const Viber = (props) => {
|
|
|
271
270
|
id={"viber_tags"}
|
|
272
271
|
userLocale={localStorage.getItem("jlocale") || "en"}
|
|
273
272
|
selectedOfferDetails={selectedOfferDetails}
|
|
274
|
-
eventContextTags={eventContextTags}
|
|
275
273
|
/>
|
|
276
274
|
</CapColumn>
|
|
277
275
|
<div className="viber-textarea-wrapper">
|
|
@@ -128,8 +128,7 @@ export const Whatsapp = (props) => {
|
|
|
128
128
|
loadingTags,
|
|
129
129
|
getFormData,
|
|
130
130
|
selectedOfferDetails,
|
|
131
|
-
currentOrgDetails
|
|
132
|
-
eventContextTags,
|
|
131
|
+
currentOrgDetails
|
|
133
132
|
} = props || {};
|
|
134
133
|
const { formatMessage } = intl;
|
|
135
134
|
const { TextArea } = CapInput;
|
|
@@ -502,7 +501,6 @@ export const Whatsapp = (props) => {
|
|
|
502
501
|
injectedTagsParams: injectedTags,
|
|
503
502
|
location,
|
|
504
503
|
tagModule: getDefaultTags,
|
|
505
|
-
eventContextTags,
|
|
506
504
|
}) || {};
|
|
507
505
|
const unsupportedTagsLengthCheck =
|
|
508
506
|
validationResponse?.unsupportedTags?.length > 0;
|
|
@@ -2053,7 +2051,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2053
2051
|
onContextChange={handleOnTagsContextChange}
|
|
2054
2052
|
injectedTags={injectedTags || {}}
|
|
2055
2053
|
selectedOfferDetails={selectedOfferDetails}
|
|
2056
|
-
eventContextTags={eventContextTags}
|
|
2057
2054
|
/>
|
|
2058
2055
|
)
|
|
2059
2056
|
}
|
|
@@ -65,7 +65,6 @@ export const Zalo = (props) => {
|
|
|
65
65
|
injectedTags,
|
|
66
66
|
getFormData,
|
|
67
67
|
selectedOfferDetails,
|
|
68
|
-
eventContextTags,
|
|
69
68
|
} = props || {};
|
|
70
69
|
const {hostName = ''} = senderDetails;
|
|
71
70
|
const { formatMessage } = intl;
|
|
@@ -256,7 +255,6 @@ export const Zalo = (props) => {
|
|
|
256
255
|
injectedTagsParams: injectedTags,
|
|
257
256
|
location,
|
|
258
257
|
tagModule: getDefaultTags,
|
|
259
|
-
eventContextTags,
|
|
260
258
|
}) || {};
|
|
261
259
|
const { unsupportedTags = [], isBraceError } = tagValidationResponse;
|
|
262
260
|
let tagError = '';
|
|
@@ -446,7 +444,6 @@ export const Zalo = (props) => {
|
|
|
446
444
|
injectedTags={injectedTags || {}}
|
|
447
445
|
selectedOfferDetails={selectedOfferDetails}
|
|
448
446
|
disabled={isFullMode}
|
|
449
|
-
eventContextTags={eventContextTags}
|
|
450
447
|
/>
|
|
451
448
|
}
|
|
452
449
|
/>
|