@capillarytech/creatives-library 8.0.336 → 8.0.338
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/tests/tagValidations.test.js +20 -0
- package/v2Components/CapTagList/index.js +28 -23
- package/v2Components/CapTagList/style.scss +29 -0
- package/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +63 -0
- package/v2Components/CapTagListWithInput/index.js +4 -0
- package/v2Components/CapWhatsappCTA/index.js +2 -0
- package/v2Components/FormBuilder/index.js +7 -0
- package/v2Components/HtmlEditor/HTMLEditor.js +6 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +1 -0
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +927 -2
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +3 -0
- package/v2Components/mockdata.js +1 -0
- package/v2Containers/BeeEditor/index.js +3 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +28 -1
- package/v2Containers/CreativesContainer/index.js +3 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +47 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
- package/v2Containers/Email/index.js +4 -2
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +6 -1
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +3 -0
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +20 -2
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +16 -1
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +3 -0
- package/v2Containers/EmailWrapper/index.js +4 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +1 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +9 -0
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +1 -0
- package/v2Containers/MobilePush/Create/index.js +2 -0
- package/v2Containers/MobilePush/Edit/index.js +2 -0
- package/v2Containers/MobilepushWrapper/index.js +3 -1
- package/v2Containers/Rcs/index.js +1 -0
- package/v2Containers/Sms/Create/index.js +2 -0
- package/v2Containers/Sms/Edit/index.js +2 -0
- package/v2Containers/SmsTrai/Edit/index.js +2 -0
- package/v2Containers/SmsWrapper/index.js +2 -0
- package/v2Containers/TagList/index.js +62 -5
- package/v2Containers/TagList/messages.js +4 -0
- package/v2Containers/TagList/tests/TagList.test.js +124 -20
- package/v2Containers/TagList/tests/mockdata.js +17 -0
- package/v2Containers/Viber/index.js +3 -0
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +0 -2
- package/v2Containers/WebPush/Create/index.js +9 -1
- package/v2Containers/Whatsapp/index.js +5 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +20 -0
- package/v2Containers/Zalo/index.js +2 -0
|
@@ -518,7 +518,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
518
518
|
const isDragDropForHide = nextProps.Email.CmsSettings.isDragDrop && this.checkBeeEditorAllowedForLibrary();
|
|
519
519
|
_.forEach(schema.containers, (container) => {
|
|
520
520
|
if (container.isActive) {
|
|
521
|
-
_.forEach(container
|
|
521
|
+
_.forEach(container?.tabBarExtraContent?.sections?.[0]?.inputFields?.[0]?.cols, (col) => {
|
|
522
522
|
if (col.id === 'insert-image') {
|
|
523
523
|
col.style.display = isDragDropForHide ? 'none' : '';
|
|
524
524
|
}
|
|
@@ -1379,6 +1379,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1379
1379
|
saveObj: {},
|
|
1380
1380
|
showEdmEmailTemplates: false,
|
|
1381
1381
|
editDataSet: false,
|
|
1382
|
+
isGetBeeData: false,
|
|
1382
1383
|
}, () => {
|
|
1383
1384
|
|
|
1384
1385
|
});
|
|
@@ -2831,7 +2832,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
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 = () => {
|
|
@@ -3169,6 +3170,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
3169
3170
|
moduleType={moduleType}
|
|
3170
3171
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
3171
3172
|
eventContextTags={this.props?.eventContextTags}
|
|
3173
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
3172
3174
|
forwardedTags={this.props?.forwardedTags}
|
|
3173
3175
|
isLoyaltyModule={this.props?.isLoyaltyModule}
|
|
3174
3176
|
isGetBeeData={this.state.isGetBeeData}
|
|
@@ -54,6 +54,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
54
54
|
globalActions,
|
|
55
55
|
loadingTags,
|
|
56
56
|
eventContextTags,
|
|
57
|
+
waitEventContextTags,
|
|
57
58
|
forwardedTags,
|
|
58
59
|
selectedOfferDetails,
|
|
59
60
|
currentOrgDetails,
|
|
@@ -510,7 +511,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
510
511
|
setTagValidationError(null);
|
|
511
512
|
}
|
|
512
513
|
}
|
|
513
|
-
}, [tags, injectedTags, location, getDefaultTags, eventContextTags, showLiquidErrorInFooter]);
|
|
514
|
+
}, [tags, injectedTags, location, getDefaultTags, eventContextTags, waitEventContextTags, showLiquidErrorInFooter]);
|
|
514
515
|
|
|
515
516
|
// Store the last validation state received from HTMLEditor
|
|
516
517
|
const lastValidationStateRef = useRef(null);
|
|
@@ -1100,6 +1101,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
1100
1101
|
injectedTags={injectedTags || {}}
|
|
1101
1102
|
selectedOfferDetails={selectedOfferDetails}
|
|
1102
1103
|
eventContextTags={eventContextTags}
|
|
1104
|
+
waitEventContextTags={waitEventContextTags}
|
|
1103
1105
|
showHeading
|
|
1104
1106
|
showTagList
|
|
1105
1107
|
showInput
|
|
@@ -1124,6 +1126,7 @@ const EmailHTMLEditor = (props) => {
|
|
|
1124
1126
|
injectedTags={injectedTags}
|
|
1125
1127
|
location={location}
|
|
1126
1128
|
eventContextTags={eventContextTags}
|
|
1129
|
+
waitEventContextTags={waitEventContextTags}
|
|
1127
1130
|
selectedOfferDetails={selectedOfferDetails}
|
|
1128
1131
|
channel={EMAIL}
|
|
1129
1132
|
userLocale={intl.locale || 'en'}
|
|
@@ -1151,6 +1154,7 @@ EmailHTMLEditor.propTypes = {
|
|
|
1151
1154
|
globalActions: PropTypes.object,
|
|
1152
1155
|
loadingTags: PropTypes.bool,
|
|
1153
1156
|
eventContextTags: PropTypes.array,
|
|
1157
|
+
waitEventContextTags: PropTypes.object,
|
|
1154
1158
|
forwardedTags: PropTypes.object,
|
|
1155
1159
|
selectedOfferDetails: PropTypes.array,
|
|
1156
1160
|
currentOrgDetails: PropTypes.object,
|
|
@@ -1197,6 +1201,7 @@ EmailHTMLEditor.defaultProps = {
|
|
|
1197
1201
|
globalActions: {},
|
|
1198
1202
|
loadingTags: false,
|
|
1199
1203
|
eventContextTags: [],
|
|
1204
|
+
waitEventContextTags: {},
|
|
1200
1205
|
forwardedTags: {},
|
|
1201
1206
|
selectedOfferDetails: [],
|
|
1202
1207
|
currentOrgDetails: {},
|
|
@@ -173,6 +173,7 @@ const EmailWrapperView = ({
|
|
|
173
173
|
forwardedTags,
|
|
174
174
|
selectedOfferDetails,
|
|
175
175
|
eventContextTags,
|
|
176
|
+
waitEventContextTags,
|
|
176
177
|
getFormdata,
|
|
177
178
|
isGetFormData,
|
|
178
179
|
getLiquidTags,
|
|
@@ -246,6 +247,7 @@ const EmailWrapperView = ({
|
|
|
246
247
|
globalActions,
|
|
247
248
|
loadingTags,
|
|
248
249
|
eventContextTags,
|
|
250
|
+
waitEventContextTags,
|
|
249
251
|
forwardedTags,
|
|
250
252
|
selectedOfferDetails,
|
|
251
253
|
currentOrgDetails,
|
|
@@ -371,6 +373,7 @@ EmailWrapperView.propTypes = {
|
|
|
371
373
|
forwardedTags: PropTypes.object,
|
|
372
374
|
selectedOfferDetails: PropTypes.array,
|
|
373
375
|
eventContextTags: PropTypes.array,
|
|
376
|
+
waitEventContextTags: PropTypes.object,
|
|
374
377
|
emailActions: PropTypes.object,
|
|
375
378
|
Email: PropTypes.object,
|
|
376
379
|
templateData: PropTypes.object,
|
|
@@ -71,7 +71,10 @@ jest.mock('../../../../v2Components/HtmlEditor/index.lazy', () => {
|
|
|
71
71
|
}));
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
|
-
<div
|
|
74
|
+
<div
|
|
75
|
+
data-testid="html-editor"
|
|
76
|
+
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
77
|
+
>
|
|
75
78
|
<button
|
|
76
79
|
onClick={() => props.onContentChange && props.onContentChange('<p>New content</p>')}
|
|
77
80
|
data-testid="trigger-content-change"
|
|
@@ -130,7 +133,10 @@ jest.mock('../../../../v2Components/HtmlEditor', () => {
|
|
|
130
133
|
}));
|
|
131
134
|
|
|
132
135
|
return (
|
|
133
|
-
<div
|
|
136
|
+
<div
|
|
137
|
+
data-testid="html-editor"
|
|
138
|
+
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
139
|
+
>
|
|
134
140
|
<button
|
|
135
141
|
onClick={() => props.onContentChange && props.onContentChange('<p>New content</p>')}
|
|
136
142
|
data-testid="trigger-content-change"
|
|
@@ -364,6 +370,7 @@ const defaultProps = {
|
|
|
364
370
|
},
|
|
365
371
|
loadingTags: false,
|
|
366
372
|
eventContextTags: [],
|
|
373
|
+
waitEventContextTags: {},
|
|
367
374
|
forwardedTags: {},
|
|
368
375
|
selectedOfferDetails: [],
|
|
369
376
|
currentOrgDetails: {
|
|
@@ -522,6 +529,17 @@ describe('EmailHTMLEditor', () => {
|
|
|
522
529
|
});
|
|
523
530
|
});
|
|
524
531
|
|
|
532
|
+
describe('waitEventContextTags', () => {
|
|
533
|
+
it('forwards waitEventContextTags to HTMLEditor', () => {
|
|
534
|
+
const waitMap = { b1: { eventName: 'E', blockName: 'B', tags: ['t'] } };
|
|
535
|
+
renderWithIntl({ waitEventContextTags: waitMap });
|
|
536
|
+
expect(screen.getByTestId('html-editor')).toHaveAttribute(
|
|
537
|
+
'data-wait-event-context-tags',
|
|
538
|
+
JSON.stringify(waitMap),
|
|
539
|
+
);
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
|
|
525
543
|
describe('Content Initialization', () => {
|
|
526
544
|
it('initializes with empty content in create mode', () => {
|
|
527
545
|
renderWithIntl({ isGetFormData: false });
|
|
@@ -37,7 +37,14 @@ jest.mock('../EmailHTMLEditor', () => {
|
|
|
37
37
|
getContentForPreview: jest.fn(() => '<p>Test</p>'),
|
|
38
38
|
}));
|
|
39
39
|
|
|
40
|
-
return
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
data-testid="email-html-editor"
|
|
43
|
+
data-wait-event-context-tags={JSON.stringify(props.waitEventContextTags ?? null)}
|
|
44
|
+
>
|
|
45
|
+
HTML Editor
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
41
48
|
});
|
|
42
49
|
});
|
|
43
50
|
|
|
@@ -137,6 +144,7 @@ const defaultProps = {
|
|
|
137
144
|
forwardedTags: {},
|
|
138
145
|
selectedOfferDetails: [],
|
|
139
146
|
eventContextTags: [],
|
|
147
|
+
waitEventContextTags: {},
|
|
140
148
|
getFormdata: jest.fn(),
|
|
141
149
|
isGetFormData: false,
|
|
142
150
|
getLiquidTags: jest.fn(),
|
|
@@ -171,6 +179,13 @@ describe('EmailWrapperView', () => {
|
|
|
171
179
|
jest.clearAllMocks();
|
|
172
180
|
});
|
|
173
181
|
|
|
182
|
+
it('passes waitEventContextTags to EmailHTMLEditor when HTML editor is shown', () => {
|
|
183
|
+
const waitMap = { b1: { eventName: 'E', blockName: 'B', tags: [] } };
|
|
184
|
+
renderWithIntl({ waitEventContextTags: waitMap });
|
|
185
|
+
const el = screen.getByTestId('email-html-editor');
|
|
186
|
+
expect(el).toHaveAttribute('data-wait-event-context-tags', JSON.stringify(waitMap));
|
|
187
|
+
});
|
|
188
|
+
|
|
174
189
|
describe('Mode Selection UI', () => {
|
|
175
190
|
it('renders mode selection when step is MODE_SELECTION', () => {
|
|
176
191
|
renderWithIntl({ step: STEPS.MODE_SELECTION });
|
|
@@ -51,6 +51,7 @@ const useEmailWrapper = ({
|
|
|
51
51
|
editor,
|
|
52
52
|
moduleType,
|
|
53
53
|
eventContextTags,
|
|
54
|
+
waitEventContextTags,
|
|
54
55
|
isLoyaltyModule,
|
|
55
56
|
// Props for CmsTemplates component
|
|
56
57
|
cmsTemplatesLoader,
|
|
@@ -736,6 +737,7 @@ const useEmailWrapper = ({
|
|
|
736
737
|
selectedEditorMode, // Pass selected mode to Email component (only for HTML_EDITOR)
|
|
737
738
|
moduleType,
|
|
738
739
|
eventContextTags,
|
|
740
|
+
waitEventContextTags,
|
|
739
741
|
isLoyaltyModule,
|
|
740
742
|
showTestAndPreviewSlidebox,
|
|
741
743
|
handleTestAndPreview,
|
|
@@ -765,6 +767,7 @@ const useEmailWrapper = ({
|
|
|
765
767
|
editor,
|
|
766
768
|
moduleType,
|
|
767
769
|
eventContextTags,
|
|
770
|
+
waitEventContextTags,
|
|
768
771
|
isLoyaltyModule,
|
|
769
772
|
showTestAndPreviewSlidebox,
|
|
770
773
|
handleTestAndPreview,
|
|
@@ -63,6 +63,7 @@ const EmailWrapper = (props) => {
|
|
|
63
63
|
onEnterTemplateName,
|
|
64
64
|
onRemoveTemplateName,
|
|
65
65
|
eventContextTags,
|
|
66
|
+
waitEventContextTags,
|
|
66
67
|
isLoyaltyModule,
|
|
67
68
|
cmsTemplatesLoader,
|
|
68
69
|
onPreviewContentClicked,
|
|
@@ -130,6 +131,7 @@ const EmailWrapper = (props) => {
|
|
|
130
131
|
onEnterTemplateName,
|
|
131
132
|
onRemoveTemplateName,
|
|
132
133
|
eventContextTags,
|
|
134
|
+
waitEventContextTags,
|
|
133
135
|
isLoyaltyModule,
|
|
134
136
|
cmsTemplatesLoader,
|
|
135
137
|
onPreviewContentClicked,
|
|
@@ -184,6 +186,7 @@ const EmailWrapper = (props) => {
|
|
|
184
186
|
forwardedTags={forwardedTags}
|
|
185
187
|
selectedOfferDetails={selectedOfferDetails}
|
|
186
188
|
eventContextTags={eventContextTags}
|
|
189
|
+
waitEventContextTags={waitEventContextTags}
|
|
187
190
|
getFormdata={getFormdata}
|
|
188
191
|
isGetFormData={isGetFormData}
|
|
189
192
|
getLiquidTags={globalActionsProp?.getLiquidTags}
|
|
@@ -241,6 +244,7 @@ EmailWrapper.propTypes = {
|
|
|
241
244
|
onEnterTemplateName: PropTypes.func,
|
|
242
245
|
onRemoveTemplateName: PropTypes.func,
|
|
243
246
|
eventContextTags: PropTypes.array,
|
|
247
|
+
waitEventContextTags: PropTypes.object,
|
|
244
248
|
isLoyaltyModule: PropTypes.bool,
|
|
245
249
|
onPreviewContentClicked: PropTypes.func,
|
|
246
250
|
onTestContentClicked: PropTypes.func,
|
|
@@ -102,6 +102,7 @@ describe('useEmailWrapper', () => {
|
|
|
102
102
|
editor: null,
|
|
103
103
|
moduleType: '',
|
|
104
104
|
eventContextTags: [],
|
|
105
|
+
waitEventContextTags: {},
|
|
105
106
|
isLoyaltyModule: false,
|
|
106
107
|
cmsTemplatesLoader: false,
|
|
107
108
|
currentOrgDetails: { id: 'org1' },
|
|
@@ -120,6 +121,14 @@ describe('useEmailWrapper', () => {
|
|
|
120
121
|
expect(result.current.onTemplateNameChange).toBeInstanceOf(Function);
|
|
121
122
|
});
|
|
122
123
|
|
|
124
|
+
it('passes waitEventContextTags through emailProps', () => {
|
|
125
|
+
const waitMap = { block1: { eventName: 'E', blockName: 'B', tags: [] } };
|
|
126
|
+
const { result } = renderHook(() =>
|
|
127
|
+
useEmailWrapper({ ...mockProps, waitEventContextTags: waitMap }),
|
|
128
|
+
);
|
|
129
|
+
expect(result.current.emailProps.waitEventContextTags).toEqual(waitMap);
|
|
130
|
+
});
|
|
131
|
+
|
|
123
132
|
it('handles template name change correctly', () => {
|
|
124
133
|
const { result } = renderHook(() => useEmailWrapper(mockProps));
|
|
125
134
|
|
|
@@ -1966,6 +1966,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1966
1966
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
1967
1967
|
isFullMode={this.props.isFullMode}
|
|
1968
1968
|
eventContextTags={this.props?.eventContextTags}
|
|
1969
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1969
1970
|
messageDetails={this.props?.messageDetails}
|
|
1970
1971
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
1971
1972
|
/>
|
|
@@ -2068,6 +2069,7 @@ Create.propTypes = {
|
|
|
2068
2069
|
onPreviewContentClicked: PropTypes.func,
|
|
2069
2070
|
onTestContentClicked: PropTypes.func,
|
|
2070
2071
|
eventContextTags: PropTypes.array,
|
|
2072
|
+
waitEventContextTags: PropTypes.object,
|
|
2071
2073
|
getLiquidTags: PropTypes.func,
|
|
2072
2074
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2073
2075
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
@@ -2233,6 +2233,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2233
2233
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
2234
2234
|
isFullMode={this.props.isFullMode}
|
|
2235
2235
|
eventContextTags={this.props?.eventContextTags}
|
|
2236
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
2236
2237
|
restrictPersonalization={this.props.restrictPersonalization}
|
|
2237
2238
|
/>;
|
|
2238
2239
|
})()}
|
|
@@ -2339,6 +2340,7 @@ Edit.propTypes = {
|
|
|
2339
2340
|
onTestContentClicked: PropTypes.func,
|
|
2340
2341
|
creativesMode: PropTypes.string,
|
|
2341
2342
|
eventContextTags: PropTypes.array,
|
|
2343
|
+
waitEventContextTags: PropTypes.object,
|
|
2342
2344
|
getLiquidTags: PropTypes.func,
|
|
2343
2345
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2344
2346
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
@@ -72,7 +72,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
render() {
|
|
75
|
-
const {mobilePushCreateMode, step, getFormData, getLiquidTags, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData, eventContextTags = [], showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview, restrictPersonalization, isAnonymousType, onPersonalizationTokensChange} = this.props;
|
|
75
|
+
const {mobilePushCreateMode, step, getFormData, getLiquidTags, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData, eventContextTags = [], waitEventContextTags = {},showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview, restrictPersonalization, isAnonymousType, onPersonalizationTokensChange} = this.props;
|
|
76
76
|
const {templateName} = this.state;
|
|
77
77
|
const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
|
|
78
78
|
return (
|
|
@@ -121,6 +121,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
121
121
|
templateData={templateData}
|
|
122
122
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
123
123
|
eventContextTags={eventContextTags}
|
|
124
|
+
waitEventContextTags={waitEventContextTags}
|
|
124
125
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
125
126
|
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
126
127
|
handleTestAndPreview={handleTestAndPreview}
|
|
@@ -155,6 +156,7 @@ MobilepushWrapper.propTypes = {
|
|
|
155
156
|
type: PropTypes.string,
|
|
156
157
|
onValidationFail: PropTypes.func,
|
|
157
158
|
eventContextTags: PropTypes.array,
|
|
159
|
+
waitEventContextTags: PropTypes.object,
|
|
158
160
|
showLiquidErrorInFooter: PropTypes.func,
|
|
159
161
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
160
162
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -1096,6 +1096,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1096
1096
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
1097
1097
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
1098
1098
|
eventContextTags={this.props?.eventContextTags}
|
|
1099
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1099
1100
|
/>
|
|
1100
1101
|
</CapColumn>
|
|
1101
1102
|
</CapRow>
|
|
@@ -1132,6 +1133,7 @@ Create.propTypes = {
|
|
|
1132
1133
|
isLoadingMetaEntities: PropTypes.bool,
|
|
1133
1134
|
selectedOfferDetails: PropTypes.array,
|
|
1134
1135
|
eventContextTags: PropTypes.array,
|
|
1136
|
+
waitEventContextTags: PropTypes.object,
|
|
1135
1137
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1136
1138
|
handleTestAndPreview: PropTypes.func,
|
|
1137
1139
|
handleCloseTestAndPreview: PropTypes.func,
|
|
@@ -1091,6 +1091,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1091
1091
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
1092
1092
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
1093
1093
|
eventContextTags={this.props?.eventContextTags}
|
|
1094
|
+
waitEventContextTags={this.props?.waitEventContextTags}
|
|
1094
1095
|
messageDetails={this.props?.messageDetails}
|
|
1095
1096
|
/>
|
|
1096
1097
|
</CapColumn>
|
|
@@ -1131,6 +1132,7 @@ Edit.propTypes = {
|
|
|
1131
1132
|
injectedTags: PropTypes.object,
|
|
1132
1133
|
selectedOfferDetails: PropTypes.array,
|
|
1133
1134
|
eventContextTags: PropTypes.array,
|
|
1135
|
+
waitEventContextTags: PropTypes.object,
|
|
1134
1136
|
messageDetails: PropTypes.object,
|
|
1135
1137
|
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
1136
1138
|
handleTestAndPreview: PropTypes.func,
|
|
@@ -82,6 +82,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
82
82
|
templateData = {},
|
|
83
83
|
selectedOfferDetails,
|
|
84
84
|
eventContextTags,
|
|
85
|
+
waitEventContextTags,
|
|
85
86
|
fetchingLiquidTags,
|
|
86
87
|
getLiquidTags,
|
|
87
88
|
showLiquidErrorInFooter,
|
|
@@ -660,6 +661,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
660
661
|
hidePopover={disablehandler()}
|
|
661
662
|
selectedOfferDetails={selectedOfferDetails}
|
|
662
663
|
eventContextTags={eventContextTags}
|
|
664
|
+
waitEventContextTags={waitEventContextTags}
|
|
663
665
|
/>
|
|
664
666
|
)}
|
|
665
667
|
/>
|
|
@@ -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,
|
|
@@ -53,6 +54,7 @@ const SmsWrapper = (props) => {
|
|
|
53
54
|
onPreviewContentClicked,
|
|
54
55
|
onTestContentClicked,
|
|
55
56
|
eventContextTags,
|
|
57
|
+
waitEventContextTags,
|
|
56
58
|
showLiquidErrorInFooter,
|
|
57
59
|
getLiquidTags,
|
|
58
60
|
showTestAndPreviewSlidebox,
|
|
@@ -94,10 +94,28 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
componentDidUpdate(prevProps) {
|
|
97
|
-
const {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
const {
|
|
98
|
+
tags,
|
|
99
|
+
injectedTags,
|
|
100
|
+
selectedOfferDetails,
|
|
101
|
+
eventContextTags,
|
|
102
|
+
waitEventContextTags,
|
|
103
|
+
} = this.props;
|
|
104
|
+
const {
|
|
105
|
+
tags: prevTags,
|
|
106
|
+
injectedTags: prevInjectedTags,
|
|
107
|
+
selectedOfferDetails: prevSelectedOfferDetails,
|
|
108
|
+
eventContextTags: prevEventContextTags,
|
|
109
|
+
waitEventContextTags: prevWaitEventContextTags,
|
|
110
|
+
} = prevProps;
|
|
111
|
+
|
|
112
|
+
if (
|
|
113
|
+
tags !== prevTags
|
|
114
|
+
|| injectedTags !== prevInjectedTags
|
|
115
|
+
|| selectedOfferDetails !== prevSelectedOfferDetails
|
|
116
|
+
|| !_.isEqual(eventContextTags, prevEventContextTags)
|
|
117
|
+
|| !_.isEqual(waitEventContextTags, prevWaitEventContextTags)
|
|
118
|
+
) {
|
|
101
119
|
this.generateTags(this.props);
|
|
102
120
|
}
|
|
103
121
|
}
|
|
@@ -162,7 +180,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
162
180
|
let injectedTags = {};
|
|
163
181
|
const eventContextTagsObj = {};
|
|
164
182
|
|
|
165
|
-
const {selectedOfferDetails, eventContextTags } = props;
|
|
183
|
+
const {selectedOfferDetails, eventContextTags, waitEventContextTags } = props;
|
|
166
184
|
if (props.injectedTags && !_.isEmpty(props.injectedTags)) {
|
|
167
185
|
const formattedInjectedTags = handleInjectedData(
|
|
168
186
|
props.injectedTags,
|
|
@@ -214,6 +232,43 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
214
232
|
};
|
|
215
233
|
});
|
|
216
234
|
}
|
|
235
|
+
// Wait event context tags should be displayed in the Add Labels when node is next to Event based wait node.
|
|
236
|
+
if (waitEventContextTags && Object.keys(waitEventContextTags)?.length) {
|
|
237
|
+
|
|
238
|
+
Object.keys(waitEventContextTags).forEach((blockId) => {
|
|
239
|
+
const WAIT_EVENT_HEADER_MSG_LABEL = `${waitEventContextTags[blockId].eventName} (${waitEventContextTags[blockId].blockName})`;
|
|
240
|
+
eventContextTagsObj[blockId] = {
|
|
241
|
+
"name": WAIT_EVENT_HEADER_MSG_LABEL,
|
|
242
|
+
"desc": WAIT_EVENT_HEADER_MSG_LABEL,
|
|
243
|
+
"resolved": true,
|
|
244
|
+
'tag-header': true,
|
|
245
|
+
"subtags": {},
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
waitEventContextTags?.[blockId]?.tags?.forEach((tag) => {
|
|
249
|
+
const {
|
|
250
|
+
tagName, label, profileId, profileName, blockName, eventName
|
|
251
|
+
} = tag || {};
|
|
252
|
+
if (!profileId || !tagName || !label || !profileName) return;
|
|
253
|
+
// Initializing the tags profile if it doesn't exist
|
|
254
|
+
if (!eventContextTagsObj?.[blockId]?.subtags?.[profileId]) {
|
|
255
|
+
eventContextTagsObj[blockId].subtags[profileId] = {
|
|
256
|
+
"name": profileName,
|
|
257
|
+
"desc": profileName,
|
|
258
|
+
"resolved": true,
|
|
259
|
+
'tag-header': true,
|
|
260
|
+
"subtags": {},
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
// Adding the current tag to the profile group
|
|
264
|
+
eventContextTagsObj[blockId].subtags[profileId].subtags[tagName] = {
|
|
265
|
+
name: label,
|
|
266
|
+
desc: label,
|
|
267
|
+
resolved: true,
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
}
|
|
217
272
|
this.setState({tags: _.merge( {}, tags, injectedTags, eventContextTagsObj )});
|
|
218
273
|
}
|
|
219
274
|
|
|
@@ -432,6 +487,7 @@ TagList.defaultProps = {
|
|
|
432
487
|
isNewVersionFlow: false,
|
|
433
488
|
userLocale: 'en',
|
|
434
489
|
eventContextTags: [],
|
|
490
|
+
waitEventContextTags: {},
|
|
435
491
|
};
|
|
436
492
|
|
|
437
493
|
TagList.propTypes = {
|
|
@@ -452,6 +508,7 @@ TagList.propTypes = {
|
|
|
452
508
|
disabled: PropTypes.bool,
|
|
453
509
|
fetchingSchemaError: PropTypes.bool,
|
|
454
510
|
eventContextTags: PropTypes.array,
|
|
511
|
+
waitEventContextTags: PropTypes.object,
|
|
455
512
|
popoverPlacement: PropTypes.string,
|
|
456
513
|
// message to show when Add Label button is disabled (e.g. personalization restriction)
|
|
457
514
|
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
|
});
|