@capillarytech/creatives-library 8.0.333 → 8.0.334
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/tests/tagValidations.test.js +20 -0
- package/v2Components/CapTagList/index.js +28 -23
- package/v2Components/CapTagList/style.scss +29 -0
- package/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +63 -0
- package/v2Components/CapTagListWithInput/index.js +4 -0
- package/v2Components/CapWhatsappCTA/index.js +2 -0
- package/v2Components/FormBuilder/index.js +7 -0
- package/v2Components/HtmlEditor/HTMLEditor.js +6 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +1 -0
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +927 -2
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +3 -0
- package/v2Containers/BeeEditor/index.js +3 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +28 -1
- package/v2Containers/CreativesContainer/index.js +3 -0
- package/v2Containers/Email/index.js +1 -0
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +6 -1
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +3 -0
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +20 -2
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +16 -1
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +3 -0
- package/v2Containers/EmailWrapper/index.js +4 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +1 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +9 -0
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +1 -0
- package/v2Containers/MobilePush/Create/index.js +2 -0
- package/v2Containers/MobilePush/Edit/index.js +2 -0
- package/v2Containers/MobilepushWrapper/index.js +3 -1
- package/v2Containers/Rcs/index.js +1 -0
- package/v2Containers/Sms/Create/index.js +2 -0
- package/v2Containers/Sms/Edit/index.js +2 -0
- package/v2Containers/SmsTrai/Edit/index.js +2 -0
- package/v2Containers/SmsWrapper/index.js +2 -0
- package/v2Containers/TagList/index.js +62 -5
- package/v2Containers/TagList/messages.js +4 -0
- package/v2Containers/TagList/tests/TagList.test.js +124 -20
- package/v2Containers/TagList/tests/mockdata.js +17 -0
- package/v2Containers/Viber/index.js +3 -0
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +0 -2
- package/v2Containers/WebPush/Create/index.js +9 -1
- package/v2Containers/Whatsapp/index.js +5 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +20 -0
- package/v2Containers/Zalo/index.js +2 -0
|
@@ -59,6 +59,7 @@ const CodeEditorPaneComponent = ({
|
|
|
59
59
|
injectedTags = {},
|
|
60
60
|
location,
|
|
61
61
|
eventContextTags = [],
|
|
62
|
+
waitEventContextTags = {},
|
|
62
63
|
selectedOfferDetails = [],
|
|
63
64
|
channel,
|
|
64
65
|
userLocale = 'en',
|
|
@@ -289,6 +290,7 @@ const CodeEditorPaneComponent = ({
|
|
|
289
290
|
location={location}
|
|
290
291
|
selectedOfferDetails={selectedOfferDetails}
|
|
291
292
|
eventContextTags={eventContextTags}
|
|
293
|
+
waitEventContextTags={waitEventContextTags}
|
|
292
294
|
popoverPlacement="rightTop"
|
|
293
295
|
/>
|
|
294
296
|
</CapRow>
|
|
@@ -327,6 +329,7 @@ CodeEditorPane.propTypes = {
|
|
|
327
329
|
injectedTags: PropTypes.object,
|
|
328
330
|
location: PropTypes.object,
|
|
329
331
|
eventContextTags: PropTypes.array,
|
|
332
|
+
waitEventContextTags: PropTypes.object,
|
|
330
333
|
selectedOfferDetails: PropTypes.array,
|
|
331
334
|
channel: PropTypes.string,
|
|
332
335
|
userLocale: PropTypes.string,
|
|
@@ -53,6 +53,7 @@ function BeeEditor(props) {
|
|
|
53
53
|
BEESelect,
|
|
54
54
|
currentOrgDetails,
|
|
55
55
|
eventContextTags,
|
|
56
|
+
waitEventContextTags,
|
|
56
57
|
} = props;
|
|
57
58
|
const { saveRowRequest } = BEESelect;
|
|
58
59
|
const {formatMessage} = intl;
|
|
@@ -368,6 +369,7 @@ function BeeEditor(props) {
|
|
|
368
369
|
}}
|
|
369
370
|
onContextChange={onContextChange}
|
|
370
371
|
eventContextTags={eventContextTags}
|
|
372
|
+
waitEventContextTags={waitEventContextTags}
|
|
371
373
|
/>
|
|
372
374
|
<CapModal
|
|
373
375
|
className="custom-row-modal"
|
|
@@ -414,6 +416,7 @@ BeeEditor.propTypes = {
|
|
|
414
416
|
onContextChange: PropTypes.func,
|
|
415
417
|
userLocale: PropTypes.string,
|
|
416
418
|
eventContextTags: PropTypes.array,
|
|
419
|
+
waitEventContextTags: PropTypes.object,
|
|
417
420
|
};
|
|
418
421
|
|
|
419
422
|
const mapStateToProps = () => createStructuredSelector({
|
|
@@ -168,6 +168,7 @@ export function SlideBoxContent(props) {
|
|
|
168
168
|
creativesMode,
|
|
169
169
|
hostName = '',
|
|
170
170
|
eventContextTags,
|
|
171
|
+
waitEventContextTags = {},
|
|
171
172
|
isLoyaltyModule,
|
|
172
173
|
loyaltyMetaData = {},
|
|
173
174
|
showTestAndPreviewSlidebox,
|
|
@@ -424,6 +425,7 @@ export function SlideBoxContent(props) {
|
|
|
424
425
|
selectedOfferDetails,
|
|
425
426
|
getFormData,
|
|
426
427
|
eventContextTags,
|
|
428
|
+
waitEventContextTags,
|
|
427
429
|
};
|
|
428
430
|
|
|
429
431
|
return (
|
|
@@ -458,6 +460,7 @@ export function SlideBoxContent(props) {
|
|
|
458
460
|
enableNewChannels={enableNewChannels}
|
|
459
461
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
460
462
|
eventContextTags={eventContextTags}
|
|
463
|
+
waitEventContextTags={waitEventContextTags}
|
|
461
464
|
loyaltyMetaData={loyaltyMetaData}
|
|
462
465
|
isLoyaltyModule={isLoyaltyModule}
|
|
463
466
|
/>
|
|
@@ -561,6 +564,7 @@ export function SlideBoxContent(props) {
|
|
|
561
564
|
onCreateComplete={onCreateComplete}
|
|
562
565
|
smsRegister={smsRegister}
|
|
563
566
|
eventContextTags={eventContextTags}
|
|
567
|
+
waitEventContextTags={waitEventContextTags}
|
|
564
568
|
getLiquidTags={getLiquidTags}
|
|
565
569
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
566
570
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -604,6 +608,7 @@ export function SlideBoxContent(props) {
|
|
|
604
608
|
}}
|
|
605
609
|
hostName={hostName}
|
|
606
610
|
eventContextTags={eventContextTags}
|
|
611
|
+
waitEventContextTags={waitEventContextTags}
|
|
607
612
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
608
613
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
609
614
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -644,6 +649,7 @@ export function SlideBoxContent(props) {
|
|
|
644
649
|
eventContextTags={eventContextTags}
|
|
645
650
|
restrictPersonalization={restrictPersonalization}
|
|
646
651
|
isAnonymousType={isAnonymousType}
|
|
652
|
+
waitEventContextTags={waitEventContextTags}
|
|
647
653
|
/>
|
|
648
654
|
)}
|
|
649
655
|
|
|
@@ -677,6 +683,7 @@ export function SlideBoxContent(props) {
|
|
|
677
683
|
moduleType={moduleType}
|
|
678
684
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
679
685
|
eventContextTags={eventContextTags}
|
|
686
|
+
waitEventContextTags={waitEventContextTags}
|
|
680
687
|
isLoyaltyModule={isLoyaltyModule}
|
|
681
688
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
682
689
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -721,6 +728,7 @@ export function SlideBoxContent(props) {
|
|
|
721
728
|
moduleType={moduleType}
|
|
722
729
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
723
730
|
eventContextTags={eventContextTags}
|
|
731
|
+
waitEventContextTags={waitEventContextTags}
|
|
724
732
|
isLoyaltyModule={isLoyaltyModule}
|
|
725
733
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
726
734
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -760,6 +768,7 @@ export function SlideBoxContent(props) {
|
|
|
760
768
|
moduleType={moduleType}
|
|
761
769
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
762
770
|
eventContextTags={eventContextTags}
|
|
771
|
+
waitEventContextTags={waitEventContextTags}
|
|
763
772
|
isLoyaltyModule={isLoyaltyModule}
|
|
764
773
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
765
774
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -803,6 +812,7 @@ export function SlideBoxContent(props) {
|
|
|
803
812
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
804
813
|
creativesMode={creativesMode}
|
|
805
814
|
eventContextTags={eventContextTags}
|
|
815
|
+
waitEventContextTags={waitEventContextTags}
|
|
806
816
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
807
817
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
808
818
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -835,6 +845,7 @@ export function SlideBoxContent(props) {
|
|
|
835
845
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
836
846
|
creativesMode={creativesMode}
|
|
837
847
|
eventContextTags={eventContextTags}
|
|
848
|
+
waitEventContextTags={waitEventContextTags}
|
|
838
849
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
839
850
|
handleClose={handleClose}
|
|
840
851
|
restrictPersonalization={restrictPersonalization}
|
|
@@ -874,6 +885,7 @@ export function SlideBoxContent(props) {
|
|
|
874
885
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
875
886
|
onTestContentClicked={onTestContentClicked}
|
|
876
887
|
eventContextTags={eventContextTags}
|
|
888
|
+
waitEventContextTags={waitEventContextTags}
|
|
877
889
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
878
890
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
879
891
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -912,6 +924,7 @@ export function SlideBoxContent(props) {
|
|
|
912
924
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
913
925
|
onTestContentClicked={onTestContentClicked}
|
|
914
926
|
eventContextTags={eventContextTags}
|
|
927
|
+
waitEventContextTags={waitEventContextTags}
|
|
915
928
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
916
929
|
onCreateComplete={onCreateComplete}
|
|
917
930
|
creativesMode={creativesMode}
|
|
@@ -937,6 +950,7 @@ export function SlideBoxContent(props) {
|
|
|
937
950
|
onSelectTemplate={onSelectTemplate}
|
|
938
951
|
orgUnitId={orgUnitId}
|
|
939
952
|
eventContextTags={eventContextTags}
|
|
953
|
+
waitEventContextTags={waitEventContextTags}
|
|
940
954
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
941
955
|
/>
|
|
942
956
|
)
|
|
@@ -958,6 +972,7 @@ export function SlideBoxContent(props) {
|
|
|
958
972
|
fbAdManager={fbAdManager}
|
|
959
973
|
onSelectTemplate={onSelectTemplate}
|
|
960
974
|
eventContextTags={eventContextTags}
|
|
975
|
+
waitEventContextTags={waitEventContextTags}
|
|
961
976
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
962
977
|
/>
|
|
963
978
|
)
|
|
@@ -981,6 +996,7 @@ export function SlideBoxContent(props) {
|
|
|
981
996
|
handleClose={handleClose}
|
|
982
997
|
selectedOfferDetails={selectedOfferDetails}
|
|
983
998
|
eventContextTags={eventContextTags}
|
|
999
|
+
waitEventContextTags={waitEventContextTags}
|
|
984
1000
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
985
1001
|
/>
|
|
986
1002
|
)
|
|
@@ -1001,6 +1017,7 @@ export function SlideBoxContent(props) {
|
|
|
1001
1017
|
handleClose={handleClose}
|
|
1002
1018
|
selectedOfferDetails={selectedOfferDetails}
|
|
1003
1019
|
eventContextTags={eventContextTags}
|
|
1020
|
+
waitEventContextTags={waitEventContextTags}
|
|
1004
1021
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1005
1022
|
/>
|
|
1006
1023
|
)
|
|
@@ -1017,6 +1034,7 @@ export function SlideBoxContent(props) {
|
|
|
1017
1034
|
templateData={templateData}
|
|
1018
1035
|
selectedOfferDetails={selectedOfferDetails}
|
|
1019
1036
|
eventContextTags={eventContextTags}
|
|
1037
|
+
waitEventContextTags={waitEventContextTags}
|
|
1020
1038
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1021
1039
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
1022
1040
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -1041,6 +1059,7 @@ export function SlideBoxContent(props) {
|
|
|
1041
1059
|
handleTestAndPreview={handleTestAndPreview}
|
|
1042
1060
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
1043
1061
|
eventContextTags={eventContextTags}
|
|
1062
|
+
waitEventContextTags={waitEventContextTags}
|
|
1044
1063
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1045
1064
|
createNew/> }
|
|
1046
1065
|
|
|
@@ -1048,6 +1067,7 @@ export function SlideBoxContent(props) {
|
|
|
1048
1067
|
isFullMode={isFullMode}
|
|
1049
1068
|
onCreateComplete={onCreateComplete}
|
|
1050
1069
|
eventContextTags={eventContextTags}
|
|
1070
|
+
waitEventContextTags={waitEventContextTags}
|
|
1051
1071
|
handleClose={handleClose}
|
|
1052
1072
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1053
1073
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
@@ -1065,6 +1085,7 @@ export function SlideBoxContent(props) {
|
|
|
1065
1085
|
forwardedTags={forwardedTags}
|
|
1066
1086
|
selectedOfferDetails={selectedOfferDetails}
|
|
1067
1087
|
eventContextTags={eventContextTags}
|
|
1088
|
+
waitEventContextTags={waitEventContextTags}
|
|
1068
1089
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
1069
1090
|
handleTestAndPreview={handleTestAndPreview}
|
|
1070
1091
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
@@ -1103,6 +1124,7 @@ export function SlideBoxContent(props) {
|
|
|
1103
1124
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
1104
1125
|
onTestContentClicked={onTestContentClicked}
|
|
1105
1126
|
eventContextTags={eventContextTags}
|
|
1127
|
+
waitEventContextTags={waitEventContextTags}
|
|
1106
1128
|
onCreateComplete={onCreateComplete}
|
|
1107
1129
|
handleClose={handleClose}
|
|
1108
1130
|
moduleType={moduleType}
|
|
@@ -1138,6 +1160,7 @@ export function SlideBoxContent(props) {
|
|
|
1138
1160
|
moduleType={moduleType}
|
|
1139
1161
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1140
1162
|
eventContextTags={eventContextTags}
|
|
1163
|
+
waitEventContextTags={waitEventContextTags}
|
|
1141
1164
|
onCreateComplete={onCreateComplete}
|
|
1142
1165
|
handleClose={handleClose}
|
|
1143
1166
|
getDefaultTags={type}
|
|
@@ -1161,6 +1184,7 @@ export function SlideBoxContent(props) {
|
|
|
1161
1184
|
onCreateComplete={onCreateComplete}
|
|
1162
1185
|
selectedOfferDetails={selectedOfferDetails}
|
|
1163
1186
|
eventContextTags={eventContextTags}
|
|
1187
|
+
waitEventContextTags={waitEventContextTags}
|
|
1164
1188
|
params={{
|
|
1165
1189
|
id: templateData._id,
|
|
1166
1190
|
}}
|
|
@@ -1199,6 +1223,7 @@ export function SlideBoxContent(props) {
|
|
|
1199
1223
|
eventContextTags={eventContextTags}
|
|
1200
1224
|
restrictPersonalization={restrictPersonalization}
|
|
1201
1225
|
isAnonymousType={isAnonymousType}
|
|
1226
|
+
waitEventContextTags={waitEventContextTags}
|
|
1202
1227
|
/>
|
|
1203
1228
|
)}
|
|
1204
1229
|
{isCreateRcs && (<Rcs
|
|
@@ -1292,6 +1317,8 @@ SlideBoxContent.propTypes = {
|
|
|
1292
1317
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1293
1318
|
handleTestAndPreview: PropTypes.func,
|
|
1294
1319
|
handleCloseTestAndPreview: PropTypes.func,
|
|
1295
|
-
isTestAndPreviewMode: PropTypes.bool
|
|
1320
|
+
isTestAndPreviewMode: PropTypes.bool,
|
|
1321
|
+
waitEventContextTags: PropTypes.object,
|
|
1322
|
+
eventContextTags: PropTypes.array,
|
|
1296
1323
|
};
|
|
1297
1324
|
export default SlideBoxContent;
|
|
@@ -1949,6 +1949,7 @@ export class Creatives extends React.Component {
|
|
|
1949
1949
|
smsRegister,
|
|
1950
1950
|
enableNewChannels,
|
|
1951
1951
|
eventContextTags,
|
|
1952
|
+
waitEventContextTags = {},
|
|
1952
1953
|
isLoyaltyModule,
|
|
1953
1954
|
loyaltyMetaData = {},
|
|
1954
1955
|
} = this.props;
|
|
@@ -2116,6 +2117,7 @@ export class Creatives extends React.Component {
|
|
|
2116
2117
|
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.
|
|
2117
2118
|
hostName={this.props?.hostName || ''}
|
|
2118
2119
|
eventContextTags={eventContextTags}
|
|
2120
|
+
waitEventContextTags={waitEventContextTags}
|
|
2119
2121
|
isLoyaltyModule={isLoyaltyModule}
|
|
2120
2122
|
loyaltyMetaData={loyaltyMetaData}
|
|
2121
2123
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
@@ -2208,6 +2210,7 @@ Creatives.propTypes = {
|
|
|
2208
2210
|
orgUnitId: PropTypes.number,
|
|
2209
2211
|
hostName: PropTypes.string,
|
|
2210
2212
|
eventContextTags: PropTypes.array,
|
|
2213
|
+
waitEventContextTags: PropTypes.object,
|
|
2211
2214
|
loyaltyTagFetchingDependencies: PropTypes.object,
|
|
2212
2215
|
customerType: PropTypes.string,
|
|
2213
2216
|
intl: PropTypes.shape({
|
|
@@ -3134,6 +3134,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
3134
3134
|
moduleType={moduleType}
|
|
3135
3135
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
3136
3136
|
eventContextTags={this.props?.eventContextTags}
|
|
3137
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
3137
3138
|
forwardedTags={this.props?.forwardedTags}
|
|
3138
3139
|
isLoyaltyModule={this.props?.isLoyaltyModule}
|
|
3139
3140
|
isTestAndPreviewMode={this.state.isTestAndPreviewMode} // Add flag to prevent validation
|
|
@@ -54,6 +54,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
54
54
|
globalActions,
|
|
55
55
|
loadingTags,
|
|
56
56
|
eventContextTags,
|
|
57
|
+
waitEventContextTags,
|
|
57
58
|
forwardedTags,
|
|
58
59
|
selectedOfferDetails,
|
|
59
60
|
currentOrgDetails,
|
|
@@ -510,7 +511,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
510
511
|
setTagValidationError(null);
|
|
511
512
|
}
|
|
512
513
|
}
|
|
513
|
-
}, [tags, injectedTags, location, getDefaultTags, eventContextTags, showLiquidErrorInFooter]);
|
|
514
|
+
}, [tags, injectedTags, location, getDefaultTags, eventContextTags, waitEventContextTags, showLiquidErrorInFooter]);
|
|
514
515
|
|
|
515
516
|
// Store the last validation state received from HTMLEditor
|
|
516
517
|
const lastValidationStateRef = useRef(null);
|
|
@@ -1100,6 +1101,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
1100
1101
|
injectedTags={injectedTags || {}}
|
|
1101
1102
|
selectedOfferDetails={selectedOfferDetails}
|
|
1102
1103
|
eventContextTags={eventContextTags}
|
|
1104
|
+
waitEventContextTags={waitEventContextTags}
|
|
1103
1105
|
showHeading
|
|
1104
1106
|
showTagList
|
|
1105
1107
|
showInput
|
|
@@ -1124,6 +1126,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
1124
1126
|
injectedTags={injectedTags}
|
|
1125
1127
|
location={location}
|
|
1126
1128
|
eventContextTags={eventContextTags}
|
|
1129
|
+
waitEventContextTags={waitEventContextTags}
|
|
1127
1130
|
selectedOfferDetails={selectedOfferDetails}
|
|
1128
1131
|
channel={EMAIL}
|
|
1129
1132
|
userLocale={intl.locale || 'en'}
|
|
@@ -1151,6 +1154,7 @@ EmailHTMLEditor.propTypes = {
|
|
|
1151
1154
|
globalActions: PropTypes.object,
|
|
1152
1155
|
loadingTags: PropTypes.bool,
|
|
1153
1156
|
eventContextTags: PropTypes.array,
|
|
1157
|
+
waitEventContextTags: PropTypes.object,
|
|
1154
1158
|
forwardedTags: PropTypes.object,
|
|
1155
1159
|
selectedOfferDetails: PropTypes.array,
|
|
1156
1160
|
currentOrgDetails: PropTypes.object,
|
|
@@ -1197,6 +1201,7 @@ EmailHTMLEditor.defaultProps = {
|
|
|
1197
1201
|
globalActions: {},
|
|
1198
1202
|
loadingTags: false,
|
|
1199
1203
|
eventContextTags: [],
|
|
1204
|
+
waitEventContextTags: {},
|
|
1200
1205
|
forwardedTags: {},
|
|
1201
1206
|
selectedOfferDetails: [],
|
|
1202
1207
|
currentOrgDetails: {},
|
|
@@ -173,6 +173,7 @@ const EmailWrapperView = ({
|
|
|
173
173
|
forwardedTags,
|
|
174
174
|
selectedOfferDetails,
|
|
175
175
|
eventContextTags,
|
|
176
|
+
waitEventContextTags,
|
|
176
177
|
getFormdata,
|
|
177
178
|
isGetFormData,
|
|
178
179
|
getLiquidTags,
|
|
@@ -246,6 +247,7 @@ const EmailWrapperView = ({
|
|
|
246
247
|
globalActions,
|
|
247
248
|
loadingTags,
|
|
248
249
|
eventContextTags,
|
|
250
|
+
waitEventContextTags,
|
|
249
251
|
forwardedTags,
|
|
250
252
|
selectedOfferDetails,
|
|
251
253
|
currentOrgDetails,
|
|
@@ -371,6 +373,7 @@ EmailWrapperView.propTypes = {
|
|
|
371
373
|
forwardedTags: PropTypes.object,
|
|
372
374
|
selectedOfferDetails: PropTypes.array,
|
|
373
375
|
eventContextTags: PropTypes.array,
|
|
376
|
+
waitEventContextTags: PropTypes.object,
|
|
374
377
|
emailActions: PropTypes.object,
|
|
375
378
|
Email: PropTypes.object,
|
|
376
379
|
templateData: PropTypes.object,
|
|
@@ -71,7 +71,10 @@ jest.mock('../../../../v2Components/HtmlEditor/index.lazy', () => {
|
|
|
71
71
|
}));
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
|
-
<div
|
|
74
|
+
<div
|
|
75
|
+
data-testid="html-editor"
|
|
76
|
+
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
77
|
+
>
|
|
75
78
|
<button
|
|
76
79
|
onClick={() => props.onContentChange && props.onContentChange('<p>New content</p>')}
|
|
77
80
|
data-testid="trigger-content-change"
|
|
@@ -130,7 +133,10 @@ jest.mock('../../../../v2Components/HtmlEditor', () => {
|
|
|
130
133
|
}));
|
|
131
134
|
|
|
132
135
|
return (
|
|
133
|
-
<div
|
|
136
|
+
<div
|
|
137
|
+
data-testid="html-editor"
|
|
138
|
+
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
139
|
+
>
|
|
134
140
|
<button
|
|
135
141
|
onClick={() => props.onContentChange && props.onContentChange('<p>New content</p>')}
|
|
136
142
|
data-testid="trigger-content-change"
|
|
@@ -364,6 +370,7 @@ const defaultProps = {
|
|
|
364
370
|
},
|
|
365
371
|
loadingTags: false,
|
|
366
372
|
eventContextTags: [],
|
|
373
|
+
waitEventContextTags: {},
|
|
367
374
|
forwardedTags: {},
|
|
368
375
|
selectedOfferDetails: [],
|
|
369
376
|
currentOrgDetails: {
|
|
@@ -522,6 +529,17 @@ describe('EmailHTMLEditor', () => {
|
|
|
522
529
|
});
|
|
523
530
|
});
|
|
524
531
|
|
|
532
|
+
describe('waitEventContextTags', () => {
|
|
533
|
+
it('forwards waitEventContextTags to HTMLEditor', () => {
|
|
534
|
+
const waitMap = { b1: { eventName: 'E', blockName: 'B', tags: ['t'] } };
|
|
535
|
+
renderWithIntl({ waitEventContextTags: waitMap });
|
|
536
|
+
expect(screen.getByTestId('html-editor')).toHaveAttribute(
|
|
537
|
+
'data-wait-event-context-tags',
|
|
538
|
+
JSON.stringify(waitMap),
|
|
539
|
+
);
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
|
|
525
543
|
describe('Content Initialization', () => {
|
|
526
544
|
it('initializes with empty content in create mode', () => {
|
|
527
545
|
renderWithIntl({ isGetFormData: false });
|
|
@@ -37,7 +37,14 @@ jest.mock('../EmailHTMLEditor', () => {
|
|
|
37
37
|
getContentForPreview: jest.fn(() => '<p>Test</p>'),
|
|
38
38
|
}));
|
|
39
39
|
|
|
40
|
-
return
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
data-testid="email-html-editor"
|
|
43
|
+
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
44
|
+
>
|
|
45
|
+
HTML Editor
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
41
48
|
});
|
|
42
49
|
});
|
|
43
50
|
|
|
@@ -137,6 +144,7 @@ const defaultProps = {
|
|
|
137
144
|
forwardedTags: {},
|
|
138
145
|
selectedOfferDetails: [],
|
|
139
146
|
eventContextTags: [],
|
|
147
|
+
waitEventContextTags: {},
|
|
140
148
|
getFormdata: jest.fn(),
|
|
141
149
|
isGetFormData: false,
|
|
142
150
|
getLiquidTags: jest.fn(),
|
|
@@ -171,6 +179,13 @@ describe('EmailWrapperView', () => {
|
|
|
171
179
|
jest.clearAllMocks();
|
|
172
180
|
});
|
|
173
181
|
|
|
182
|
+
it('passes waitEventContextTags to EmailHTMLEditor when HTML editor is shown', () => {
|
|
183
|
+
const waitMap = { b1: { eventName: 'E', blockName: 'B', tags: [] } };
|
|
184
|
+
renderWithIntl({ waitEventContextTags: waitMap });
|
|
185
|
+
const el = screen.getByTestId('email-html-editor');
|
|
186
|
+
expect(el).toHaveAttribute('data-wait-event-context-tags', JSON.stringify(waitMap));
|
|
187
|
+
});
|
|
188
|
+
|
|
174
189
|
describe('Mode Selection UI', () => {
|
|
175
190
|
it('renders mode selection when step is MODE_SELECTION', () => {
|
|
176
191
|
renderWithIntl({ step: STEPS.MODE_SELECTION });
|
|
@@ -51,6 +51,7 @@ const useEmailWrapper = ({
|
|
|
51
51
|
editor,
|
|
52
52
|
moduleType,
|
|
53
53
|
eventContextTags,
|
|
54
|
+
waitEventContextTags,
|
|
54
55
|
isLoyaltyModule,
|
|
55
56
|
// Props for CmsTemplates component
|
|
56
57
|
cmsTemplatesLoader,
|
|
@@ -737,6 +738,7 @@ const useEmailWrapper = ({
|
|
|
737
738
|
selectedEditorMode, // Pass selected mode to Email component (only for HTML_EDITOR)
|
|
738
739
|
moduleType,
|
|
739
740
|
eventContextTags,
|
|
741
|
+
waitEventContextTags,
|
|
740
742
|
isLoyaltyModule,
|
|
741
743
|
showTestAndPreviewSlidebox,
|
|
742
744
|
handleTestAndPreview,
|
|
@@ -766,6 +768,7 @@ const useEmailWrapper = ({
|
|
|
766
768
|
editor,
|
|
767
769
|
moduleType,
|
|
768
770
|
eventContextTags,
|
|
771
|
+
waitEventContextTags,
|
|
769
772
|
isLoyaltyModule,
|
|
770
773
|
showTestAndPreviewSlidebox,
|
|
771
774
|
handleTestAndPreview,
|
|
@@ -63,6 +63,7 @@ const EmailWrapper = (props) => {
|
|
|
63
63
|
onEnterTemplateName,
|
|
64
64
|
onRemoveTemplateName,
|
|
65
65
|
eventContextTags,
|
|
66
|
+
waitEventContextTags,
|
|
66
67
|
isLoyaltyModule,
|
|
67
68
|
cmsTemplatesLoader,
|
|
68
69
|
onPreviewContentClicked,
|
|
@@ -130,6 +131,7 @@ const EmailWrapper = (props) => {
|
|
|
130
131
|
onEnterTemplateName,
|
|
131
132
|
onRemoveTemplateName,
|
|
132
133
|
eventContextTags,
|
|
134
|
+
waitEventContextTags,
|
|
133
135
|
isLoyaltyModule,
|
|
134
136
|
cmsTemplatesLoader,
|
|
135
137
|
onPreviewContentClicked,
|
|
@@ -184,6 +186,7 @@ const EmailWrapper = (props) => {
|
|
|
184
186
|
forwardedTags={forwardedTags}
|
|
185
187
|
selectedOfferDetails={selectedOfferDetails}
|
|
186
188
|
eventContextTags={eventContextTags}
|
|
189
|
+
waitEventContextTags={waitEventContextTags}
|
|
187
190
|
getFormdata={getFormdata}
|
|
188
191
|
isGetFormData={isGetFormData}
|
|
189
192
|
getLiquidTags={globalActionsProp?.getLiquidTags}
|
|
@@ -241,6 +244,7 @@ EmailWrapper.propTypes = {
|
|
|
241
244
|
onEnterTemplateName: PropTypes.func,
|
|
242
245
|
onRemoveTemplateName: PropTypes.func,
|
|
243
246
|
eventContextTags: PropTypes.array,
|
|
247
|
+
waitEventContextTags: PropTypes.object,
|
|
244
248
|
isLoyaltyModule: PropTypes.bool,
|
|
245
249
|
onPreviewContentClicked: PropTypes.func,
|
|
246
250
|
onTestContentClicked: PropTypes.func,
|
|
@@ -102,6 +102,7 @@ describe('useEmailWrapper', () => {
|
|
|
102
102
|
editor: null,
|
|
103
103
|
moduleType: '',
|
|
104
104
|
eventContextTags: [],
|
|
105
|
+
waitEventContextTags: {},
|
|
105
106
|
isLoyaltyModule: false,
|
|
106
107
|
cmsTemplatesLoader: false,
|
|
107
108
|
currentOrgDetails: { id: 'org1' },
|
|
@@ -120,6 +121,14 @@ describe('useEmailWrapper', () => {
|
|
|
120
121
|
expect(result.current.onTemplateNameChange).toBeInstanceOf(Function);
|
|
121
122
|
});
|
|
122
123
|
|
|
124
|
+
it('passes waitEventContextTags through emailProps', () => {
|
|
125
|
+
const waitMap = { block1: { eventName: 'E', blockName: 'B', tags: [] } };
|
|
126
|
+
const { result } = renderHook(() =>
|
|
127
|
+
useEmailWrapper({ ...mockProps, waitEventContextTags: waitMap }),
|
|
128
|
+
);
|
|
129
|
+
expect(result.current.emailProps.waitEventContextTags).toEqual(waitMap);
|
|
130
|
+
});
|
|
131
|
+
|
|
123
132
|
it('handles template name change correctly', () => {
|
|
124
133
|
const { result } = renderHook(() => useEmailWrapper(mockProps));
|
|
125
134
|
|
|
@@ -1966,6 +1966,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1966
1966
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
1967
1967
|
isFullMode={this.props.isFullMode}
|
|
1968
1968
|
eventContextTags={this.props?.eventContextTags}
|
|
1969
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1969
1970
|
messageDetails={this.props?.messageDetails}
|
|
1970
1971
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
1971
1972
|
/>
|
|
@@ -2068,6 +2069,7 @@ Create.propTypes = {
|
|
|
2068
2069
|
onPreviewContentClicked: PropTypes.func,
|
|
2069
2070
|
onTestContentClicked: PropTypes.func,
|
|
2070
2071
|
eventContextTags: PropTypes.array,
|
|
2072
|
+
waitEventContextTags: PropTypes.object,
|
|
2071
2073
|
getLiquidTags: PropTypes.func,
|
|
2072
2074
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2073
2075
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
@@ -2233,6 +2233,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2233
2233
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
2234
2234
|
isFullMode={this.props.isFullMode}
|
|
2235
2235
|
eventContextTags={this.props?.eventContextTags}
|
|
2236
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
2236
2237
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
2237
2238
|
/>;
|
|
2238
2239
|
})()}
|
|
@@ -2339,6 +2340,7 @@ Edit.propTypes = {
|
|
|
2339
2340
|
onTestContentClicked: PropTypes.func,
|
|
2340
2341
|
creativesMode: PropTypes.string,
|
|
2341
2342
|
eventContextTags: PropTypes.array,
|
|
2343
|
+
waitEventContextTags: PropTypes.object,
|
|
2342
2344
|
getLiquidTags: PropTypes.func,
|
|
2343
2345
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2344
2346
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
@@ -72,7 +72,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
render() {
|
|
75
|
-
const {mobilePushCreateMode, step, getFormData, getLiquidTags, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData, eventContextTags = [], showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview, restrictPersonalization, isAnonymousType, onPersonalizationTokensChange} = this.props;
|
|
75
|
+
const {mobilePushCreateMode, step, getFormData, getLiquidTags, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData, eventContextTags = [], waitEventContextTags = {},showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview, restrictPersonalization, isAnonymousType, onPersonalizationTokensChange} = this.props;
|
|
76
76
|
const {templateName} = this.state;
|
|
77
77
|
const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
|
|
78
78
|
return (
|
|
@@ -121,6 +121,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
121
121
|
templateData={templateData}
|
|
122
122
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
123
123
|
eventContextTags={eventContextTags}
|
|
124
|
+
waitEventContextTags={waitEventContextTags}
|
|
124
125
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
125
126
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
126
127
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -155,6 +156,7 @@ MobilepushWrapper.propTypes = {
|
|
|
155
156
|
type: PropTypes.string,
|
|
156
157
|
onValidationFail: PropTypes.func,
|
|
157
158
|
eventContextTags: PropTypes.array,
|
|
159
|
+
waitEventContextTags: PropTypes.object,
|
|
158
160
|
showLiquidErrorInFooter: PropTypes.func,
|
|
159
161
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
160
162
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -1096,6 +1096,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1096
1096
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
1097
1097
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
1098
1098
|
eventContextTags={this.props?.eventContextTags}
|
|
1099
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1099
1100
|
/>
|
|
1100
1101
|
</CapColumn>
|
|
1101
1102
|
</CapRow>
|
|
@@ -1132,6 +1133,7 @@ Create.propTypes = {
|
|
|
1132
1133
|
isLoadingMetaEntities: PropTypes.bool,
|
|
1133
1134
|
selectedOfferDetails: PropTypes.array,
|
|
1134
1135
|
eventContextTags: PropTypes.array,
|
|
1136
|
+
waitEventContextTags: PropTypes.object,
|
|
1135
1137
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1136
1138
|
handleTestAndPreview: PropTypes.func,
|
|
1137
1139
|
handleCloseTestAndPreview: PropTypes.func,
|
|
@@ -1091,6 +1091,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1091
1091
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
1092
1092
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
1093
1093
|
eventContextTags={this.props?.eventContextTags}
|
|
1094
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1094
1095
|
messageDetails={this.props?.messageDetails}
|
|
1095
1096
|
/>
|
|
1096
1097
|
</CapColumn>
|
|
@@ -1131,6 +1132,7 @@ Edit.propTypes = {
|
|
|
1131
1132
|
injectedTags: PropTypes.object,
|
|
1132
1133
|
selectedOfferDetails: PropTypes.array,
|
|
1133
1134
|
eventContextTags: PropTypes.array,
|
|
1135
|
+
waitEventContextTags: PropTypes.object,
|
|
1134
1136
|
messageDetails: PropTypes.object,
|
|
1135
1137
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1136
1138
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -82,6 +82,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
82
82
|
templateData = {},
|
|
83
83
|
selectedOfferDetails,
|
|
84
84
|
eventContextTags,
|
|
85
|
+
waitEventContextTags,
|
|
85
86
|
fetchingLiquidTags,
|
|
86
87
|
getLiquidTags,
|
|
87
88
|
showLiquidErrorInFooter,
|
|
@@ -660,6 +661,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
660
661
|
hidePopover={disablehandler()}
|
|
661
662
|
selectedOfferDetails={selectedOfferDetails}
|
|
662
663
|
eventContextTags={eventContextTags}
|
|
664
|
+
waitEventContextTags={waitEventContextTags}
|
|
663
665
|
/>
|
|
664
666
|
)}
|
|
665
667
|
/>
|