@capillarytech/creatives-library 8.0.324 → 8.0.325-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/tests/tagValidations.test.js +0 -34
- package/v2Components/CapTagList/index.js +22 -14
- package/v2Components/CapTagList/style.scss +0 -48
- package/v2Components/CapTagListWithInput/index.js +0 -4
- package/v2Components/CapWhatsappCTA/index.js +0 -2
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +1 -2
- package/v2Components/FormBuilder/index.js +0 -7
- package/v2Components/HtmlEditor/HTMLEditor.js +1 -6
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +2 -927
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +0 -3
- package/v2Containers/BeeEditor/index.js +0 -3
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -28
- package/v2Containers/CreativesContainer/index.js +0 -3
- package/v2Containers/Email/index.js +0 -1
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1 -7
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +0 -3
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +2 -20
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +1 -16
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +0 -3
- package/v2Containers/EmailWrapper/index.js +0 -4
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -1
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +0 -9
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -19
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -3
- package/v2Containers/InAppWrapper/index.js +0 -3
- package/v2Containers/MobilePush/Create/index.js +0 -2
- package/v2Containers/MobilePush/Edit/index.js +0 -2
- package/v2Containers/MobilepushWrapper/index.js +1 -3
- package/v2Containers/Rcs/index.js +0 -1
- package/v2Containers/Sms/Create/index.js +0 -2
- package/v2Containers/Sms/Edit/index.js +0 -2
- package/v2Containers/SmsTrai/Edit/index.js +0 -2
- package/v2Containers/SmsWrapper/index.js +0 -2
- package/v2Containers/TagList/index.js +2 -41
- package/v2Containers/TagList/messages.js +0 -4
- package/v2Containers/TagList/tests/TagList.test.js +20 -122
- package/v2Containers/TagList/tests/mockdata.js +0 -17
- package/v2Containers/Viber/index.js +0 -5
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +2 -0
- package/v2Containers/WebPush/Create/index.js +1 -9
- package/v2Containers/Whatsapp/index.js +0 -5
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -20
- package/v2Containers/Zalo/index.js +0 -2
- package/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +0 -63
|
@@ -59,7 +59,6 @@ const CodeEditorPaneComponent = ({
|
|
|
59
59
|
injectedTags = {},
|
|
60
60
|
location,
|
|
61
61
|
eventContextTags = [],
|
|
62
|
-
waitEventContextTags = {},
|
|
63
62
|
selectedOfferDetails = [],
|
|
64
63
|
channel,
|
|
65
64
|
userLocale = 'en',
|
|
@@ -290,7 +289,6 @@ const CodeEditorPaneComponent = ({
|
|
|
290
289
|
location={location}
|
|
291
290
|
selectedOfferDetails={selectedOfferDetails}
|
|
292
291
|
eventContextTags={eventContextTags}
|
|
293
|
-
waitEventContextTags={waitEventContextTags}
|
|
294
292
|
popoverPlacement="rightTop"
|
|
295
293
|
/>
|
|
296
294
|
</CapRow>
|
|
@@ -329,7 +327,6 @@ CodeEditorPane.propTypes = {
|
|
|
329
327
|
injectedTags: PropTypes.object,
|
|
330
328
|
location: PropTypes.object,
|
|
331
329
|
eventContextTags: PropTypes.array,
|
|
332
|
-
waitEventContextTags: PropTypes.object,
|
|
333
330
|
selectedOfferDetails: PropTypes.array,
|
|
334
331
|
channel: PropTypes.string,
|
|
335
332
|
userLocale: PropTypes.string,
|
|
@@ -53,7 +53,6 @@ function BeeEditor(props) {
|
|
|
53
53
|
BEESelect,
|
|
54
54
|
currentOrgDetails,
|
|
55
55
|
eventContextTags,
|
|
56
|
-
waitEventContextTags,
|
|
57
56
|
} = props;
|
|
58
57
|
const { saveRowRequest } = BEESelect;
|
|
59
58
|
const {formatMessage} = intl;
|
|
@@ -369,7 +368,6 @@ function BeeEditor(props) {
|
|
|
369
368
|
}}
|
|
370
369
|
onContextChange={onContextChange}
|
|
371
370
|
eventContextTags={eventContextTags}
|
|
372
|
-
waitEventContextTags={waitEventContextTags}
|
|
373
371
|
/>
|
|
374
372
|
<CapModal
|
|
375
373
|
className="custom-row-modal"
|
|
@@ -416,7 +414,6 @@ BeeEditor.propTypes = {
|
|
|
416
414
|
onContextChange: PropTypes.func,
|
|
417
415
|
userLocale: PropTypes.string,
|
|
418
416
|
eventContextTags: PropTypes.array,
|
|
419
|
-
waitEventContextTags: PropTypes.object,
|
|
420
417
|
};
|
|
421
418
|
|
|
422
419
|
const mapStateToProps = () => createStructuredSelector({
|
|
@@ -170,7 +170,6 @@ export function SlideBoxContent(props) {
|
|
|
170
170
|
creativesMode,
|
|
171
171
|
hostName = '',
|
|
172
172
|
eventContextTags,
|
|
173
|
-
waitEventContextTags,
|
|
174
173
|
isLoyaltyModule,
|
|
175
174
|
loyaltyMetaData = {},
|
|
176
175
|
showTestAndPreviewSlidebox,
|
|
@@ -454,7 +453,6 @@ export function SlideBoxContent(props) {
|
|
|
454
453
|
selectedOfferDetails,
|
|
455
454
|
getFormData,
|
|
456
455
|
eventContextTags,
|
|
457
|
-
waitEventContextTags,
|
|
458
456
|
};
|
|
459
457
|
|
|
460
458
|
return (
|
|
@@ -489,7 +487,6 @@ export function SlideBoxContent(props) {
|
|
|
489
487
|
enableNewChannels={enableNewChannels}
|
|
490
488
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
491
489
|
eventContextTags={eventContextTags}
|
|
492
|
-
waitEventContextTags={waitEventContextTags}
|
|
493
490
|
loyaltyMetaData={loyaltyMetaData}
|
|
494
491
|
isLoyaltyModule={isLoyaltyModule}
|
|
495
492
|
localTemplatesConfig={localTemplatesConfig}
|
|
@@ -594,7 +591,6 @@ export function SlideBoxContent(props) {
|
|
|
594
591
|
onCreateComplete={onCreateComplete}
|
|
595
592
|
smsRegister={smsRegister}
|
|
596
593
|
eventContextTags={eventContextTags}
|
|
597
|
-
waitEventContextTags={waitEventContextTags}
|
|
598
594
|
getLiquidTags={getLiquidTags}
|
|
599
595
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
600
596
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -638,7 +634,6 @@ export function SlideBoxContent(props) {
|
|
|
638
634
|
}}
|
|
639
635
|
hostName={hostName}
|
|
640
636
|
eventContextTags={eventContextTags}
|
|
641
|
-
waitEventContextTags={waitEventContextTags}
|
|
642
637
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
643
638
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
644
639
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -680,7 +675,6 @@ export function SlideBoxContent(props) {
|
|
|
680
675
|
eventContextTags={eventContextTags}
|
|
681
676
|
restrictPersonalization={restrictPersonalization}
|
|
682
677
|
isAnonymousType={isAnonymousType}
|
|
683
|
-
waitEventContextTags={waitEventContextTags}
|
|
684
678
|
/>
|
|
685
679
|
)}
|
|
686
680
|
|
|
@@ -714,7 +708,6 @@ export function SlideBoxContent(props) {
|
|
|
714
708
|
moduleType={moduleType}
|
|
715
709
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
716
710
|
eventContextTags={eventContextTags}
|
|
717
|
-
waitEventContextTags={waitEventContextTags}
|
|
718
711
|
isLoyaltyModule={isLoyaltyModule}
|
|
719
712
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
720
713
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -759,7 +752,6 @@ export function SlideBoxContent(props) {
|
|
|
759
752
|
moduleType={moduleType}
|
|
760
753
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
761
754
|
eventContextTags={eventContextTags}
|
|
762
|
-
waitEventContextTags={waitEventContextTags}
|
|
763
755
|
isLoyaltyModule={isLoyaltyModule}
|
|
764
756
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
765
757
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -799,7 +791,6 @@ export function SlideBoxContent(props) {
|
|
|
799
791
|
moduleType={moduleType}
|
|
800
792
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
801
793
|
eventContextTags={eventContextTags}
|
|
802
|
-
waitEventContextTags={waitEventContextTags}
|
|
803
794
|
isLoyaltyModule={isLoyaltyModule}
|
|
804
795
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
805
796
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -843,7 +834,6 @@ export function SlideBoxContent(props) {
|
|
|
843
834
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
844
835
|
creativesMode={creativesMode}
|
|
845
836
|
eventContextTags={eventContextTags}
|
|
846
|
-
waitEventContextTags={waitEventContextTags}
|
|
847
837
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
848
838
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
849
839
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -876,7 +866,6 @@ export function SlideBoxContent(props) {
|
|
|
876
866
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
877
867
|
creativesMode={creativesMode}
|
|
878
868
|
eventContextTags={eventContextTags}
|
|
879
|
-
waitEventContextTags={waitEventContextTags}
|
|
880
869
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
881
870
|
handleClose={handleClose}
|
|
882
871
|
restrictPersonalization={restrictPersonalization}
|
|
@@ -916,7 +905,6 @@ export function SlideBoxContent(props) {
|
|
|
916
905
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
917
906
|
onTestContentClicked={onTestContentClicked}
|
|
918
907
|
eventContextTags={eventContextTags}
|
|
919
|
-
waitEventContextTags={waitEventContextTags}
|
|
920
908
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
921
909
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
922
910
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -955,7 +943,6 @@ export function SlideBoxContent(props) {
|
|
|
955
943
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
956
944
|
onTestContentClicked={onTestContentClicked}
|
|
957
945
|
eventContextTags={eventContextTags}
|
|
958
|
-
waitEventContextTags={waitEventContextTags}
|
|
959
946
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
960
947
|
onCreateComplete={onCreateComplete}
|
|
961
948
|
creativesMode={creativesMode}
|
|
@@ -981,7 +968,6 @@ export function SlideBoxContent(props) {
|
|
|
981
968
|
onSelectTemplate={onSelectTemplate}
|
|
982
969
|
orgUnitId={orgUnitId}
|
|
983
970
|
eventContextTags={eventContextTags}
|
|
984
|
-
waitEventContextTags={waitEventContextTags}
|
|
985
971
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
986
972
|
/>
|
|
987
973
|
)
|
|
@@ -1003,7 +989,6 @@ export function SlideBoxContent(props) {
|
|
|
1003
989
|
fbAdManager={fbAdManager}
|
|
1004
990
|
onSelectTemplate={onSelectTemplate}
|
|
1005
991
|
eventContextTags={eventContextTags}
|
|
1006
|
-
waitEventContextTags={waitEventContextTags}
|
|
1007
992
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1008
993
|
/>
|
|
1009
994
|
)
|
|
@@ -1027,7 +1012,6 @@ export function SlideBoxContent(props) {
|
|
|
1027
1012
|
handleClose={handleClose}
|
|
1028
1013
|
selectedOfferDetails={selectedOfferDetails}
|
|
1029
1014
|
eventContextTags={eventContextTags}
|
|
1030
|
-
waitEventContextTags={waitEventContextTags}
|
|
1031
1015
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1032
1016
|
/>
|
|
1033
1017
|
)
|
|
@@ -1048,7 +1032,6 @@ export function SlideBoxContent(props) {
|
|
|
1048
1032
|
handleClose={handleClose}
|
|
1049
1033
|
selectedOfferDetails={selectedOfferDetails}
|
|
1050
1034
|
eventContextTags={eventContextTags}
|
|
1051
|
-
waitEventContextTags={waitEventContextTags}
|
|
1052
1035
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1053
1036
|
/>
|
|
1054
1037
|
)
|
|
@@ -1065,7 +1048,6 @@ export function SlideBoxContent(props) {
|
|
|
1065
1048
|
templateData={templateData}
|
|
1066
1049
|
selectedOfferDetails={selectedOfferDetails}
|
|
1067
1050
|
eventContextTags={eventContextTags}
|
|
1068
|
-
waitEventContextTags={waitEventContextTags}
|
|
1069
1051
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1070
1052
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
1071
1053
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -1090,7 +1072,6 @@ export function SlideBoxContent(props) {
|
|
|
1090
1072
|
handleTestAndPreview={handleTestAndPreview}
|
|
1091
1073
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
1092
1074
|
eventContextTags={eventContextTags}
|
|
1093
|
-
waitEventContextTags={waitEventContextTags}
|
|
1094
1075
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1095
1076
|
createNew/> }
|
|
1096
1077
|
|
|
@@ -1098,7 +1079,6 @@ export function SlideBoxContent(props) {
|
|
|
1098
1079
|
isFullMode={isFullMode}
|
|
1099
1080
|
onCreateComplete={onCreateComplete}
|
|
1100
1081
|
eventContextTags={eventContextTags}
|
|
1101
|
-
waitEventContextTags={waitEventContextTags}
|
|
1102
1082
|
handleClose={handleClose}
|
|
1103
1083
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1104
1084
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
@@ -1116,7 +1096,6 @@ export function SlideBoxContent(props) {
|
|
|
1116
1096
|
forwardedTags={forwardedTags}
|
|
1117
1097
|
selectedOfferDetails={selectedOfferDetails}
|
|
1118
1098
|
eventContextTags={eventContextTags}
|
|
1119
|
-
waitEventContextTags={waitEventContextTags}
|
|
1120
1099
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
1121
1100
|
handleTestAndPreview={handleTestAndPreview}
|
|
1122
1101
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
@@ -1155,7 +1134,6 @@ export function SlideBoxContent(props) {
|
|
|
1155
1134
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
1156
1135
|
onTestContentClicked={onTestContentClicked}
|
|
1157
1136
|
eventContextTags={eventContextTags}
|
|
1158
|
-
waitEventContextTags={waitEventContextTags}
|
|
1159
1137
|
onCreateComplete={onCreateComplete}
|
|
1160
1138
|
handleClose={handleClose}
|
|
1161
1139
|
moduleType={moduleType}
|
|
@@ -1191,7 +1169,6 @@ export function SlideBoxContent(props) {
|
|
|
1191
1169
|
moduleType={moduleType}
|
|
1192
1170
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1193
1171
|
eventContextTags={eventContextTags}
|
|
1194
|
-
waitEventContextTags={waitEventContextTags}
|
|
1195
1172
|
onCreateComplete={onCreateComplete}
|
|
1196
1173
|
handleClose={handleClose}
|
|
1197
1174
|
getDefaultTags={type}
|
|
@@ -1215,7 +1192,6 @@ export function SlideBoxContent(props) {
|
|
|
1215
1192
|
onCreateComplete={onCreateComplete}
|
|
1216
1193
|
selectedOfferDetails={selectedOfferDetails}
|
|
1217
1194
|
eventContextTags={eventContextTags}
|
|
1218
|
-
waitEventContextTags={waitEventContextTags}
|
|
1219
1195
|
params={{
|
|
1220
1196
|
id: templateData._id,
|
|
1221
1197
|
}}
|
|
@@ -1254,7 +1230,6 @@ export function SlideBoxContent(props) {
|
|
|
1254
1230
|
eventContextTags={eventContextTags}
|
|
1255
1231
|
restrictPersonalization={restrictPersonalization}
|
|
1256
1232
|
isAnonymousType={isAnonymousType}
|
|
1257
|
-
waitEventContextTags={waitEventContextTags}
|
|
1258
1233
|
/>
|
|
1259
1234
|
)}
|
|
1260
1235
|
{isCreateRcs && (<Rcs
|
|
@@ -1349,8 +1324,6 @@ SlideBoxContent.propTypes = {
|
|
|
1349
1324
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1350
1325
|
handleTestAndPreview: PropTypes.func,
|
|
1351
1326
|
handleCloseTestAndPreview: PropTypes.func,
|
|
1352
|
-
isTestAndPreviewMode: PropTypes.bool
|
|
1353
|
-
waitEventContextTags: PropTypes.object,
|
|
1354
|
-
eventContextTags: PropTypes.array,
|
|
1327
|
+
isTestAndPreviewMode: PropTypes.bool
|
|
1355
1328
|
};
|
|
1356
1329
|
export default SlideBoxContent;
|
|
@@ -2125,7 +2125,6 @@ export class Creatives extends React.Component {
|
|
|
2125
2125
|
smsRegister,
|
|
2126
2126
|
enableNewChannels,
|
|
2127
2127
|
eventContextTags,
|
|
2128
|
-
waitEventContextTags,
|
|
2129
2128
|
isLoyaltyModule,
|
|
2130
2129
|
loyaltyMetaData = {},
|
|
2131
2130
|
} = this.props;
|
|
@@ -2290,7 +2289,6 @@ export class Creatives extends React.Component {
|
|
|
2290
2289
|
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.
|
|
2291
2290
|
hostName={this.props?.hostName || ''}
|
|
2292
2291
|
eventContextTags={eventContextTags}
|
|
2293
|
-
waitEventContextTags={waitEventContextTags}
|
|
2294
2292
|
isLoyaltyModule={isLoyaltyModule}
|
|
2295
2293
|
loyaltyMetaData={loyaltyMetaData}
|
|
2296
2294
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
@@ -2384,7 +2382,6 @@ Creatives.propTypes = {
|
|
|
2384
2382
|
orgUnitId: PropTypes.number,
|
|
2385
2383
|
hostName: PropTypes.string,
|
|
2386
2384
|
eventContextTags: PropTypes.array,
|
|
2387
|
-
waitEventContextTags: PropTypes.object,
|
|
2388
2385
|
loyaltyTagFetchingDependencies: PropTypes.object,
|
|
2389
2386
|
customerType: PropTypes.string,
|
|
2390
2387
|
intl: PropTypes.shape({
|
|
@@ -3134,7 +3134,6 @@ 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}
|
|
3138
3137
|
forwardedTags={this.props?.forwardedTags}
|
|
3139
3138
|
isLoyaltyModule={this.props?.isLoyaltyModule}
|
|
3140
3139
|
isTestAndPreviewMode={this.state.isTestAndPreviewMode} // Add flag to prevent validation
|
|
@@ -54,7 +54,6 @@ const EmailHTMLEditor = (props) => {
|
|
|
54
54
|
globalActions,
|
|
55
55
|
loadingTags,
|
|
56
56
|
eventContextTags,
|
|
57
|
-
waitEventContextTags,
|
|
58
57
|
forwardedTags,
|
|
59
58
|
selectedOfferDetails,
|
|
60
59
|
currentOrgDetails,
|
|
@@ -503,7 +502,6 @@ const EmailHTMLEditor = (props) => {
|
|
|
503
502
|
location,
|
|
504
503
|
tagModule: getDefaultTags,
|
|
505
504
|
isFullMode,
|
|
506
|
-
waitEventContextTags,
|
|
507
505
|
});
|
|
508
506
|
|
|
509
507
|
if (!validationResult.valid) {
|
|
@@ -512,7 +510,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
512
510
|
setTagValidationError(null);
|
|
513
511
|
}
|
|
514
512
|
}
|
|
515
|
-
}, [tags, injectedTags, location, getDefaultTags, eventContextTags,
|
|
513
|
+
}, [tags, injectedTags, location, getDefaultTags, eventContextTags, showLiquidErrorInFooter]);
|
|
516
514
|
|
|
517
515
|
// Store the last validation state received from HTMLEditor
|
|
518
516
|
const lastValidationStateRef = useRef(null);
|
|
@@ -1102,7 +1100,6 @@ const EmailHTMLEditor = (props) => {
|
|
|
1102
1100
|
injectedTags={injectedTags || {}}
|
|
1103
1101
|
selectedOfferDetails={selectedOfferDetails}
|
|
1104
1102
|
eventContextTags={eventContextTags}
|
|
1105
|
-
waitEventContextTags={waitEventContextTags}
|
|
1106
1103
|
showHeading
|
|
1107
1104
|
showTagList
|
|
1108
1105
|
showInput
|
|
@@ -1127,7 +1124,6 @@ const EmailHTMLEditor = (props) => {
|
|
|
1127
1124
|
injectedTags={injectedTags}
|
|
1128
1125
|
location={location}
|
|
1129
1126
|
eventContextTags={eventContextTags}
|
|
1130
|
-
waitEventContextTags={waitEventContextTags}
|
|
1131
1127
|
selectedOfferDetails={selectedOfferDetails}
|
|
1132
1128
|
channel={EMAIL}
|
|
1133
1129
|
userLocale={intl.locale || 'en'}
|
|
@@ -1155,7 +1151,6 @@ EmailHTMLEditor.propTypes = {
|
|
|
1155
1151
|
globalActions: PropTypes.object,
|
|
1156
1152
|
loadingTags: PropTypes.bool,
|
|
1157
1153
|
eventContextTags: PropTypes.array,
|
|
1158
|
-
waitEventContextTags: PropTypes.object,
|
|
1159
1154
|
forwardedTags: PropTypes.object,
|
|
1160
1155
|
selectedOfferDetails: PropTypes.array,
|
|
1161
1156
|
currentOrgDetails: PropTypes.object,
|
|
@@ -1202,7 +1197,6 @@ EmailHTMLEditor.defaultProps = {
|
|
|
1202
1197
|
globalActions: {},
|
|
1203
1198
|
loadingTags: false,
|
|
1204
1199
|
eventContextTags: [],
|
|
1205
|
-
waitEventContextTags: {},
|
|
1206
1200
|
forwardedTags: {},
|
|
1207
1201
|
selectedOfferDetails: [],
|
|
1208
1202
|
currentOrgDetails: {},
|
|
@@ -173,7 +173,6 @@ const EmailWrapperView = ({
|
|
|
173
173
|
forwardedTags,
|
|
174
174
|
selectedOfferDetails,
|
|
175
175
|
eventContextTags,
|
|
176
|
-
waitEventContextTags,
|
|
177
176
|
getFormdata,
|
|
178
177
|
isGetFormData,
|
|
179
178
|
getLiquidTags,
|
|
@@ -247,7 +246,6 @@ const EmailWrapperView = ({
|
|
|
247
246
|
globalActions,
|
|
248
247
|
loadingTags,
|
|
249
248
|
eventContextTags,
|
|
250
|
-
waitEventContextTags,
|
|
251
249
|
forwardedTags,
|
|
252
250
|
selectedOfferDetails,
|
|
253
251
|
currentOrgDetails,
|
|
@@ -373,7 +371,6 @@ EmailWrapperView.propTypes = {
|
|
|
373
371
|
forwardedTags: PropTypes.object,
|
|
374
372
|
selectedOfferDetails: PropTypes.array,
|
|
375
373
|
eventContextTags: PropTypes.array,
|
|
376
|
-
waitEventContextTags: PropTypes.object,
|
|
377
374
|
emailActions: PropTypes.object,
|
|
378
375
|
Email: PropTypes.object,
|
|
379
376
|
templateData: PropTypes.object,
|
|
@@ -71,10 +71,7 @@ jest.mock('../../../../v2Components/HtmlEditor/index.lazy', () => {
|
|
|
71
71
|
}));
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
|
-
<div
|
|
75
|
-
data-testid="html-editor"
|
|
76
|
-
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
77
|
-
>
|
|
74
|
+
<div data-testid="html-editor">
|
|
78
75
|
<button
|
|
79
76
|
onClick={() => props.onContentChange && props.onContentChange('<p>New content</p>')}
|
|
80
77
|
data-testid="trigger-content-change"
|
|
@@ -133,10 +130,7 @@ jest.mock('../../../../v2Components/HtmlEditor', () => {
|
|
|
133
130
|
}));
|
|
134
131
|
|
|
135
132
|
return (
|
|
136
|
-
<div
|
|
137
|
-
data-testid="html-editor"
|
|
138
|
-
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
139
|
-
>
|
|
133
|
+
<div data-testid="html-editor">
|
|
140
134
|
<button
|
|
141
135
|
onClick={() => props.onContentChange && props.onContentChange('<p>New content</p>')}
|
|
142
136
|
data-testid="trigger-content-change"
|
|
@@ -370,7 +364,6 @@ const defaultProps = {
|
|
|
370
364
|
},
|
|
371
365
|
loadingTags: false,
|
|
372
366
|
eventContextTags: [],
|
|
373
|
-
waitEventContextTags: {},
|
|
374
367
|
forwardedTags: {},
|
|
375
368
|
selectedOfferDetails: [],
|
|
376
369
|
currentOrgDetails: {
|
|
@@ -529,17 +522,6 @@ describe('EmailHTMLEditor', () => {
|
|
|
529
522
|
});
|
|
530
523
|
});
|
|
531
524
|
|
|
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
|
-
|
|
543
525
|
describe('Content Initialization', () => {
|
|
544
526
|
it('initializes with empty content in create mode', () => {
|
|
545
527
|
renderWithIntl({ isGetFormData: false });
|
|
@@ -37,14 +37,7 @@ jest.mock('../EmailHTMLEditor', () => {
|
|
|
37
37
|
getContentForPreview: jest.fn(() => '<p>Test</p>'),
|
|
38
38
|
}));
|
|
39
39
|
|
|
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
|
-
);
|
|
40
|
+
return <div data-testid="email-html-editor">HTML Editor</div>;
|
|
48
41
|
});
|
|
49
42
|
});
|
|
50
43
|
|
|
@@ -144,7 +137,6 @@ const defaultProps = {
|
|
|
144
137
|
forwardedTags: {},
|
|
145
138
|
selectedOfferDetails: [],
|
|
146
139
|
eventContextTags: [],
|
|
147
|
-
waitEventContextTags: {},
|
|
148
140
|
getFormdata: jest.fn(),
|
|
149
141
|
isGetFormData: false,
|
|
150
142
|
getLiquidTags: jest.fn(),
|
|
@@ -179,13 +171,6 @@ describe('EmailWrapperView', () => {
|
|
|
179
171
|
jest.clearAllMocks();
|
|
180
172
|
});
|
|
181
173
|
|
|
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
|
-
|
|
189
174
|
describe('Mode Selection UI', () => {
|
|
190
175
|
it('renders mode selection when step is MODE_SELECTION', () => {
|
|
191
176
|
renderWithIntl({ step: STEPS.MODE_SELECTION });
|
|
@@ -51,7 +51,6 @@ const useEmailWrapper = ({
|
|
|
51
51
|
editor,
|
|
52
52
|
moduleType,
|
|
53
53
|
eventContextTags,
|
|
54
|
-
waitEventContextTags,
|
|
55
54
|
isLoyaltyModule,
|
|
56
55
|
// Props for CmsTemplates component
|
|
57
56
|
cmsTemplatesLoader,
|
|
@@ -738,7 +737,6 @@ const useEmailWrapper = ({
|
|
|
738
737
|
selectedEditorMode, // Pass selected mode to Email component (only for HTML_EDITOR)
|
|
739
738
|
moduleType,
|
|
740
739
|
eventContextTags,
|
|
741
|
-
waitEventContextTags,
|
|
742
740
|
isLoyaltyModule,
|
|
743
741
|
showTestAndPreviewSlidebox,
|
|
744
742
|
handleTestAndPreview,
|
|
@@ -768,7 +766,6 @@ const useEmailWrapper = ({
|
|
|
768
766
|
editor,
|
|
769
767
|
moduleType,
|
|
770
768
|
eventContextTags,
|
|
771
|
-
waitEventContextTags,
|
|
772
769
|
isLoyaltyModule,
|
|
773
770
|
showTestAndPreviewSlidebox,
|
|
774
771
|
handleTestAndPreview,
|
|
@@ -63,7 +63,6 @@ const EmailWrapper = (props) => {
|
|
|
63
63
|
onEnterTemplateName,
|
|
64
64
|
onRemoveTemplateName,
|
|
65
65
|
eventContextTags,
|
|
66
|
-
waitEventContextTags,
|
|
67
66
|
isLoyaltyModule,
|
|
68
67
|
cmsTemplatesLoader,
|
|
69
68
|
onPreviewContentClicked,
|
|
@@ -131,7 +130,6 @@ const EmailWrapper = (props) => {
|
|
|
131
130
|
onEnterTemplateName,
|
|
132
131
|
onRemoveTemplateName,
|
|
133
132
|
eventContextTags,
|
|
134
|
-
waitEventContextTags,
|
|
135
133
|
isLoyaltyModule,
|
|
136
134
|
cmsTemplatesLoader,
|
|
137
135
|
onPreviewContentClicked,
|
|
@@ -186,7 +184,6 @@ const EmailWrapper = (props) => {
|
|
|
186
184
|
forwardedTags={forwardedTags}
|
|
187
185
|
selectedOfferDetails={selectedOfferDetails}
|
|
188
186
|
eventContextTags={eventContextTags}
|
|
189
|
-
waitEventContextTags={waitEventContextTags}
|
|
190
187
|
getFormdata={getFormdata}
|
|
191
188
|
isGetFormData={isGetFormData}
|
|
192
189
|
getLiquidTags={globalActionsProp?.getLiquidTags}
|
|
@@ -244,7 +241,6 @@ EmailWrapper.propTypes = {
|
|
|
244
241
|
onEnterTemplateName: PropTypes.func,
|
|
245
242
|
onRemoveTemplateName: PropTypes.func,
|
|
246
243
|
eventContextTags: PropTypes.array,
|
|
247
|
-
waitEventContextTags: PropTypes.object,
|
|
248
244
|
isLoyaltyModule: PropTypes.bool,
|
|
249
245
|
onPreviewContentClicked: PropTypes.func,
|
|
250
246
|
onTestContentClicked: PropTypes.func,
|
|
@@ -102,7 +102,6 @@ describe('useEmailWrapper', () => {
|
|
|
102
102
|
editor: null,
|
|
103
103
|
moduleType: '',
|
|
104
104
|
eventContextTags: [],
|
|
105
|
-
waitEventContextTags: {},
|
|
106
105
|
isLoyaltyModule: false,
|
|
107
106
|
cmsTemplatesLoader: false,
|
|
108
107
|
currentOrgDetails: { id: 'org1' },
|
|
@@ -121,14 +120,6 @@ describe('useEmailWrapper', () => {
|
|
|
121
120
|
expect(result.current.onTemplateNameChange).toBeInstanceOf(Function);
|
|
122
121
|
});
|
|
123
122
|
|
|
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
|
-
|
|
132
123
|
it('handles template name change correctly', () => {
|
|
133
124
|
const { result } = renderHook(() => useEmailWrapper(mockProps));
|
|
134
125
|
|
|
@@ -78,7 +78,6 @@ describe('useInAppWrapper', () => {
|
|
|
78
78
|
onPreviewContentClicked: jest.fn(),
|
|
79
79
|
onTestContentClicked: jest.fn(),
|
|
80
80
|
eventContextTags: {},
|
|
81
|
-
waitEventContextTags: {},
|
|
82
81
|
onCreateComplete: jest.fn(),
|
|
83
82
|
handleClose: jest.fn(),
|
|
84
83
|
templateData: null,
|
|
@@ -425,24 +424,6 @@ describe('useInAppWrapper', () => {
|
|
|
425
424
|
|
|
426
425
|
expect(capturedState.inAppProps.getDefaultTags).toBe('defaultTags');
|
|
427
426
|
});
|
|
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
|
-
});
|
|
446
427
|
});
|
|
447
428
|
|
|
448
429
|
describe('isShowInAppCreate', () => {
|
|
@@ -33,7 +33,6 @@ const useInAppWrapper = ({
|
|
|
33
33
|
onPreviewContentClicked,
|
|
34
34
|
onTestContentClicked,
|
|
35
35
|
eventContextTags,
|
|
36
|
-
waitEventContextTags,
|
|
37
36
|
onCreateComplete,
|
|
38
37
|
handleClose,
|
|
39
38
|
templateData,
|
|
@@ -150,7 +149,6 @@ const useInAppWrapper = ({
|
|
|
150
149
|
onPreviewContentClicked,
|
|
151
150
|
onTestContentClicked,
|
|
152
151
|
eventContextTags,
|
|
153
|
-
waitEventContextTags,
|
|
154
152
|
onCreateComplete,
|
|
155
153
|
handleClose,
|
|
156
154
|
};
|
|
@@ -175,7 +173,6 @@ const useInAppWrapper = ({
|
|
|
175
173
|
onPreviewContentClicked,
|
|
176
174
|
onTestContentClicked,
|
|
177
175
|
eventContextTags,
|
|
178
|
-
waitEventContextTags,
|
|
179
176
|
onCreateComplete,
|
|
180
177
|
handleClose,
|
|
181
178
|
]);
|
|
@@ -36,7 +36,6 @@ const InAppWrapper = (props) => {
|
|
|
36
36
|
onPreviewContentClicked,
|
|
37
37
|
onTestContentClicked,
|
|
38
38
|
eventContextTags,
|
|
39
|
-
waitEventContextTags,
|
|
40
39
|
onCreateComplete,
|
|
41
40
|
handleClose,
|
|
42
41
|
templateData,
|
|
@@ -79,7 +78,6 @@ const InAppWrapper = (props) => {
|
|
|
79
78
|
onPreviewContentClicked,
|
|
80
79
|
onTestContentClicked,
|
|
81
80
|
eventContextTags,
|
|
82
|
-
waitEventContextTags,
|
|
83
81
|
onCreateComplete,
|
|
84
82
|
handleClose,
|
|
85
83
|
templateData,
|
|
@@ -126,7 +124,6 @@ InAppWrapper.propTypes = {
|
|
|
126
124
|
onPreviewContentClicked: PropTypes.func,
|
|
127
125
|
onTestContentClicked: PropTypes.func,
|
|
128
126
|
eventContextTags: PropTypes.array,
|
|
129
|
-
waitEventContextTags: PropTypes.object,
|
|
130
127
|
onCreateComplete: PropTypes.func,
|
|
131
128
|
handleClose: PropTypes.func,
|
|
132
129
|
templateData: PropTypes.object,
|
|
@@ -1966,7 +1966,6 @@ 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}
|
|
1970
1969
|
messageDetails={this.props?.messageDetails}
|
|
1971
1970
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
1972
1971
|
/>
|
|
@@ -2069,7 +2068,6 @@ Create.propTypes = {
|
|
|
2069
2068
|
onPreviewContentClicked: PropTypes.func,
|
|
2070
2069
|
onTestContentClicked: PropTypes.func,
|
|
2071
2070
|
eventContextTags: PropTypes.array,
|
|
2072
|
-
waitEventContextTags: PropTypes.object,
|
|
2073
2071
|
getLiquidTags: PropTypes.func,
|
|
2074
2072
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2075
2073
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
@@ -2233,7 +2233,6 @@ 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}
|
|
2237
2236
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
2238
2237
|
/>;
|
|
2239
2238
|
})()}
|
|
@@ -2340,7 +2339,6 @@ Edit.propTypes = {
|
|
|
2340
2339
|
onTestContentClicked: PropTypes.func,
|
|
2341
2340
|
creativesMode: PropTypes.string,
|
|
2342
2341
|
eventContextTags: PropTypes.array,
|
|
2343
|
-
waitEventContextTags: PropTypes.object,
|
|
2344
2342
|
getLiquidTags: PropTypes.func,
|
|
2345
2343
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2346
2344
|
showTestAndPreviewSlidebox: PropTypes.bool,
|