@capillarytech/creatives-library 8.0.330-alpha.0 → 8.0.330-alpha.2
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/CapActionButton/constants.js +7 -0
- package/v2Components/CapActionButton/index.js +167 -109
- package/v2Components/CapActionButton/index.scss +157 -6
- package/v2Components/CapActionButton/messages.js +19 -3
- package/v2Components/CapActionButton/tests/index.test.js +41 -17
- 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/CommonTestAndPreview/ExistingCustomerModal.js +1 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +160 -15
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js.rej +18 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +323 -77
- package/v2Components/CommonTestAndPreview/messages.js +8 -0
- package/v2Components/CommonTestAndPreview/reducer.js +3 -1
- package/v2Components/CommonTestAndPreview/sagas.js +2 -1
- package/v2Components/CommonTestAndPreview/tests/PreviewSection.test.js +8 -1
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/RcsPreviewContent.test.js +281 -283
- package/v2Components/FormBuilder/index.js +1 -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/v2Components/TemplatePreview/_templatePreview.scss +33 -23
- package/v2Components/TemplatePreview/constants.js +2 -0
- package/v2Components/TemplatePreview/index.js +143 -28
- package/v2Components/TemplatePreview/tests/index.test.js +142 -0
- package/v2Components/mockdata.js +1 -0
- package/v2Containers/BeeEditor/index.js +19 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +28 -1
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
- package/v2Containers/Email/index.js +78 -39
- package/v2Containers/Email/reducer.js +2 -2
- package/v2Containers/Email/sagas.js +3 -1
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +2 -2
- package/v2Containers/Email/tests/sagas.test.js +230 -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 -1
- 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/constants.js +79 -5
- package/v2Containers/Rcs/index.js +1374 -73
- package/v2Containers/Rcs/index.js.rej +1336 -0
- package/v2Containers/Rcs/index.scss +191 -0
- package/v2Containers/Rcs/index.scss.rej +74 -0
- package/v2Containers/Rcs/messages.js +26 -1
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +69173 -118166
- package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap.rej +128 -0
- package/v2Containers/Rcs/tests/index.test.js +132 -94
- package/v2Containers/Rcs/tests/utils.test.js +220 -38
- package/v2Containers/Rcs/utils.js +77 -1
- package/v2Containers/Sms/Edit/index.js +2 -0
- package/v2Containers/SmsWrapper/index.js +2 -0
- package/v2Containers/TagList/index.js +73 -20
- 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/Templates/_templates.scss +99 -0
- package/v2Containers/Templates/index.js +29 -14
- package/v2Containers/Viber/index.js +3 -0
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +0 -2
- package/v2Containers/WebPush/Create/index.js +10 -2
- package/v2Containers/Whatsapp/index.js +5 -0
- package/v2Containers/Zalo/index.js +2 -0
|
@@ -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;
|
|
@@ -64,6 +64,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
templateStep="modeSelection"
|
|
67
|
+
waitEventContextTags={Object {}}
|
|
67
68
|
weChatMaptemplateStep={0}
|
|
68
69
|
weChatTemplateType=""
|
|
69
70
|
/>
|
|
@@ -162,6 +163,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
|
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
templateStep="modeSelection"
|
|
166
|
+
waitEventContextTags={Object {}}
|
|
165
167
|
weChatMaptemplateStep={0}
|
|
166
168
|
weChatTemplateType=""
|
|
167
169
|
/>
|
|
@@ -255,6 +257,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
|
|
|
255
257
|
showTestAndPreviewSlidebox={false}
|
|
256
258
|
slidBoxContent="editTemplate"
|
|
257
259
|
templateStep="modeSelection"
|
|
260
|
+
waitEventContextTags={Object {}}
|
|
258
261
|
weChatMaptemplateStep={0}
|
|
259
262
|
weChatTemplateType=""
|
|
260
263
|
/>
|
|
@@ -395,6 +398,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
395
398
|
showTestAndPreviewSlidebox={false}
|
|
396
399
|
slidBoxContent="editTemplate"
|
|
397
400
|
templateStep="modeSelection"
|
|
401
|
+
waitEventContextTags={Object {}}
|
|
398
402
|
weChatMaptemplateStep={0}
|
|
399
403
|
weChatTemplateType=""
|
|
400
404
|
/>
|
|
@@ -535,6 +539,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
|
|
|
535
539
|
showTestAndPreviewSlidebox={false}
|
|
536
540
|
slidBoxContent="editTemplate"
|
|
537
541
|
templateStep="modeSelection"
|
|
542
|
+
waitEventContextTags={Object {}}
|
|
538
543
|
weChatMaptemplateStep={0}
|
|
539
544
|
weChatTemplateType=""
|
|
540
545
|
/>
|
|
@@ -91,6 +91,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
91
91
|
saveForm: false,
|
|
92
92
|
showTestAndPreviewSlidebox: false,
|
|
93
93
|
isTestAndPreviewMode: false, // Add flag to prevent validation during Test & Preview
|
|
94
|
+
isGetBeeData: false,
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
this.isTagLoaded = false;
|
|
@@ -509,6 +510,39 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
509
510
|
const formData = _.cloneDeep(this.state.formData);
|
|
510
511
|
|
|
511
512
|
const schema = _.cloneDeep(this.state.schema);
|
|
513
|
+
|
|
514
|
+
// Apply BEE/CK visibility synchronously into the schema before setState so that
|
|
515
|
+
// the committed state already has the correct display values — this prevents the
|
|
516
|
+
// race condition where hideEdmOptions (setTimeout) could be overwritten by a
|
|
517
|
+
// concurrent prop-triggered setState that clones the schema before it commits.
|
|
518
|
+
const isDragDropForHide = nextProps.Email.CmsSettings.isDragDrop && this.checkBeeEditorAllowedForLibrary();
|
|
519
|
+
_.forEach(schema.containers, (container) => {
|
|
520
|
+
if (container.isActive) {
|
|
521
|
+
_.forEach(container?.tabBarExtraContent?.sections?.[0]?.inputFields?.[0]?.cols, (col) => {
|
|
522
|
+
if (col.id === 'insert-image') {
|
|
523
|
+
col.style.display = isDragDropForHide ? 'none' : '';
|
|
524
|
+
}
|
|
525
|
+
if (col.id === 'tab-options-popover') {
|
|
526
|
+
col.colStyle.display = isDragDropForHide ? 'flex' : 'none';
|
|
527
|
+
_.forEach(col.content.sections[0].inputFields, (tabPopoverSection) => {
|
|
528
|
+
if (tabPopoverSection.cols[0].id === 'switch-editor-label') {
|
|
529
|
+
tabPopoverSection.cols[0].style.display = isDragDropForHide ? '' : 'none';
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
if (col.value && col.value.sections) {
|
|
533
|
+
_.forEach(col.value.sections[0].inputFields, (valueInputField) => {
|
|
534
|
+
_.forEach(valueInputField.cols, (valueCol) => {
|
|
535
|
+
if (valueCol.id === 'tab-option-icon') {
|
|
536
|
+
valueCol.colStyle = { ...valueCol.colStyle, display: hasSupportCKEditor() ? 'flex' : 'none' };
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
|
|
512
546
|
const langIndex = formData[this.state.currentTab - 1]?.selectedLanguages?.indexOf(langId);
|
|
513
547
|
|
|
514
548
|
const temp = (schema.containers || {})[this.state.currentTab - 1];
|
|
@@ -1345,6 +1379,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1345
1379
|
saveObj: {},
|
|
1346
1380
|
showEdmEmailTemplates: false,
|
|
1347
1381
|
editDataSet: false,
|
|
1382
|
+
isGetBeeData: false,
|
|
1348
1383
|
}, () => {
|
|
1349
1384
|
|
|
1350
1385
|
});
|
|
@@ -1957,7 +1992,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1957
1992
|
}
|
|
1958
1993
|
|
|
1959
1994
|
switchEditor = () => {
|
|
1960
|
-
this.setState({showConfirmationModal: true});
|
|
1995
|
+
this.setState({showConfirmationModal: true, isGetBeeData: true});
|
|
1961
1996
|
}
|
|
1962
1997
|
|
|
1963
1998
|
renameVersion = () => {
|
|
@@ -2791,47 +2826,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2791
2826
|
// }
|
|
2792
2827
|
}
|
|
2793
2828
|
handleOk = () => {
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
const langIndex = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
|
|
2797
|
-
|
|
2798
|
-
// Store current content before switching
|
|
2799
|
-
const currentContent = formData[`${this.state.currentTab - 1}`][activeLangTab]['template-content'];
|
|
2800
|
-
|
|
2801
|
-
// Update formData to mark as not drag-drop
|
|
2802
|
-
formData[`${this.state.currentTab - 1}`][activeLangTab].is_drag_drop = false;
|
|
2803
|
-
if (formData[`${this.state.currentTab - 1}`].base) {
|
|
2804
|
-
formData.base[activeLangTab].is_drag_drop = false;
|
|
2829
|
+
if (this.beeInstance) {
|
|
2830
|
+
this.beeInstance.save()
|
|
2805
2831
|
}
|
|
2806
|
-
|
|
2807
|
-
this.setState({
|
|
2808
|
-
mode: "switchEditor",
|
|
2809
|
-
formData
|
|
2810
|
-
}, () => {
|
|
2811
|
-
// No need to call handleEdmSave as we're switching to CKEditor
|
|
2812
|
-
let schema = _.cloneDeep(this.state.schema);
|
|
2813
|
-
_.forEach(schema.containers, (container, index) => {
|
|
2814
|
-
if (parseInt(index, 10) === (this.state.currentTab - 1)) {
|
|
2815
|
-
const temp = container;
|
|
2816
|
-
const langTab = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
|
|
2817
|
-
|
|
2818
|
-
temp.panes[langTab].sections[0].inputFields[0].cols[0].colStyle = {display: ""};
|
|
2819
|
-
temp.panes[langTab].sections[0].inputFields[0].cols[1].colStyle = {display: "none"};
|
|
2820
|
-
temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].colStyle.display = "none";
|
|
2821
|
-
}
|
|
2822
|
-
});
|
|
2823
|
-
schema = this.showInsertImageButton(schema);
|
|
2824
|
-
|
|
2825
|
-
this.setState({
|
|
2826
|
-
schema,
|
|
2827
|
-
showConfirmationModal: false,
|
|
2828
|
-
isSchemaChanged: true
|
|
2829
|
-
});
|
|
2830
|
-
});
|
|
2831
2832
|
}
|
|
2832
2833
|
|
|
2833
2834
|
handleCancel = () => {
|
|
2834
|
-
this.setState({ showConfirmationModal: false });
|
|
2835
|
+
this.setState({ showConfirmationModal: false, editDataSet: false, isGetBeeData: false });
|
|
2835
2836
|
}
|
|
2836
2837
|
|
|
2837
2838
|
handleCancelModal = () => {
|
|
@@ -3034,6 +3035,42 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
3034
3035
|
saveBeeInstance = (instance) => {
|
|
3035
3036
|
this.beeInstance = instance;
|
|
3036
3037
|
}
|
|
3038
|
+
|
|
3039
|
+
getBEEData = (json, html) => {
|
|
3040
|
+
this.setState((prevState) => {
|
|
3041
|
+
const formData = _.cloneDeep(prevState.formData);
|
|
3042
|
+
const activeLangTab = formData[`${prevState.currentTab - 1}`].activeTab;
|
|
3043
|
+
|
|
3044
|
+
// Mark as not drag-drop and capture BEE content in one pass
|
|
3045
|
+
formData[`${prevState.currentTab - 1}`][activeLangTab].is_drag_drop = false;
|
|
3046
|
+
formData[`${prevState.currentTab - 1}`][activeLangTab]['template-content'] = html;
|
|
3047
|
+
formData[`${prevState.currentTab - 1}`][activeLangTab]['json-content'] = json;
|
|
3048
|
+
formData.base[activeLangTab].is_drag_drop = false;
|
|
3049
|
+
formData.base[activeLangTab]['template-content'] = html;
|
|
3050
|
+
formData.base[activeLangTab]['json-content'] = json;
|
|
3051
|
+
|
|
3052
|
+
return { mode: "switchEditor", formData };
|
|
3053
|
+
}, () => {
|
|
3054
|
+
const { formData, currentTab } = this.state;
|
|
3055
|
+
const activeLangTab = formData[`${currentTab - 1}`].activeTab;
|
|
3056
|
+
let schema = _.cloneDeep(this.state.schema);
|
|
3057
|
+
|
|
3058
|
+
_.forEach(schema.containers, (container, index) => {
|
|
3059
|
+
if (parseInt(index, 10) === (currentTab - 1)) {
|
|
3060
|
+
const langTab = formData[`${currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
|
|
3061
|
+
container.panes[langTab].sections[0].inputFields[0].cols[0].colStyle = { display: "" };
|
|
3062
|
+
container.panes[langTab].sections[0].inputFields[0].cols[1].colStyle = { display: "none" };
|
|
3063
|
+
container.tabBarExtraContent.sections[0].inputFields[0].cols[4].colStyle.display = "none";
|
|
3064
|
+
}
|
|
3065
|
+
});
|
|
3066
|
+
|
|
3067
|
+
schema = this.showInsertImageButton(schema);
|
|
3068
|
+
this.setState({ schema, showConfirmationModal: false, isSchemaChanged: true, isGetBeeData: false }, () => {
|
|
3069
|
+
this.injectEvents(schema);
|
|
3070
|
+
});
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
|
|
3037
3074
|
saveBeeData = (json, html) => {
|
|
3038
3075
|
// Update state with new content
|
|
3039
3076
|
this.setState((prevState) => {
|
|
@@ -3045,7 +3082,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
3045
3082
|
formData[currentTab - 1][activeTab]['json-content'] = json;
|
|
3046
3083
|
formData.base[activeTab]['template-content'] = html;
|
|
3047
3084
|
formData.base[activeTab]['json-content'] = json;
|
|
3048
|
-
|
|
3049
3085
|
return {
|
|
3050
3086
|
...prevState,
|
|
3051
3087
|
formData,
|
|
@@ -3134,8 +3170,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
3134
3170
|
moduleType={moduleType}
|
|
3135
3171
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
3136
3172
|
eventContextTags={this.props?.eventContextTags}
|
|
3173
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
3137
3174
|
forwardedTags={this.props?.forwardedTags}
|
|
3138
3175
|
isLoyaltyModule={this.props?.isLoyaltyModule}
|
|
3176
|
+
isGetBeeData={this.state.isGetBeeData}
|
|
3177
|
+
getBEEData={this.getBEEData}
|
|
3139
3178
|
isTestAndPreviewMode={this.state.isTestAndPreviewMode} // Add flag to prevent validation
|
|
3140
3179
|
/> : ''}
|
|
3141
3180
|
</Col>
|
|
@@ -11,7 +11,7 @@ import * as types from './constants';
|
|
|
11
11
|
const initialState = fromJS({
|
|
12
12
|
createTemplateInProgress: false,
|
|
13
13
|
createResponse: {},
|
|
14
|
-
isBeeEnabled:
|
|
14
|
+
isBeeEnabled: null,
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
function emailReducer(state = initialState, action) {
|
|
@@ -150,7 +150,7 @@ function emailReducer(state = initialState, action) {
|
|
|
150
150
|
.set('fetchingCmsData', false)
|
|
151
151
|
.set('duplicateResponse', fromJS({}))
|
|
152
152
|
.set('cmsData', '')
|
|
153
|
-
.set('isBeeEnabled',
|
|
153
|
+
.set('isBeeEnabled', null);
|
|
154
154
|
case types.TRANSFORM_EMAIL_TEMPLATE_REQUEST:
|
|
155
155
|
return state.set("createTemplateInProgress", true);
|
|
156
156
|
default:
|
|
@@ -107,7 +107,9 @@ export function* getCmsSetting({
|
|
|
107
107
|
}) {
|
|
108
108
|
try {
|
|
109
109
|
const result = yield call(Api.getCmsTemplateSettingsV2, cmsType, projectId, cmsMode, langId, isEdmSupport, isBEEAppEnable);
|
|
110
|
-
|
|
110
|
+
const cmsAccountDetail = result.data?.response.cmsDetails || {};
|
|
111
|
+
const isBeeEnabled = cmsAccountDetail?.type === cmsType;
|
|
112
|
+
yield put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled });
|
|
111
113
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
|
|
112
114
|
} catch (error) {
|
|
113
115
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_FAILURE, error });
|
|
@@ -4,7 +4,7 @@ exports[` 1`] = `
|
|
|
4
4
|
Immutable.Map {
|
|
5
5
|
"createTemplateInProgress": false,
|
|
6
6
|
"createResponse": Immutable.Map {},
|
|
7
|
-
"isBeeEnabled":
|
|
7
|
+
"isBeeEnabled": null,
|
|
8
8
|
}
|
|
9
9
|
`;
|
|
10
10
|
|
|
@@ -12,6 +12,6 @@ exports[` 2`] = `
|
|
|
12
12
|
Immutable.Map {
|
|
13
13
|
"createTemplateInProgress": true,
|
|
14
14
|
"createResponse": Immutable.Map {},
|
|
15
|
-
"isBeeEnabled":
|
|
15
|
+
"isBeeEnabled": null,
|
|
16
16
|
}
|
|
17
17
|
`;
|