@capillarytech/creatives-library 8.0.326 → 8.0.327
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 +34 -0
- package/v2Components/CapTagList/index.js +14 -22
- package/v2Components/CapTagList/style.scss +48 -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 +7 -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 +19 -0
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +3 -0
- package/v2Containers/InAppWrapper/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 +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 +41 -2
- package/v2Containers/TagList/messages.js +4 -0
- package/v2Containers/TagList/tests/TagList.test.js +122 -20
- package/v2Containers/TagList/tests/mockdata.js +17 -0
- package/v2Containers/Viber/index.js +5 -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({
|
|
@@ -170,6 +170,7 @@ export function SlideBoxContent(props) {
|
|
|
170
170
|
creativesMode,
|
|
171
171
|
hostName = '',
|
|
172
172
|
eventContextTags,
|
|
173
|
+
waitEventContextTags,
|
|
173
174
|
isLoyaltyModule,
|
|
174
175
|
loyaltyMetaData = {},
|
|
175
176
|
showTestAndPreviewSlidebox,
|
|
@@ -453,6 +454,7 @@ export function SlideBoxContent(props) {
|
|
|
453
454
|
selectedOfferDetails,
|
|
454
455
|
getFormData,
|
|
455
456
|
eventContextTags,
|
|
457
|
+
waitEventContextTags,
|
|
456
458
|
};
|
|
457
459
|
|
|
458
460
|
return (
|
|
@@ -487,6 +489,7 @@ export function SlideBoxContent(props) {
|
|
|
487
489
|
enableNewChannels={enableNewChannels}
|
|
488
490
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
489
491
|
eventContextTags={eventContextTags}
|
|
492
|
+
waitEventContextTags={waitEventContextTags}
|
|
490
493
|
loyaltyMetaData={loyaltyMetaData}
|
|
491
494
|
isLoyaltyModule={isLoyaltyModule}
|
|
492
495
|
localTemplatesConfig={localTemplatesConfig}
|
|
@@ -591,6 +594,7 @@ export function SlideBoxContent(props) {
|
|
|
591
594
|
onCreateComplete={onCreateComplete}
|
|
592
595
|
smsRegister={smsRegister}
|
|
593
596
|
eventContextTags={eventContextTags}
|
|
597
|
+
waitEventContextTags={waitEventContextTags}
|
|
594
598
|
getLiquidTags={getLiquidTags}
|
|
595
599
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
596
600
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -634,6 +638,7 @@ export function SlideBoxContent(props) {
|
|
|
634
638
|
}}
|
|
635
639
|
hostName={hostName}
|
|
636
640
|
eventContextTags={eventContextTags}
|
|
641
|
+
waitEventContextTags={waitEventContextTags}
|
|
637
642
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
638
643
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
639
644
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -675,6 +680,7 @@ export function SlideBoxContent(props) {
|
|
|
675
680
|
eventContextTags={eventContextTags}
|
|
676
681
|
restrictPersonalization={restrictPersonalization}
|
|
677
682
|
isAnonymousType={isAnonymousType}
|
|
683
|
+
waitEventContextTags={waitEventContextTags}
|
|
678
684
|
/>
|
|
679
685
|
)}
|
|
680
686
|
|
|
@@ -708,6 +714,7 @@ export function SlideBoxContent(props) {
|
|
|
708
714
|
moduleType={moduleType}
|
|
709
715
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
710
716
|
eventContextTags={eventContextTags}
|
|
717
|
+
waitEventContextTags={waitEventContextTags}
|
|
711
718
|
isLoyaltyModule={isLoyaltyModule}
|
|
712
719
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
713
720
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -752,6 +759,7 @@ export function SlideBoxContent(props) {
|
|
|
752
759
|
moduleType={moduleType}
|
|
753
760
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
754
761
|
eventContextTags={eventContextTags}
|
|
762
|
+
waitEventContextTags={waitEventContextTags}
|
|
755
763
|
isLoyaltyModule={isLoyaltyModule}
|
|
756
764
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
757
765
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -791,6 +799,7 @@ export function SlideBoxContent(props) {
|
|
|
791
799
|
moduleType={moduleType}
|
|
792
800
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
793
801
|
eventContextTags={eventContextTags}
|
|
802
|
+
waitEventContextTags={waitEventContextTags}
|
|
794
803
|
isLoyaltyModule={isLoyaltyModule}
|
|
795
804
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
796
805
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -834,6 +843,7 @@ export function SlideBoxContent(props) {
|
|
|
834
843
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
835
844
|
creativesMode={creativesMode}
|
|
836
845
|
eventContextTags={eventContextTags}
|
|
846
|
+
waitEventContextTags={waitEventContextTags}
|
|
837
847
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
838
848
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
839
849
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -866,6 +876,7 @@ export function SlideBoxContent(props) {
|
|
|
866
876
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
867
877
|
creativesMode={creativesMode}
|
|
868
878
|
eventContextTags={eventContextTags}
|
|
879
|
+
waitEventContextTags={waitEventContextTags}
|
|
869
880
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
870
881
|
handleClose={handleClose}
|
|
871
882
|
restrictPersonalization={restrictPersonalization}
|
|
@@ -905,6 +916,7 @@ export function SlideBoxContent(props) {
|
|
|
905
916
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
906
917
|
onTestContentClicked={onTestContentClicked}
|
|
907
918
|
eventContextTags={eventContextTags}
|
|
919
|
+
waitEventContextTags={waitEventContextTags}
|
|
908
920
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
909
921
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
910
922
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -943,6 +955,7 @@ export function SlideBoxContent(props) {
|
|
|
943
955
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
944
956
|
onTestContentClicked={onTestContentClicked}
|
|
945
957
|
eventContextTags={eventContextTags}
|
|
958
|
+
waitEventContextTags={waitEventContextTags}
|
|
946
959
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
947
960
|
onCreateComplete={onCreateComplete}
|
|
948
961
|
creativesMode={creativesMode}
|
|
@@ -968,6 +981,7 @@ export function SlideBoxContent(props) {
|
|
|
968
981
|
onSelectTemplate={onSelectTemplate}
|
|
969
982
|
orgUnitId={orgUnitId}
|
|
970
983
|
eventContextTags={eventContextTags}
|
|
984
|
+
waitEventContextTags={waitEventContextTags}
|
|
971
985
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
972
986
|
/>
|
|
973
987
|
)
|
|
@@ -989,6 +1003,7 @@ export function SlideBoxContent(props) {
|
|
|
989
1003
|
fbAdManager={fbAdManager}
|
|
990
1004
|
onSelectTemplate={onSelectTemplate}
|
|
991
1005
|
eventContextTags={eventContextTags}
|
|
1006
|
+
waitEventContextTags={waitEventContextTags}
|
|
992
1007
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
993
1008
|
/>
|
|
994
1009
|
)
|
|
@@ -1012,6 +1027,7 @@ export function SlideBoxContent(props) {
|
|
|
1012
1027
|
handleClose={handleClose}
|
|
1013
1028
|
selectedOfferDetails={selectedOfferDetails}
|
|
1014
1029
|
eventContextTags={eventContextTags}
|
|
1030
|
+
waitEventContextTags={waitEventContextTags}
|
|
1015
1031
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1016
1032
|
/>
|
|
1017
1033
|
)
|
|
@@ -1032,6 +1048,7 @@ export function SlideBoxContent(props) {
|
|
|
1032
1048
|
handleClose={handleClose}
|
|
1033
1049
|
selectedOfferDetails={selectedOfferDetails}
|
|
1034
1050
|
eventContextTags={eventContextTags}
|
|
1051
|
+
waitEventContextTags={waitEventContextTags}
|
|
1035
1052
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1036
1053
|
/>
|
|
1037
1054
|
)
|
|
@@ -1048,6 +1065,7 @@ export function SlideBoxContent(props) {
|
|
|
1048
1065
|
templateData={templateData}
|
|
1049
1066
|
selectedOfferDetails={selectedOfferDetails}
|
|
1050
1067
|
eventContextTags={eventContextTags}
|
|
1068
|
+
waitEventContextTags={waitEventContextTags}
|
|
1051
1069
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1052
1070
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
1053
1071
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -1072,6 +1090,7 @@ export function SlideBoxContent(props) {
|
|
|
1072
1090
|
handleTestAndPreview={handleTestAndPreview}
|
|
1073
1091
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
1074
1092
|
eventContextTags={eventContextTags}
|
|
1093
|
+
waitEventContextTags={waitEventContextTags}
|
|
1075
1094
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1076
1095
|
createNew/> }
|
|
1077
1096
|
|
|
@@ -1079,6 +1098,7 @@ export function SlideBoxContent(props) {
|
|
|
1079
1098
|
isFullMode={isFullMode}
|
|
1080
1099
|
onCreateComplete={onCreateComplete}
|
|
1081
1100
|
eventContextTags={eventContextTags}
|
|
1101
|
+
waitEventContextTags={waitEventContextTags}
|
|
1082
1102
|
handleClose={handleClose}
|
|
1083
1103
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1084
1104
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
@@ -1096,6 +1116,7 @@ export function SlideBoxContent(props) {
|
|
|
1096
1116
|
forwardedTags={forwardedTags}
|
|
1097
1117
|
selectedOfferDetails={selectedOfferDetails}
|
|
1098
1118
|
eventContextTags={eventContextTags}
|
|
1119
|
+
waitEventContextTags={waitEventContextTags}
|
|
1099
1120
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
1100
1121
|
handleTestAndPreview={handleTestAndPreview}
|
|
1101
1122
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
@@ -1134,6 +1155,7 @@ export function SlideBoxContent(props) {
|
|
|
1134
1155
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
1135
1156
|
onTestContentClicked={onTestContentClicked}
|
|
1136
1157
|
eventContextTags={eventContextTags}
|
|
1158
|
+
waitEventContextTags={waitEventContextTags}
|
|
1137
1159
|
onCreateComplete={onCreateComplete}
|
|
1138
1160
|
handleClose={handleClose}
|
|
1139
1161
|
moduleType={moduleType}
|
|
@@ -1169,6 +1191,7 @@ export function SlideBoxContent(props) {
|
|
|
1169
1191
|
moduleType={moduleType}
|
|
1170
1192
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1171
1193
|
eventContextTags={eventContextTags}
|
|
1194
|
+
waitEventContextTags={waitEventContextTags}
|
|
1172
1195
|
onCreateComplete={onCreateComplete}
|
|
1173
1196
|
handleClose={handleClose}
|
|
1174
1197
|
getDefaultTags={type}
|
|
@@ -1192,6 +1215,7 @@ export function SlideBoxContent(props) {
|
|
|
1192
1215
|
onCreateComplete={onCreateComplete}
|
|
1193
1216
|
selectedOfferDetails={selectedOfferDetails}
|
|
1194
1217
|
eventContextTags={eventContextTags}
|
|
1218
|
+
waitEventContextTags={waitEventContextTags}
|
|
1195
1219
|
params={{
|
|
1196
1220
|
id: templateData._id,
|
|
1197
1221
|
}}
|
|
@@ -1230,6 +1254,7 @@ export function SlideBoxContent(props) {
|
|
|
1230
1254
|
eventContextTags={eventContextTags}
|
|
1231
1255
|
restrictPersonalization={restrictPersonalization}
|
|
1232
1256
|
isAnonymousType={isAnonymousType}
|
|
1257
|
+
waitEventContextTags={waitEventContextTags}
|
|
1233
1258
|
/>
|
|
1234
1259
|
)}
|
|
1235
1260
|
{isCreateRcs && (<Rcs
|
|
@@ -1324,6 +1349,8 @@ SlideBoxContent.propTypes = {
|
|
|
1324
1349
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1325
1350
|
handleTestAndPreview: PropTypes.func,
|
|
1326
1351
|
handleCloseTestAndPreview: PropTypes.func,
|
|
1327
|
-
isTestAndPreviewMode: PropTypes.bool
|
|
1352
|
+
isTestAndPreviewMode: PropTypes.bool,
|
|
1353
|
+
waitEventContextTags: PropTypes.object,
|
|
1354
|
+
eventContextTags: PropTypes.array,
|
|
1328
1355
|
};
|
|
1329
1356
|
export default SlideBoxContent;
|
|
@@ -2125,6 +2125,7 @@ export class Creatives extends React.Component {
|
|
|
2125
2125
|
smsRegister,
|
|
2126
2126
|
enableNewChannels,
|
|
2127
2127
|
eventContextTags,
|
|
2128
|
+
waitEventContextTags,
|
|
2128
2129
|
isLoyaltyModule,
|
|
2129
2130
|
loyaltyMetaData = {},
|
|
2130
2131
|
} = this.props;
|
|
@@ -2289,6 +2290,7 @@ export class Creatives extends React.Component {
|
|
|
2289
2290
|
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.
|
|
2290
2291
|
hostName={this.props?.hostName || ''}
|
|
2291
2292
|
eventContextTags={eventContextTags}
|
|
2293
|
+
waitEventContextTags={waitEventContextTags}
|
|
2292
2294
|
isLoyaltyModule={isLoyaltyModule}
|
|
2293
2295
|
loyaltyMetaData={loyaltyMetaData}
|
|
2294
2296
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
@@ -2382,6 +2384,7 @@ Creatives.propTypes = {
|
|
|
2382
2384
|
orgUnitId: PropTypes.number,
|
|
2383
2385
|
hostName: PropTypes.string,
|
|
2384
2386
|
eventContextTags: PropTypes.array,
|
|
2387
|
+
waitEventContextTags: PropTypes.object,
|
|
2385
2388
|
loyaltyTagFetchingDependencies: PropTypes.object,
|
|
2386
2389
|
customerType: PropTypes.string,
|
|
2387
2390
|
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,
|
|
@@ -502,6 +503,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
502
503
|
location,
|
|
503
504
|
tagModule: getDefaultTags,
|
|
504
505
|
isFullMode,
|
|
506
|
+
waitEventContextTags,
|
|
505
507
|
});
|
|
506
508
|
|
|
507
509
|
if (!validationResult.valid) {
|
|
@@ -510,7 +512,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
510
512
|
setTagValidationError(null);
|
|
511
513
|
}
|
|
512
514
|
}
|
|
513
|
-
}, [tags, injectedTags, location, getDefaultTags, eventContextTags, showLiquidErrorInFooter]);
|
|
515
|
+
}, [tags, injectedTags, location, getDefaultTags, eventContextTags, waitEventContextTags, showLiquidErrorInFooter]);
|
|
514
516
|
|
|
515
517
|
// Store the last validation state received from HTMLEditor
|
|
516
518
|
const lastValidationStateRef = useRef(null);
|
|
@@ -1100,6 +1102,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
1100
1102
|
injectedTags={injectedTags || {}}
|
|
1101
1103
|
selectedOfferDetails={selectedOfferDetails}
|
|
1102
1104
|
eventContextTags={eventContextTags}
|
|
1105
|
+
waitEventContextTags={waitEventContextTags}
|
|
1103
1106
|
showHeading
|
|
1104
1107
|
showTagList
|
|
1105
1108
|
showInput
|
|
@@ -1124,6 +1127,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
1124
1127
|
injectedTags={injectedTags}
|
|
1125
1128
|
location={location}
|
|
1126
1129
|
eventContextTags={eventContextTags}
|
|
1130
|
+
waitEventContextTags={waitEventContextTags}
|
|
1127
1131
|
selectedOfferDetails={selectedOfferDetails}
|
|
1128
1132
|
channel={EMAIL}
|
|
1129
1133
|
userLocale={intl.locale || 'en'}
|
|
@@ -1151,6 +1155,7 @@ EmailHTMLEditor.propTypes = {
|
|
|
1151
1155
|
globalActions: PropTypes.object,
|
|
1152
1156
|
loadingTags: PropTypes.bool,
|
|
1153
1157
|
eventContextTags: PropTypes.array,
|
|
1158
|
+
waitEventContextTags: PropTypes.object,
|
|
1154
1159
|
forwardedTags: PropTypes.object,
|
|
1155
1160
|
selectedOfferDetails: PropTypes.array,
|
|
1156
1161
|
currentOrgDetails: PropTypes.object,
|
|
@@ -1197,6 +1202,7 @@ EmailHTMLEditor.defaultProps = {
|
|
|
1197
1202
|
globalActions: {},
|
|
1198
1203
|
loadingTags: false,
|
|
1199
1204
|
eventContextTags: [],
|
|
1205
|
+
waitEventContextTags: {},
|
|
1200
1206
|
forwardedTags: {},
|
|
1201
1207
|
selectedOfferDetails: [],
|
|
1202
1208
|
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
|
|
|
@@ -78,6 +78,7 @@ describe('useInAppWrapper', () => {
|
|
|
78
78
|
onPreviewContentClicked: jest.fn(),
|
|
79
79
|
onTestContentClicked: jest.fn(),
|
|
80
80
|
eventContextTags: {},
|
|
81
|
+
waitEventContextTags: {},
|
|
81
82
|
onCreateComplete: jest.fn(),
|
|
82
83
|
handleClose: jest.fn(),
|
|
83
84
|
templateData: null,
|
|
@@ -424,6 +425,24 @@ describe('useInAppWrapper', () => {
|
|
|
424
425
|
|
|
425
426
|
expect(capturedState.inAppProps.getDefaultTags).toBe('defaultTags');
|
|
426
427
|
});
|
|
428
|
+
|
|
429
|
+
it('passes waitEventContextTags through to inAppProps', () => {
|
|
430
|
+
const waitMap = { block1: { eventName: 'E', blockName: 'B', tags: [] } };
|
|
431
|
+
let capturedState = null;
|
|
432
|
+
render(
|
|
433
|
+
<TestComponent
|
|
434
|
+
hookProps={{
|
|
435
|
+
...defaultHookProps,
|
|
436
|
+
waitEventContextTags: waitMap,
|
|
437
|
+
}}
|
|
438
|
+
onStateChange={(state) => {
|
|
439
|
+
capturedState = state;
|
|
440
|
+
}}
|
|
441
|
+
/>
|
|
442
|
+
);
|
|
443
|
+
|
|
444
|
+
expect(capturedState.inAppProps.waitEventContextTags).toEqual(waitMap);
|
|
445
|
+
});
|
|
427
446
|
});
|
|
428
447
|
|
|
429
448
|
describe('isShowInAppCreate', () => {
|
|
@@ -33,6 +33,7 @@ const useInAppWrapper = ({
|
|
|
33
33
|
onPreviewContentClicked,
|
|
34
34
|
onTestContentClicked,
|
|
35
35
|
eventContextTags,
|
|
36
|
+
waitEventContextTags,
|
|
36
37
|
onCreateComplete,
|
|
37
38
|
handleClose,
|
|
38
39
|
templateData,
|
|
@@ -149,6 +150,7 @@ const useInAppWrapper = ({
|
|
|
149
150
|
onPreviewContentClicked,
|
|
150
151
|
onTestContentClicked,
|
|
151
152
|
eventContextTags,
|
|
153
|
+
waitEventContextTags,
|
|
152
154
|
onCreateComplete,
|
|
153
155
|
handleClose,
|
|
154
156
|
};
|
|
@@ -173,6 +175,7 @@ const useInAppWrapper = ({
|
|
|
173
175
|
onPreviewContentClicked,
|
|
174
176
|
onTestContentClicked,
|
|
175
177
|
eventContextTags,
|
|
178
|
+
waitEventContextTags,
|
|
176
179
|
onCreateComplete,
|
|
177
180
|
handleClose,
|
|
178
181
|
]);
|
|
@@ -36,6 +36,7 @@ const InAppWrapper = (props) => {
|
|
|
36
36
|
onPreviewContentClicked,
|
|
37
37
|
onTestContentClicked,
|
|
38
38
|
eventContextTags,
|
|
39
|
+
waitEventContextTags,
|
|
39
40
|
onCreateComplete,
|
|
40
41
|
handleClose,
|
|
41
42
|
templateData,
|
|
@@ -78,6 +79,7 @@ const InAppWrapper = (props) => {
|
|
|
78
79
|
onPreviewContentClicked,
|
|
79
80
|
onTestContentClicked,
|
|
80
81
|
eventContextTags,
|
|
82
|
+
waitEventContextTags,
|
|
81
83
|
onCreateComplete,
|
|
82
84
|
handleClose,
|
|
83
85
|
templateData,
|
|
@@ -124,6 +126,7 @@ InAppWrapper.propTypes = {
|
|
|
124
126
|
onPreviewContentClicked: PropTypes.func,
|
|
125
127
|
onTestContentClicked: PropTypes.func,
|
|
126
128
|
eventContextTags: PropTypes.array,
|
|
129
|
+
waitEventContextTags: PropTypes.object,
|
|
127
130
|
onCreateComplete: PropTypes.func,
|
|
128
131
|
handleClose: PropTypes.func,
|
|
129
132
|
templateData: PropTypes.object,
|
|
@@ -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,
|