@capillarytech/creatives-library 8.0.306 → 8.0.307-alpha.5
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/commonUtils.js +3 -1
- package/utils/tagValidations.js +12 -4
- package/utils/tests/tagValidations.test.js +34 -0
- package/v2Components/CapTagListWithInput/index.js +4 -0
- package/v2Components/CapWhatsappCTA/index.js +2 -0
- package/v2Components/FormBuilder/index.js +15 -0
- package/v2Components/HtmlEditor/HTMLEditor.js +5 -0
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +3 -0
- package/v2Containers/BeeEditor/index.js +3 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +25 -0
- package/v2Containers/CreativesContainer/index.js +3 -0
- package/v2Containers/Email/index.js +1 -0
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +10 -1
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +3 -0
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +1 -0
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +1 -0
- 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 +1 -0
- package/v2Containers/InApp/index.js +3 -0
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +1 -0
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +3 -0
- package/v2Containers/InAppWrapper/index.js +3 -0
- package/v2Containers/InappAdvance/index.js +3 -0
- package/v2Containers/MobilePush/Create/index.js +2 -0
- package/v2Containers/MobilePush/Edit/index.js +2 -0
- package/v2Containers/MobilePushNew/index.js +1 -0
- package/v2Containers/MobilepushWrapper/index.js +3 -1
- package/v2Containers/Rcs/index.js +2 -0
- package/v2Containers/Sms/Create/index.js +2 -0
- package/v2Containers/Sms/Edit/index.js +2 -0
- package/v2Containers/SmsTrai/Edit/index.js +4 -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 +13 -1
- package/v2Containers/TagList/tests/mockdata.js +17 -0
- package/v2Containers/Viber/index.js +5 -0
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +3 -1
- package/v2Containers/WebPush/Create/hooks/useTagManagement.test.js +3 -0
- package/v2Containers/WebPush/Create/index.js +9 -1
- package/v2Containers/WebPush/Create/utils/validation.test.js +2 -0
- package/v2Containers/Whatsapp/index.js +6 -0
- package/v2Containers/Zalo/index.js +3 -0
|
@@ -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,
|
|
@@ -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,
|
|
@@ -1113,6 +1113,7 @@ export const InApp = (props) => {
|
|
|
1113
1113
|
messages: formBuilderMessages,
|
|
1114
1114
|
tagLookupMap: metaEntities?.tagLookupMap || {},
|
|
1115
1115
|
eventContextTags: metaEntities?.eventContextTags || [],
|
|
1116
|
+
waitEventContextTags: metaEntities?.waitEventContextTags || {},
|
|
1116
1117
|
isLiquidFlow,
|
|
1117
1118
|
forwardedTags: {},
|
|
1118
1119
|
skipTags: (tag) => {
|
|
@@ -1161,6 +1162,7 @@ export const InApp = (props) => {
|
|
|
1161
1162
|
tagModule: getDefaultTags,
|
|
1162
1163
|
eventContextTags: metaEntities?.eventContextTags || [],
|
|
1163
1164
|
isFullMode,
|
|
1165
|
+
waitEventContextTags: metaEntities?.waitEventContextTags || {},
|
|
1164
1166
|
}) || {};
|
|
1165
1167
|
|
|
1166
1168
|
if (validationResponse?.unsupportedTags?.length > 0) {
|
|
@@ -1189,6 +1191,7 @@ export const InApp = (props) => {
|
|
|
1189
1191
|
tagModule: getDefaultTags,
|
|
1190
1192
|
eventContextTags: metaEntities?.eventContextTags || [],
|
|
1191
1193
|
isFullMode,
|
|
1194
|
+
waitEventContextTags: metaEntities?.waitEventContextTags || {},
|
|
1192
1195
|
}) || {};
|
|
1193
1196
|
|
|
1194
1197
|
if (validationResponse?.unsupportedTags?.length > 0) {
|
|
@@ -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,
|
|
@@ -838,6 +838,7 @@ export const InappAdvanced = (props) => {
|
|
|
838
838
|
messages: formBuilderMessages,
|
|
839
839
|
tagLookupMap: metaEntities?.tagLookupMap || {},
|
|
840
840
|
eventContextTags: metaEntities?.eventContextTags || [],
|
|
841
|
+
waitEventContextTags: metaEntities?.waitEventContextTags || {},
|
|
841
842
|
isLiquidFlow,
|
|
842
843
|
forwardedTags: {},
|
|
843
844
|
skipTags: (tag) => {
|
|
@@ -886,6 +887,7 @@ export const InappAdvanced = (props) => {
|
|
|
886
887
|
tagModule: getDefaultTags,
|
|
887
888
|
eventContextTags: metaEntities?.eventContextTags || [],
|
|
888
889
|
isFullMode,
|
|
890
|
+
waitEventContextTags: metaEntities?.waitEventContextTags || {},
|
|
889
891
|
}) || {};
|
|
890
892
|
|
|
891
893
|
if (validationResponse?.unsupportedTags?.length > 0) {
|
|
@@ -914,6 +916,7 @@ export const InappAdvanced = (props) => {
|
|
|
914
916
|
tagModule: getDefaultTags,
|
|
915
917
|
eventContextTags: metaEntities?.eventContextTags || [],
|
|
916
918
|
isFullMode,
|
|
919
|
+
waitEventContextTags: metaEntities?.waitEventContextTags || {},
|
|
917
920
|
}) || {};
|
|
918
921
|
|
|
919
922
|
if (validationResponse?.unsupportedTags?.length > 0) {
|
|
@@ -1927,6 +1927,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1927
1927
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
1928
1928
|
isFullMode={this.props.isFullMode}
|
|
1929
1929
|
eventContextTags={this.props?.eventContextTags}
|
|
1930
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1930
1931
|
messageDetails={this.props?.messageDetails}
|
|
1931
1932
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
1932
1933
|
/>
|
|
@@ -2029,6 +2030,7 @@ Create.propTypes = {
|
|
|
2029
2030
|
onPreviewContentClicked: PropTypes.func,
|
|
2030
2031
|
onTestContentClicked: PropTypes.func,
|
|
2031
2032
|
eventContextTags: PropTypes.array,
|
|
2033
|
+
waitEventContextTags: PropTypes.object,
|
|
2032
2034
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2033
2035
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
2034
2036
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -2206,6 +2206,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2206
2206
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
2207
2207
|
isFullMode={this.props.isFullMode}
|
|
2208
2208
|
eventContextTags={this.props?.eventContextTags}
|
|
2209
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
2209
2210
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
2210
2211
|
/>;
|
|
2211
2212
|
})()}
|
|
@@ -2312,6 +2313,7 @@ Edit.propTypes = {
|
|
|
2312
2313
|
onTestContentClicked: PropTypes.func,
|
|
2313
2314
|
creativesMode: PropTypes.string,
|
|
2314
2315
|
eventContextTags: PropTypes.array,
|
|
2316
|
+
waitEventContextTags: PropTypes.object,
|
|
2315
2317
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2316
2318
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
2317
2319
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -2667,6 +2667,7 @@ const MobilePushNew = ({
|
|
|
2667
2667
|
messages: formBuilderMessages,
|
|
2668
2668
|
tagLookupMap: metaEntities?.tagLookupMap || {},
|
|
2669
2669
|
eventContextTags: metaEntities?.eventContextTags || [],
|
|
2670
|
+
waitEventContextTags: metaEntities?.waitEventContextTags || [],
|
|
2670
2671
|
isLiquidFlow: hasLiquidSupportFeature(),
|
|
2671
2672
|
forwardedTags: {},
|
|
2672
2673
|
skipTags: (tag) => {
|
|
@@ -72,7 +72,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
render() {
|
|
75
|
-
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData, eventContextTags = [], showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview, restrictPersonalization, isAnonymousType, onPersonalizationTokensChange} = this.props;
|
|
75
|
+
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData, eventContextTags = [], waitEventContextTags = {}, showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview, restrictPersonalization, isAnonymousType, onPersonalizationTokensChange} = this.props;
|
|
76
76
|
const {templateName} = this.state;
|
|
77
77
|
const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
|
|
78
78
|
return (
|
|
@@ -120,6 +120,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
120
120
|
templateData={templateData}
|
|
121
121
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
122
122
|
eventContextTags={eventContextTags}
|
|
123
|
+
waitEventContextTags={waitEventContextTags}
|
|
123
124
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
124
125
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
125
126
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -153,6 +154,7 @@ MobilepushWrapper.propTypes = {
|
|
|
153
154
|
type: PropTypes.string,
|
|
154
155
|
onValidationFail: PropTypes.func,
|
|
155
156
|
eventContextTags: PropTypes.array,
|
|
157
|
+
waitEventContextTags: PropTypes.object,
|
|
156
158
|
showLiquidErrorInFooter: PropTypes.func,
|
|
157
159
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
158
160
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -150,6 +150,7 @@ export const Rcs = (props) => {
|
|
|
150
150
|
selectedOfferDetails,
|
|
151
151
|
currentOrgDetails,
|
|
152
152
|
eventContextTags,
|
|
153
|
+
waitEventContextTags,
|
|
153
154
|
accountData = {},
|
|
154
155
|
// TestAndPreviewSlidebox props
|
|
155
156
|
showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
|
|
@@ -399,6 +400,7 @@ export const Rcs = (props) => {
|
|
|
399
400
|
location,
|
|
400
401
|
tagModule: getDefaultTags,
|
|
401
402
|
eventContextTags,
|
|
403
|
+
waitEventContextTags,
|
|
402
404
|
isFullMode,
|
|
403
405
|
}) || {};
|
|
404
406
|
const unsupportedTagsLengthCheck =
|
|
@@ -1060,6 +1060,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1060
1060
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
1061
1061
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
1062
1062
|
eventContextTags={this.props?.eventContextTags}
|
|
1063
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1063
1064
|
/>
|
|
1064
1065
|
</CapColumn>
|
|
1065
1066
|
</CapRow>
|
|
@@ -1096,6 +1097,7 @@ Create.propTypes = {
|
|
|
1096
1097
|
isLoadingMetaEntities: PropTypes.bool,
|
|
1097
1098
|
selectedOfferDetails: PropTypes.array,
|
|
1098
1099
|
eventContextTags: PropTypes.array,
|
|
1100
|
+
waitEventContextTags: PropTypes.object,
|
|
1099
1101
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1100
1102
|
handleTestAndPreview: PropTypes.func,
|
|
1101
1103
|
handleCloseTestAndPreview: PropTypes.func,
|
|
@@ -1059,6 +1059,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1059
1059
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
1060
1060
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
1061
1061
|
eventContextTags={this.props?.eventContextTags}
|
|
1062
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1062
1063
|
messageDetails={this.props?.messageDetails}
|
|
1063
1064
|
/>
|
|
1064
1065
|
</CapColumn>
|
|
@@ -1099,6 +1100,7 @@ Edit.propTypes = {
|
|
|
1099
1100
|
injectedTags: PropTypes.object,
|
|
1100
1101
|
selectedOfferDetails: PropTypes.array,
|
|
1101
1102
|
eventContextTags: PropTypes.array,
|
|
1103
|
+
waitEventContextTags: PropTypes.object,
|
|
1102
1104
|
messageDetails: PropTypes.object,
|
|
1103
1105
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1104
1106
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -83,6 +83,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
83
83
|
templateData = {},
|
|
84
84
|
selectedOfferDetails,
|
|
85
85
|
eventContextTags,
|
|
86
|
+
waitEventContextTags,
|
|
86
87
|
fetchingLiquidTags,
|
|
87
88
|
getLiquidTags,
|
|
88
89
|
} = props || {};
|
|
@@ -244,6 +245,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
244
245
|
location,
|
|
245
246
|
tagModule: getDefaultTags,
|
|
246
247
|
eventContextTags,
|
|
248
|
+
waitEventContextTags,
|
|
247
249
|
isFullMode,
|
|
248
250
|
}) || {};
|
|
249
251
|
updateIsTagValidationError(
|
|
@@ -315,6 +317,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
315
317
|
onSuccess,
|
|
316
318
|
tagLookupMap: metaEntities?.tagLookupMap,
|
|
317
319
|
eventContextTags,
|
|
320
|
+
waitEventContextTags,
|
|
318
321
|
isLiquidFlow: true,
|
|
319
322
|
forwardedTags: {},
|
|
320
323
|
});
|
|
@@ -657,6 +660,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
657
660
|
hidePopover={disablehandler()}
|
|
658
661
|
selectedOfferDetails={selectedOfferDetails}
|
|
659
662
|
eventContextTags={eventContextTags}
|
|
663
|
+
waitEventContextTags={waitEventContextTags}
|
|
660
664
|
/>
|
|
661
665
|
)}
|
|
662
666
|
/>
|
|
@@ -30,6 +30,7 @@ const SmsWrapper = (props) => {
|
|
|
30
30
|
smsRegister,
|
|
31
31
|
onShowTemplates,
|
|
32
32
|
eventContextTags,
|
|
33
|
+
waitEventContextTags,
|
|
33
34
|
showLiquidErrorInFooter,
|
|
34
35
|
getLiquidTags,
|
|
35
36
|
showTestAndPreviewSlidebox,
|
|
@@ -52,6 +53,7 @@ const SmsWrapper = (props) => {
|
|
|
52
53
|
onPreviewContentClicked,
|
|
53
54
|
onTestContentClicked,
|
|
54
55
|
eventContextTags,
|
|
56
|
+
waitEventContextTags,
|
|
55
57
|
showLiquidErrorInFooter,
|
|
56
58
|
getLiquidTags,
|
|
57
59
|
showTestAndPreviewSlidebox,
|
|
@@ -167,7 +167,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
167
167
|
let injectedTags = {};
|
|
168
168
|
const eventContextTagsObj = {};
|
|
169
169
|
|
|
170
|
-
const {selectedOfferDetails, eventContextTags } = props;
|
|
170
|
+
const {selectedOfferDetails, eventContextTags, waitEventContextTags } = props;
|
|
171
171
|
if (props.injectedTags && !_.isEmpty(props.injectedTags)) {
|
|
172
172
|
const formattedInjectedTags = handleInjectedData(
|
|
173
173
|
props.injectedTags,
|
|
@@ -219,6 +219,43 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
219
219
|
};
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
+
// Wait event context tags should be displayed in the Add Labels when node is next to Event based wait node.
|
|
223
|
+
if (Object.keys(waitEventContextTags)?.length) {
|
|
224
|
+
|
|
225
|
+
Object.keys(waitEventContextTags).forEach((blockId) => {
|
|
226
|
+
const WAIT_EVENT_HEADER_MSG_LABEL = `${waitEventContextTags[blockId].eventName} (${waitEventContextTags[blockId].blockName})`;
|
|
227
|
+
eventContextTagsObj[blockId] = {
|
|
228
|
+
"name": WAIT_EVENT_HEADER_MSG_LABEL,
|
|
229
|
+
"desc": WAIT_EVENT_HEADER_MSG_LABEL,
|
|
230
|
+
"resolved": true,
|
|
231
|
+
'tag-header': true,
|
|
232
|
+
"subtags": {},
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
waitEventContextTags?.[blockId]?.tags?.forEach((tag) => {
|
|
236
|
+
const {
|
|
237
|
+
tagName, label, profileId, profileName, blockName, eventName
|
|
238
|
+
} = tag || {};
|
|
239
|
+
if (!profileId || !tagName || !label || !profileName) return;
|
|
240
|
+
// Initializing the tags profile if it doesn't exist
|
|
241
|
+
if (!eventContextTagsObj?.[blockId]?.subtags?.[profileId]) {
|
|
242
|
+
eventContextTagsObj[blockId].subtags[profileId] = {
|
|
243
|
+
"name": profileName,
|
|
244
|
+
"desc": profileName,
|
|
245
|
+
"resolved": true,
|
|
246
|
+
'tag-header': true,
|
|
247
|
+
"subtags": {},
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
// Adding the current tag to the profile group
|
|
251
|
+
eventContextTagsObj[blockId].subtags[profileId].subtags[tagName] = {
|
|
252
|
+
name: label,
|
|
253
|
+
desc: label,
|
|
254
|
+
resolved: true,
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
222
259
|
this.setState({tags: _.merge( {}, tags, injectedTags, eventContextTagsObj )});
|
|
223
260
|
}
|
|
224
261
|
|
|
@@ -406,7 +443,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
406
443
|
isDisabled = true;
|
|
407
444
|
tooltipMsg = intl.formatMessage(messages.personalizationNotSupportedAnonymous);
|
|
408
445
|
}
|
|
409
|
-
|
|
446
|
+
|
|
410
447
|
return (
|
|
411
448
|
<div className={this.props.className ? this.props.className : ''}>
|
|
412
449
|
<CapTagList
|
|
@@ -437,6 +474,7 @@ TagList.defaultProps = {
|
|
|
437
474
|
isNewVersionFlow: false,
|
|
438
475
|
userLocale: 'en',
|
|
439
476
|
eventContextTags: [],
|
|
477
|
+
waitEventContextTags: {},
|
|
440
478
|
};
|
|
441
479
|
|
|
442
480
|
TagList.propTypes = {
|
|
@@ -457,6 +495,7 @@ TagList.propTypes = {
|
|
|
457
495
|
disabled: PropTypes.bool,
|
|
458
496
|
fetchingSchemaError: PropTypes.bool,
|
|
459
497
|
eventContextTags: PropTypes.array,
|
|
498
|
+
waitEventContextTags: PropTypes.object,
|
|
460
499
|
popoverPlacement: PropTypes.string,
|
|
461
500
|
// message to show when Add Label button is disabled (e.g. personalization restriction)
|
|
462
501
|
disableTooltipMsg: PropTypes.string,
|
|
@@ -19,4 +19,8 @@ export default defineMessages({
|
|
|
19
19
|
id: `${scope}.personalizationNotSupportedAnonymous`,
|
|
20
20
|
defaultMessage: 'Personalization tags are not supported for anonymous customers',
|
|
21
21
|
},
|
|
22
|
+
waitEvent: {
|
|
23
|
+
id: `${scope}.waitEvent`,
|
|
24
|
+
defaultMessage: 'Wait Event',
|
|
25
|
+
},
|
|
22
26
|
});
|
|
@@ -5,7 +5,7 @@ import { initialReducer } from '../../../initialReducer';
|
|
|
5
5
|
import { injectIntl } from "react-intl";
|
|
6
6
|
import { fireEvent } from "@testing-library/react";
|
|
7
7
|
import { TagList } from '../index';
|
|
8
|
-
import { TagListData, eventContextTags } from './mockdata';
|
|
8
|
+
import { TagListData, eventContextTags, waitEventContextTags } from './mockdata';
|
|
9
9
|
import { Provider } from 'react-redux';
|
|
10
10
|
import { screen, render } from '../../../utils/test-utils';
|
|
11
11
|
import history from '../../../utils/history';
|
|
@@ -56,4 +56,16 @@ describe("TagList test : UNIT", () => {
|
|
|
56
56
|
const BEHAVIOURAL_EVENT_PROFILE = queryByText(/Behavioural event/i);
|
|
57
57
|
expect(BEHAVIOURAL_EVENT_PROFILE).not.toBeInTheDocument();
|
|
58
58
|
});
|
|
59
|
+
|
|
60
|
+
it('should render wait event context tags when waitEventContextTags is provided', () => {
|
|
61
|
+
initializeTagList({ waitEventContextTags });
|
|
62
|
+
addLabelBtnAssertion();
|
|
63
|
+
const WAIT_EVENT_HEADER = getByText(/Order Placed \(Wait Block\)/i);
|
|
64
|
+
expect(WAIT_EVENT_HEADER).toBeInTheDocument();
|
|
65
|
+
fireEvent.click(WAIT_EVENT_HEADER);
|
|
66
|
+
const ORDER_PROFILE = getByText(/Order Profile/i);
|
|
67
|
+
expect(ORDER_PROFILE).toBeInTheDocument();
|
|
68
|
+
fireEvent.click(ORDER_PROFILE);
|
|
69
|
+
expect(getByText(/Order ID/i)).toBeInTheDocument();
|
|
70
|
+
});
|
|
59
71
|
});
|
|
@@ -149,3 +149,20 @@ export const eventContextTags = [
|
|
|
149
149
|
"isDynamicFact": false
|
|
150
150
|
}
|
|
151
151
|
];
|
|
152
|
+
|
|
153
|
+
export const waitEventContextTags = {
|
|
154
|
+
block1: {
|
|
155
|
+
eventName: 'Order Placed',
|
|
156
|
+
blockName: 'Wait Block',
|
|
157
|
+
tags: [
|
|
158
|
+
{
|
|
159
|
+
tagName: 'waitEvent.orderId',
|
|
160
|
+
label: 'Order ID',
|
|
161
|
+
profileId: 'ORDER_PROFILE',
|
|
162
|
+
profileName: 'Order Profile',
|
|
163
|
+
blockName: 'Wait Block',
|
|
164
|
+
eventName: 'Order Placed',
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
};
|
|
@@ -83,6 +83,7 @@ export const Viber = (props) => {
|
|
|
83
83
|
selectedOfferDetails = [],
|
|
84
84
|
currentOrgDetails,
|
|
85
85
|
eventContextTags,
|
|
86
|
+
waitEventContextTags,
|
|
86
87
|
// TestAndPreviewSlidebox props
|
|
87
88
|
showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
|
|
88
89
|
handleTestAndPreview: propsHandleTestAndPreview,
|
|
@@ -237,6 +238,8 @@ export const Viber = (props) => {
|
|
|
237
238
|
injectedTagsParams: injectedTags,
|
|
238
239
|
location,
|
|
239
240
|
tagModule: 'outbound',
|
|
241
|
+
eventContextTags,
|
|
242
|
+
waitEventContextTags,
|
|
240
243
|
isFullMode,
|
|
241
244
|
}) || {};
|
|
242
245
|
if (value.trim() === '') {
|
|
@@ -292,6 +295,7 @@ export const Viber = (props) => {
|
|
|
292
295
|
userLocale={localStorage.getItem("jlocale") || "en"}
|
|
293
296
|
selectedOfferDetails={selectedOfferDetails}
|
|
294
297
|
eventContextTags={eventContextTags}
|
|
298
|
+
waitEventContextTags={waitEventContextTags}
|
|
295
299
|
/>
|
|
296
300
|
</CapColumn>
|
|
297
301
|
<div className="viber-textarea-wrapper">
|
|
@@ -597,6 +601,7 @@ export const Viber = (props) => {
|
|
|
597
601
|
userLocale={localStorage.getItem("jlocale") || "en"}
|
|
598
602
|
selectedOfferDetails={selectedOfferDetails}
|
|
599
603
|
eventContextTags={eventContextTags}
|
|
604
|
+
waitEventContextTags={waitEventContextTags}
|
|
600
605
|
/>
|
|
601
606
|
<CapColumn className="cta-actions">
|
|
602
607
|
<CapButton
|
|
@@ -24,6 +24,7 @@ export const useTagManagement = ({
|
|
|
24
24
|
supportedTags = EMPTY_ARRAY,
|
|
25
25
|
injectedTags,
|
|
26
26
|
eventContextTags = EMPTY_ARRAY,
|
|
27
|
+
waitEventContextTags = EMPTY_ARRAY,
|
|
27
28
|
}) => {
|
|
28
29
|
const [tags, setTags] = useState([]);
|
|
29
30
|
const tagFetchKeyRef = useRef(null);
|
|
@@ -109,8 +110,9 @@ export const useTagManagement = ({
|
|
|
109
110
|
location,
|
|
110
111
|
tagModule: getDefaultTags,
|
|
111
112
|
eventContextTags,
|
|
113
|
+
waitEventContextTags,
|
|
112
114
|
}),
|
|
113
|
-
[tags, injectedTags, location, getDefaultTags, eventContextTags],
|
|
115
|
+
[tags, injectedTags, location, getDefaultTags, eventContextTags, waitEventContextTags],
|
|
114
116
|
);
|
|
115
117
|
|
|
116
118
|
return {
|
|
@@ -530,6 +530,7 @@ describe('useTagManagement', () => {
|
|
|
530
530
|
it('should return validation config with tags', () => {
|
|
531
531
|
const injectedTags = [{ id: 5, name: 'Injected Tag' }];
|
|
532
532
|
const eventContextTags = [{ id: 6, name: 'Event Tag' }];
|
|
533
|
+
const waitEventContextTags = [];
|
|
533
534
|
|
|
534
535
|
const { result } = renderHook(() =>
|
|
535
536
|
useTagManagement({
|
|
@@ -538,6 +539,7 @@ describe('useTagManagement', () => {
|
|
|
538
539
|
metaEntities: defaultMetaEntities,
|
|
539
540
|
injectedTags,
|
|
540
541
|
eventContextTags,
|
|
542
|
+
waitEventContextTags,
|
|
541
543
|
getDefaultTags: 'custom',
|
|
542
544
|
})
|
|
543
545
|
);
|
|
@@ -548,6 +550,7 @@ describe('useTagManagement', () => {
|
|
|
548
550
|
location: defaultLocation,
|
|
549
551
|
tagModule: 'custom',
|
|
550
552
|
eventContextTags,
|
|
553
|
+
waitEventContextTags,
|
|
551
554
|
});
|
|
552
555
|
});
|
|
553
556
|
|
|
@@ -83,6 +83,7 @@ const MemoizedTagList = memo(({
|
|
|
83
83
|
injectedTags,
|
|
84
84
|
selectedOfferDetails,
|
|
85
85
|
eventContextTags,
|
|
86
|
+
waitEventContextTags,
|
|
86
87
|
forwardedTags,
|
|
87
88
|
onTagSelect,
|
|
88
89
|
restrictPersonalization = false,
|
|
@@ -98,6 +99,7 @@ const MemoizedTagList = memo(({
|
|
|
98
99
|
injectedTags={injectedTags}
|
|
99
100
|
selectedOfferDetails={selectedOfferDetails}
|
|
100
101
|
eventContextTags={eventContextTags}
|
|
102
|
+
waitEventContextTags={waitEventContextTags}
|
|
101
103
|
forwardedTags={forwardedTags}
|
|
102
104
|
onTagSelect={onTagSelect}
|
|
103
105
|
restrictPersonalization={restrictPersonalization}
|
|
@@ -115,6 +117,7 @@ const MemoizedTagList = memo(({
|
|
|
115
117
|
&& prevProps.injectedTags === nextProps.injectedTags
|
|
116
118
|
&& prevProps.selectedOfferDetails === nextProps.selectedOfferDetails
|
|
117
119
|
&& prevProps.eventContextTags === nextProps.eventContextTags
|
|
120
|
+
&& prevProps.waitEventContextTags === nextProps.waitEventContextTags
|
|
118
121
|
&& prevProps.forwardedTags === nextProps.forwardedTags
|
|
119
122
|
&& prevProps.onTagSelect === nextProps.onTagSelect
|
|
120
123
|
&& prevProps.restrictPersonalization === nextProps.restrictPersonalization
|
|
@@ -151,6 +154,7 @@ const WebPushCreate = ({
|
|
|
151
154
|
forwardedTags,
|
|
152
155
|
selectedOfferDetails = [],
|
|
153
156
|
eventContextTags = [],
|
|
157
|
+
waitEventContextTags = {},
|
|
154
158
|
templateActions: templateActionsProps,
|
|
155
159
|
Templates,
|
|
156
160
|
restrictPersonalization = false,
|
|
@@ -230,6 +234,7 @@ const WebPushCreate = ({
|
|
|
230
234
|
supportedTags: memoizedSupportedTags,
|
|
231
235
|
injectedTags,
|
|
232
236
|
eventContextTags,
|
|
237
|
+
waitEventContextTags,
|
|
233
238
|
});
|
|
234
239
|
const { tags, handleOnTagsContextChange, validationConfig } = tagState;
|
|
235
240
|
const { weCrmAccounts } = Templates;
|
|
@@ -835,12 +840,13 @@ const WebPushCreate = ({
|
|
|
835
840
|
injectedTags,
|
|
836
841
|
selectedOfferDetails,
|
|
837
842
|
eventContextTags,
|
|
843
|
+
waitEventContextTags,
|
|
838
844
|
forwardedTags,
|
|
839
845
|
restrictPersonalization,
|
|
840
846
|
disabled: restrictPersonalization,
|
|
841
847
|
disableTooltipMsg: restrictPersonalization ? formatMessage(messages.personalizationNotSupportedAnonymous) : undefined,
|
|
842
848
|
}),
|
|
843
|
-
[tags, injectedTags, selectedOfferDetails, eventContextTags, forwardedTags, restrictPersonalization, formatMessage],
|
|
849
|
+
[tags, injectedTags, selectedOfferDetails, eventContextTags, waitEventContextTags, forwardedTags, restrictPersonalization, formatMessage],
|
|
844
850
|
);
|
|
845
851
|
|
|
846
852
|
// Memoized TagList components with optimized props
|
|
@@ -1080,6 +1086,7 @@ WebPushCreate.propTypes = {
|
|
|
1080
1086
|
forwardedTags: PropTypes.object,
|
|
1081
1087
|
selectedOfferDetails: PropTypes.array,
|
|
1082
1088
|
eventContextTags: PropTypes.array,
|
|
1089
|
+
waitEventContextTags: PropTypes.object,
|
|
1083
1090
|
templateActions: PropTypes.object,
|
|
1084
1091
|
restrictPersonalization: PropTypes.bool,
|
|
1085
1092
|
};
|
|
@@ -1108,6 +1115,7 @@ WebPushCreate.defaultProps = {
|
|
|
1108
1115
|
forwardedTags: {},
|
|
1109
1116
|
selectedOfferDetails: [],
|
|
1110
1117
|
eventContextTags: [],
|
|
1118
|
+
waitEventContextTags: {},
|
|
1111
1119
|
templateActions: {},
|
|
1112
1120
|
Templates: {},
|
|
1113
1121
|
restrictPersonalization: false,
|