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