@capillarytech/creatives-library 8.0.255 → 8.0.256
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/assets/Android.png +0 -0
- package/assets/iOS.png +0 -0
- package/constants/unified.js +1 -2
- package/initialReducer.js +0 -2
- package/package.json +1 -1
- package/services/api.js +0 -10
- package/services/tests/api.test.js +0 -34
- package/utils/common.js +0 -5
- package/utils/commonUtils.js +5 -28
- package/utils/tests/commonUtil.test.js +0 -224
- package/utils/transformTemplateConfig.js +10 -0
- package/v2Components/CapDeviceContent/index.js +56 -61
- package/v2Components/CapTagList/index.js +1 -6
- package/v2Components/CapTagListWithInput/index.js +1 -5
- package/v2Components/CapTagListWithInput/messages.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
- package/v2Components/CommonTestAndPreview/UnifiedPreview/InAppPreviewContent.js +3 -3
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +3 -3
- package/v2Components/CommonTestAndPreview/UnifiedPreview/SmsPreviewContent.js +3 -3
- package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +3 -3
- package/v2Components/CommonTestAndPreview/UnifiedPreview/WhatsAppPreviewContent.js +1 -1
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +37 -6
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +0 -2
- package/v2Components/ErrorInfoNote/index.js +72 -457
- package/v2Components/ErrorInfoNote/messages.js +6 -36
- package/v2Components/ErrorInfoNote/style.scss +6 -282
- package/v2Components/FormBuilder/tests/index.test.js +4 -13
- package/v2Components/HtmlEditor/HTMLEditor.js +94 -547
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1441
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
- package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
- package/v2Components/HtmlEditor/_index.lazy.scss +1 -0
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +102 -23
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +140 -148
- package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
- package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
- package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +0 -9
- package/v2Components/HtmlEditor/components/EditorToolbar/index.js +4 -4
- package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
- package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
- package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
- package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
- package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
- package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
- package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +6 -3
- package/v2Components/HtmlEditor/components/PreviewPane/index.js +43 -22
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +0 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -49
- package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +34 -50
- package/v2Components/HtmlEditor/components/ValidationPanel/index.js +41 -70
- package/v2Components/HtmlEditor/constants.js +20 -42
- package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
- package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +0 -103
- package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
- package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
- package/v2Components/HtmlEditor/hooks/useValidation.js +53 -189
- package/v2Components/HtmlEditor/index.js +1 -1
- package/v2Components/HtmlEditor/messages.js +94 -92
- package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +45 -94
- package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +0 -134
- package/v2Components/HtmlEditor/utils/contentSanitizer.js +41 -40
- package/v2Components/HtmlEditor/utils/htmlValidator.js +72 -71
- package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +102 -134
- package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
- package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
- package/v2Components/MobilePushPreviewV2/index.js +7 -32
- package/v2Components/TemplatePreview/_templatePreview.scss +25 -57
- package/v2Components/TemplatePreview/index.js +32 -47
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -2
- package/v2Containers/BeeEditor/index.js +90 -172
- package/v2Containers/CreativesContainer/SlideBoxContent.js +51 -128
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -163
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -2
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +46 -239
- package/v2Containers/CreativesContainer/messages.js +0 -8
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +50 -38
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -106
- package/v2Containers/Email/actions.js +0 -7
- package/v2Containers/Email/constants.js +1 -5
- package/v2Containers/Email/index.js +29 -234
- package/v2Containers/Email/messages.js +0 -32
- package/v2Containers/Email/reducer.js +1 -12
- package/v2Containers/Email/sagas.js +7 -61
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
- package/v2Containers/Email/tests/reducer.test.js +0 -46
- package/v2Containers/Email/tests/sagas.test.js +29 -320
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +21 -211
- package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
- package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
- package/v2Containers/EmailWrapper/constants.js +0 -2
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +77 -629
- package/v2Containers/EmailWrapper/index.js +23 -103
- package/v2Containers/EmailWrapper/messages.js +1 -65
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -594
- package/v2Containers/InApp/actions.js +0 -7
- package/v2Containers/InApp/constants.js +4 -20
- package/v2Containers/InApp/index.js +359 -802
- package/v2Containers/InApp/index.scss +3 -4
- package/v2Containers/InApp/messages.js +3 -7
- package/v2Containers/InApp/reducer.js +3 -21
- package/v2Containers/InApp/sagas.js +9 -29
- package/v2Containers/InApp/selectors.js +5 -25
- package/v2Containers/InApp/tests/index.test.js +50 -154
- package/v2Containers/InApp/tests/reducer.test.js +0 -34
- package/v2Containers/InApp/tests/sagas.test.js +9 -61
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -2
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -9
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +36 -48
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +12 -16
- package/v2Containers/TagList/index.js +19 -62
- package/v2Containers/Templates/_templates.scss +1 -60
- package/v2Containers/Templates/index.js +4 -89
- package/v2Containers/Templates/messages.js +0 -4
- package/v2Containers/Whatsapp/index.js +1 -1
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +136 -204
- package/v2Components/ErrorInfoNote/constants.js +0 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -874
- package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +0 -6
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -255
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -364
- package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
- package/v2Components/HtmlEditor/utils/validationConstants.js +0 -40
- package/v2Containers/BeePopupEditor/_beePopupEditor.scss +0 -14
- package/v2Containers/BeePopupEditor/constants.js +0 -10
- package/v2Containers/BeePopupEditor/index.js +0 -194
- package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1285
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -1880
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -643
- package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
- package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
- package/v2Containers/InApp/tests/selectors.test.js +0 -612
- package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -151
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -23
- package/v2Containers/InAppWrapper/constants.js +0 -16
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
- package/v2Containers/InAppWrapper/index.js +0 -148
- package/v2Containers/InAppWrapper/messages.js +0 -49
- package/v2Containers/InappAdvance/index.js +0 -1099
- package/v2Containers/InappAdvance/index.scss +0 -10
- package/v2Containers/InappAdvance/tests/index.test.js +0 -448
|
@@ -40,7 +40,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
40
40
|
tags: [],
|
|
41
41
|
tagsError: false,
|
|
42
42
|
currentContext: null, // Track current context to detect changes
|
|
43
|
-
hasTriggeredInitialApiCall: false, // Track if we've triggered API call when popover opens
|
|
44
43
|
};
|
|
45
44
|
this.renderTags = this.renderTags.bind(this);
|
|
46
45
|
this.populateTags = this.populateTags.bind(this);
|
|
@@ -52,14 +51,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
52
51
|
|
|
53
52
|
componentDidMount() {
|
|
54
53
|
this.generateTags(this.props);
|
|
55
|
-
// Trigger initial API call if tags are empty (similar to Email/SMS behavior)
|
|
56
|
-
const { tags, injectedTags, onContextChange } = this.props;
|
|
57
|
-
const hasNoTags = (!tags || tags.length === 0) && _.isEmpty(injectedTags);
|
|
58
|
-
if (hasNoTags && onContextChange) {
|
|
59
|
-
// Trigger API call with default 'Outbound' context to match CapTagList default
|
|
60
|
-
// This ensures tags are loaded when component mounts
|
|
61
|
-
this.getTagsforContext('Outbound');
|
|
62
|
-
}
|
|
63
54
|
}
|
|
64
55
|
|
|
65
56
|
componentWillReceiveProps(nextProps) {
|
|
@@ -68,27 +59,23 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
68
59
|
// 2. Context change is happening (detected by different tag arrays)
|
|
69
60
|
const { injectedTags: currentInjectedTags, tags: currentTags } = this.props;
|
|
70
61
|
const { injectedTags: nextInjectedTags, tags: nextTags, fetchingSchemaError } = nextProps;
|
|
71
|
-
|
|
62
|
+
|
|
72
63
|
const isInitialLoad = _.isEmpty(currentInjectedTags) && _.isEmpty(currentTags);
|
|
73
64
|
const isContextChange = !_.isEqual(nextTags, currentTags) && !_.isEmpty(currentTags);
|
|
74
|
-
|
|
65
|
+
|
|
75
66
|
if (isInitialLoad || isContextChange) {
|
|
76
67
|
this.setState({loading: true});
|
|
77
68
|
}
|
|
78
|
-
|
|
69
|
+
|
|
79
70
|
// Only reset loading for injectedTags changes if we're not currently loading due to context change
|
|
80
71
|
if (!_.isEqual(nextInjectedTags, currentInjectedTags) && !this.state.loading) {
|
|
81
72
|
this.setState({loading: false});
|
|
82
73
|
this.clearLoadingTimeout();
|
|
83
74
|
}
|
|
84
|
-
|
|
75
|
+
|
|
85
76
|
if (!_.isEqual(nextTags, currentTags)) {
|
|
86
77
|
this.setState({loading: false});
|
|
87
78
|
this.clearLoadingTimeout();
|
|
88
|
-
// Reset the flag when tags are received, so we can trigger API call again if needed
|
|
89
|
-
if (nextTags && nextTags.length > 0) {
|
|
90
|
-
this.setState({ hasTriggeredInitialApiCall: false });
|
|
91
|
-
}
|
|
92
79
|
}
|
|
93
80
|
if (fetchingSchemaError) {
|
|
94
81
|
this.setState({tagsError: fetchingSchemaError, loading: false});
|
|
@@ -99,7 +86,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
99
86
|
componentDidUpdate(prevProps) {
|
|
100
87
|
const { tags, injectedTags, selectedOfferDetails } = this.props;
|
|
101
88
|
const { tags: prevTags, injectedTags: prevInjectedTags, selectedOfferDetails: prevSelectedOfferDetails } = prevProps;
|
|
102
|
-
|
|
89
|
+
|
|
103
90
|
if (tags !== prevTags || injectedTags !== prevInjectedTags || selectedOfferDetails !== prevSelectedOfferDetails) {
|
|
104
91
|
this.generateTags(this.props);
|
|
105
92
|
}
|
|
@@ -124,44 +111,17 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
124
111
|
getTagsforContext = (data) => {
|
|
125
112
|
// Set loading state when context change is requested
|
|
126
113
|
this.setState({loading: true, currentContext: data});
|
|
127
|
-
|
|
114
|
+
|
|
128
115
|
// Set a timeout to prevent infinite loading (fallback safety)
|
|
129
116
|
this.clearLoadingTimeout();
|
|
130
117
|
this.loadingTimeout = setTimeout(() => {
|
|
131
118
|
this.setState({loading: false});
|
|
132
119
|
}, 5000); // Reduced timeout to 5 seconds for better UX
|
|
133
|
-
|
|
120
|
+
|
|
134
121
|
const { onContextChange } = this.props;
|
|
135
|
-
|
|
136
|
-
// The API call will fetch tags from /meta/TAG endpoint
|
|
137
|
-
if (onContextChange) {
|
|
138
|
-
onContextChange(data);
|
|
139
|
-
} else {
|
|
140
|
-
console.warn('TagList: onContextChange is not available. API call will not be triggered.');
|
|
141
|
-
}
|
|
122
|
+
onContextChange(data);
|
|
142
123
|
}
|
|
143
124
|
|
|
144
|
-
handlePopoverVisibilityChange = (visible) => {
|
|
145
|
-
// When popover opens, trigger API call if tags are empty or if we haven't triggered it yet
|
|
146
|
-
// This ensures API call happens when user clicks "Add Label" button
|
|
147
|
-
if (visible && this.props.onContextChange) {
|
|
148
|
-
const { tags, injectedTags } = this.props;
|
|
149
|
-
// Check if tags array is empty or if state tags are empty
|
|
150
|
-
const hasNoTags = (!tags || tags.length === 0) && _.isEmpty(injectedTags);
|
|
151
|
-
const hasNoStateTags = _.isEmpty(this.state.tags);
|
|
152
|
-
const hasNotTriggeredApiCall = !this.state.hasTriggeredInitialApiCall;
|
|
153
|
-
|
|
154
|
-
// Trigger API call if tags are not loaded yet OR if we haven't triggered it yet
|
|
155
|
-
if ((hasNoTags || hasNoStateTags || hasNotTriggeredApiCall)) {
|
|
156
|
-
// Mark that we've triggered the API call
|
|
157
|
-
this.setState({ hasTriggeredInitialApiCall: true });
|
|
158
|
-
// Trigger API call with default 'Outbound' context to match CapTagList default
|
|
159
|
-
// This will call onContextChange which triggers handleOnTagsContextChange in InApp
|
|
160
|
-
this.getTagsforContext('Outbound');
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
125
|
generateTags = (props) => {
|
|
166
126
|
let tags = {};
|
|
167
127
|
let injectedTags = {};
|
|
@@ -189,11 +149,11 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
189
149
|
if (eventContextTags?.length) {
|
|
190
150
|
const TAG_HEADER_MSG_LABEL = this.props.intl.formatMessage(messages.entryEvent);
|
|
191
151
|
eventContextTagsObj.eventContextTags = {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
152
|
+
name: TAG_HEADER_MSG_LABEL,
|
|
153
|
+
desc: TAG_HEADER_MSG_LABEL,
|
|
154
|
+
resolved: true,
|
|
195
155
|
'tag-header': true,
|
|
196
|
-
|
|
156
|
+
subtags: {},
|
|
197
157
|
};
|
|
198
158
|
|
|
199
159
|
eventContextTags.forEach((tag) => {
|
|
@@ -204,11 +164,11 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
204
164
|
// Initializing the tags profile if it doesn't exist
|
|
205
165
|
if (!eventContextTagsObj?.eventContextTags?.subtags?.[profileId]) {
|
|
206
166
|
eventContextTagsObj.eventContextTags.subtags[profileId] = {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
167
|
+
name: profileName,
|
|
168
|
+
desc: profileName,
|
|
169
|
+
resolved: true,
|
|
210
170
|
'tag-header': true,
|
|
211
|
-
|
|
171
|
+
subtags: {},
|
|
212
172
|
};
|
|
213
173
|
}
|
|
214
174
|
// Adding the current tag to the profile group
|
|
@@ -241,7 +201,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
241
201
|
_.forEach(tagsList, (temp) => {
|
|
242
202
|
const tag = temp.definition;
|
|
243
203
|
const { intl } = this.props;
|
|
244
|
-
|
|
204
|
+
const { locale: userLocale } = intl || {};
|
|
245
205
|
|
|
246
206
|
// Check if the tag.value should be skipped based on feature control
|
|
247
207
|
if (_.includes(excludedTags, tag.value)) {
|
|
@@ -249,8 +209,8 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
249
209
|
}
|
|
250
210
|
if (!tag['tag-header']) {
|
|
251
211
|
mainTags[tag.value] = {
|
|
252
|
-
name: tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
|
|
253
|
-
desc: tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
|
|
212
|
+
"name": tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
|
|
213
|
+
"desc": tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
|
|
254
214
|
};
|
|
255
215
|
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
256
216
|
mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
|
|
@@ -406,14 +366,12 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
406
366
|
visibleTaglist={this.props.visibleTaglist}
|
|
407
367
|
hidePopover={this.props.hidePopover}
|
|
408
368
|
onContextChange={this.getTagsforContext}
|
|
409
|
-
onVisibleChange={this.handlePopoverVisibilityChange}
|
|
410
369
|
moduleFilterEnabled={this.props.moduleFilterEnabled}
|
|
411
370
|
modalProps={this.props.modalProps}
|
|
412
371
|
currentOrgDetails={this.props.currentOrgDetails}
|
|
413
372
|
channel={this.props.channel}
|
|
414
373
|
disabled={this.props.disabled}
|
|
415
374
|
fetchingSchemaError={this?.state?.tagsError}
|
|
416
|
-
popoverPlacement={this.props.popoverPlacement}
|
|
417
375
|
/>
|
|
418
376
|
</div>
|
|
419
377
|
);
|
|
@@ -444,7 +402,6 @@ TagList.propTypes = {
|
|
|
444
402
|
disabled: PropTypes.bool,
|
|
445
403
|
fetchingSchemaError: PropTypes.bool,
|
|
446
404
|
eventContextTags: PropTypes.array,
|
|
447
|
-
popoverPlacement: PropTypes.string,
|
|
448
405
|
intl: PropTypes.shape({
|
|
449
406
|
formatMessage: PropTypes.func.isRequired,
|
|
450
407
|
locale: PropTypes.string,
|
|
@@ -313,64 +313,6 @@
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
.INAPP {
|
|
317
|
-
margin-bottom: $CAP_SPACE_12;
|
|
318
|
-
.inapp-container {
|
|
319
|
-
margin-top: $CAP_SPACE_24;
|
|
320
|
-
}
|
|
321
|
-
// Modal Layout - centered
|
|
322
|
-
.inapp-modal-layout {
|
|
323
|
-
position: absolute;
|
|
324
|
-
display: flex;
|
|
325
|
-
width: 12rem;
|
|
326
|
-
top: 10%;
|
|
327
|
-
left: 10%;
|
|
328
|
-
bottom: 5%;
|
|
329
|
-
overflow: hidden;
|
|
330
|
-
background-color: $CAP_WHITE;
|
|
331
|
-
border-radius: $CAP_SPACE_08;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// Full Screen Layout
|
|
335
|
-
.inapp-fullscreen-layout {
|
|
336
|
-
position: absolute;
|
|
337
|
-
display: flex;
|
|
338
|
-
width: 12rem;
|
|
339
|
-
left: 10%;
|
|
340
|
-
top: 1%;
|
|
341
|
-
bottom: 1%;
|
|
342
|
-
overflow: hidden;
|
|
343
|
-
background-color: $CAP_WHITE;
|
|
344
|
-
border-radius: $CAP_SPACE_08;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// Top Banner Layout
|
|
348
|
-
.inapp-top-banner-layout {
|
|
349
|
-
position: absolute;
|
|
350
|
-
display: flex;
|
|
351
|
-
width: 12rem;
|
|
352
|
-
left: 10%;
|
|
353
|
-
top: 1%;
|
|
354
|
-
bottom: 20%;
|
|
355
|
-
overflow: hidden;
|
|
356
|
-
background-color: $CAP_WHITE;
|
|
357
|
-
border-radius: $CAP_SPACE_08;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
// Bottom Banner Layout
|
|
361
|
-
.inapp-bottom-banner-layout {
|
|
362
|
-
position: absolute;
|
|
363
|
-
display: flex;
|
|
364
|
-
justify-content: center;
|
|
365
|
-
width: 12rem;
|
|
366
|
-
left: 10%;
|
|
367
|
-
top: 50%;
|
|
368
|
-
bottom: 2%;
|
|
369
|
-
overflow: hidden;
|
|
370
|
-
background-color: $CAP_WHITE;
|
|
371
|
-
border-radius: $CAP_SPACE_08;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
316
|
}
|
|
375
317
|
|
|
376
318
|
.create-new-link{
|
|
@@ -753,8 +695,7 @@
|
|
|
753
695
|
}
|
|
754
696
|
|
|
755
697
|
.whatsapp-filters,
|
|
756
|
-
.zalo-filters
|
|
757
|
-
.inapp-filters {
|
|
698
|
+
.zalo-filters {
|
|
758
699
|
display: flex;
|
|
759
700
|
width: 100%;
|
|
760
701
|
padding-left: 8px;
|
|
@@ -127,14 +127,13 @@ import {
|
|
|
127
127
|
VIDEO,
|
|
128
128
|
GIF,
|
|
129
129
|
} from '../Whatsapp/constants';
|
|
130
|
-
import { INAPP_LAYOUT_DETAILS
|
|
130
|
+
import { INAPP_LAYOUT_DETAILS } from '../InApp/constants';
|
|
131
131
|
import { ZALO_STATUS_OPTIONS, ZALO_STATUSES } from '../Zalo/constants';
|
|
132
132
|
import { getWhatsappContent, getWhatsappStatus, getWhatsappCategory, getWhatsappCta, getWhatsappQuickReply, getWhatsappAutoFill, getWhatsappCarouselButtonView } from '../Whatsapp/utils';
|
|
133
133
|
import { getRCSContent } from '../Rcs/utils';
|
|
134
134
|
import {RCS_STATUSES} from '../Rcs/constants';
|
|
135
135
|
import zaloMessages from '../Zalo/messages';
|
|
136
136
|
import rcsMessages from '../Rcs/messages';
|
|
137
|
-
import inAppMessages from '../InApp/messages';
|
|
138
137
|
import globalMessages from '../../v2Containers/Cap/messages';
|
|
139
138
|
import { handlePreviewInNewTab } from '../../utils/common';
|
|
140
139
|
|
|
@@ -201,29 +200,6 @@ const SMS_FILTERS = {
|
|
|
201
200
|
SERVICE_IMPLICIT: 'implicit',
|
|
202
201
|
};
|
|
203
202
|
|
|
204
|
-
const INAPP_LAYOUT_OPTIONS = [
|
|
205
|
-
{
|
|
206
|
-
key: 'popup',
|
|
207
|
-
value: INAPP_MESSAGE_LAYOUT_TYPES.MODAL,
|
|
208
|
-
label: <FormattedMessage {...inAppMessages.layoutModal} />,
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
key: 'topBanner',
|
|
212
|
-
value: INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER,
|
|
213
|
-
label: <FormattedMessage {...inAppMessages.layoutTopBanner} />,
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
key: 'bottomBanner',
|
|
217
|
-
value: INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER,
|
|
218
|
-
label: <FormattedMessage {...inAppMessages.layoutBottomBanner} />,
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
key: 'fullScreen',
|
|
222
|
-
value: INAPP_MESSAGE_LAYOUT_TYPES.FULLSCREEN,
|
|
223
|
-
label: <FormattedMessage {...inAppMessages.layoutFullScreen} />,
|
|
224
|
-
},
|
|
225
|
-
];
|
|
226
|
-
|
|
227
203
|
const WHATSAPP_LOWERCASE = WHATSAPP.toLowerCase();
|
|
228
204
|
const RCS_LOWERCASE = RCS.toLowerCase();
|
|
229
205
|
const SMS_LOWERCASE = SMS.toLowerCase();
|
|
@@ -274,7 +250,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
274
250
|
selectedWhatsappStatus: '',
|
|
275
251
|
selectedWhatsappCategory: '',
|
|
276
252
|
selectedZaloStatus: '',
|
|
277
|
-
selectedInAppLayout: '',
|
|
278
253
|
hostName: '',
|
|
279
254
|
searchedZaloTemplates: [],
|
|
280
255
|
searchingZaloTemplate: false,
|
|
@@ -1673,19 +1648,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1673
1648
|
return templates;
|
|
1674
1649
|
}
|
|
1675
1650
|
|
|
1676
|
-
filterInAppTemplates = (templates) => {
|
|
1677
|
-
const { selectedInAppLayout } = this.state;
|
|
1678
|
-
if (!selectedInAppLayout) {
|
|
1679
|
-
return templates;
|
|
1680
|
-
}
|
|
1681
|
-
return templates.filter((template) => {
|
|
1682
|
-
const androidBodyType = get(template, 'versions.base.content.ANDROID.bodyType');
|
|
1683
|
-
const iosBodyType = get(template, 'versions.base.content.IOS.bodyType');
|
|
1684
|
-
const inappBodyType = androidBodyType || iosBodyType;
|
|
1685
|
-
return inappBodyType === selectedInAppLayout;
|
|
1686
|
-
});
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
1651
|
filterSMSTemplates = (templates) => {
|
|
1690
1652
|
const { smsFilter } = this.state;
|
|
1691
1653
|
if (SMS_FILTERS.ALL === smsFilter) {
|
|
@@ -1772,9 +1734,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1772
1734
|
case ZALO:
|
|
1773
1735
|
filteredTemplates = this.filterZaloTemplates(templates);
|
|
1774
1736
|
break;
|
|
1775
|
-
case INAPP:
|
|
1776
|
-
filteredTemplates = this.filterInAppTemplates(templates);
|
|
1777
|
-
break;
|
|
1778
1737
|
default:
|
|
1779
1738
|
break;
|
|
1780
1739
|
}
|
|
@@ -2064,12 +2023,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2064
2023
|
templateData.isNewMobilePush = commonUtil.hasNewMobilePushFeatureEnabled();
|
|
2065
2024
|
}
|
|
2066
2025
|
break;
|
|
2067
|
-
case INAPP:
|
|
2068
|
-
// Pass the full template object to CapCustomCard so getInAppContent can extract the data
|
|
2069
|
-
// Similar to how MOBILE_PUSH passes the full template when new feature is enabled
|
|
2026
|
+
case INAPP:
|
|
2070
2027
|
templateData.content = template;
|
|
2071
2028
|
break;
|
|
2072
|
-
}
|
|
2073
2029
|
case WECHAT:
|
|
2074
2030
|
templateData.content = this.prepareWeChatPreviewData(template);
|
|
2075
2031
|
break;
|
|
@@ -2383,7 +2339,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2383
2339
|
return (<div>
|
|
2384
2340
|
{[WECHAT, MOBILE_PUSH, INAPP, WHATSAPP, ZALO,RCS].includes(currentChannel) && this.showAccountName()}
|
|
2385
2341
|
{filterContent}
|
|
2386
|
-
{[WHATSAPP, ZALO,
|
|
2342
|
+
{[WHATSAPP, ZALO,RCS].includes(currentChannel) && this.selectedFilters()}
|
|
2387
2343
|
{<div>
|
|
2388
2344
|
{!isEmpty(filteredTemplates) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError) ? (
|
|
2389
2345
|
<div className={!isEmpty(this.state.searchText) && isEmpty(cardDataList) ? '' : this.isFullMode() ? "v2-pagination-container" : "v2-pagination-container-half"}>
|
|
@@ -2593,9 +2549,6 @@ return (<div>
|
|
|
2593
2549
|
|
|
2594
2550
|
prepareWeChatMappedPreviewData(content, templateTags, tagData) {
|
|
2595
2551
|
let formattedContent = cloneDeep(content);
|
|
2596
|
-
if (!formattedContent || typeof formattedContent !== 'string') {
|
|
2597
|
-
return formattedContent || '';
|
|
2598
|
-
}
|
|
2599
2552
|
forEach(templateTags, (tag) => {
|
|
2600
2553
|
if (tagData[tag].value !== undefined) {
|
|
2601
2554
|
formattedContent = formattedContent.replace(`{{${tag}.DATA}}`, tagData[tag].value);
|
|
@@ -3793,19 +3746,14 @@ return (<div>
|
|
|
3793
3746
|
}
|
|
3794
3747
|
|
|
3795
3748
|
removeZaloFilter = () => this.setState({ selectedZaloStatus: null });
|
|
3796
|
-
removeInAppLayoutFilter = () => this.setState({ selectedInAppLayout: '' });
|
|
3797
3749
|
|
|
3798
3750
|
selectedFilters = () => {
|
|
3799
|
-
const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus
|
|
3751
|
+
const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus } = this.state;
|
|
3800
3752
|
const {
|
|
3801
3753
|
intl: {
|
|
3802
3754
|
formatMessage,
|
|
3803
3755
|
},
|
|
3804
3756
|
} = this.props;
|
|
3805
|
-
const getInAppLayoutLabel = (layoutValue) => {
|
|
3806
|
-
const layoutOption = INAPP_LAYOUT_OPTIONS.find(opt => opt.value === layoutValue);
|
|
3807
|
-
return layoutOption ? layoutOption.label : layoutValue;
|
|
3808
|
-
};
|
|
3809
3757
|
return (
|
|
3810
3758
|
<CapRow type="flex" align="middle" className="selected-whatsapp-filters">
|
|
3811
3759
|
{
|
|
@@ -3840,23 +3788,6 @@ return (<div>
|
|
|
3840
3788
|
</CapTag>
|
|
3841
3789
|
) : null
|
|
3842
3790
|
}
|
|
3843
|
-
{
|
|
3844
|
-
selectedInAppLayout ? (
|
|
3845
|
-
<CapTag closable onClose={this.removeInAppLayoutFilter}>
|
|
3846
|
-
{formatMessage(messages.layout)}: {getInAppLayoutLabel(selectedInAppLayout)}
|
|
3847
|
-
</CapTag>
|
|
3848
|
-
) : null
|
|
3849
|
-
}
|
|
3850
|
-
{
|
|
3851
|
-
selectedInAppLayout ? (
|
|
3852
|
-
<CapLink
|
|
3853
|
-
onClick={() => {
|
|
3854
|
-
this.removeInAppLayoutFilter();
|
|
3855
|
-
}}
|
|
3856
|
-
title={this.props.intl.formatMessage(messages.clearAll)}
|
|
3857
|
-
/>
|
|
3858
|
-
) : null
|
|
3859
|
-
}
|
|
3860
3791
|
</CapRow>
|
|
3861
3792
|
);
|
|
3862
3793
|
}
|
|
@@ -3867,7 +3798,6 @@ return (<div>
|
|
|
3867
3798
|
setLineFilter = (e) => this.setState({lineFilter: e.target.value});
|
|
3868
3799
|
setSMSFilter = (e) => this.setState({smsFilter: e.target.value});
|
|
3869
3800
|
setZaloStatus = (value) => this.setState({selectedZaloStatus: value?.item?.props?.value});
|
|
3870
|
-
setInAppLayout = (value) => this.setState({selectedInAppLayout: value?.item?.props?.value});
|
|
3871
3801
|
|
|
3872
3802
|
openCreativesFullMode = () => {
|
|
3873
3803
|
const channelLowerCase = this.state.channel.toLowerCase();
|
|
@@ -4120,21 +4050,6 @@ return (<div>
|
|
|
4120
4050
|
)
|
|
4121
4051
|
: () => null
|
|
4122
4052
|
}
|
|
4123
|
-
{
|
|
4124
|
-
channel.toUpperCase() === INAPP && (
|
|
4125
|
-
<div className="inapp-filters">
|
|
4126
|
-
<CapSelectFilter
|
|
4127
|
-
placement="bottomLeft"
|
|
4128
|
-
data={INAPP_LAYOUT_OPTIONS}
|
|
4129
|
-
onSelect={this.setInAppLayout}
|
|
4130
|
-
selectedValue={this.state.selectedInAppLayout}
|
|
4131
|
-
placeholder="Layout"
|
|
4132
|
-
showBadge
|
|
4133
|
-
width="120px"
|
|
4134
|
-
/>
|
|
4135
|
-
</div>
|
|
4136
|
-
)
|
|
4137
|
-
}
|
|
4138
4053
|
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
|
|
4139
4054
|
{
|
|
4140
4055
|
this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE && (isWhatsappCountExeeded)? (
|
|
@@ -534,10 +534,6 @@ export default defineMessages({
|
|
|
534
534
|
id: `${scope}.rcsOnlyApprovedTemplates`,
|
|
535
535
|
defaultMessage: 'Only "Approved" templates are available here, as you can use those templates to create a message.',
|
|
536
536
|
},
|
|
537
|
-
"layout": {
|
|
538
|
-
id: `${scope}.layout`,
|
|
539
|
-
defaultMessage: `Layout`,
|
|
540
|
-
},
|
|
541
537
|
"status": {
|
|
542
538
|
id: `${scope}.status`,
|
|
543
539
|
defaultMessage: 'Status',
|
|
@@ -3131,7 +3131,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
3131
3131
|
{isEditFlow ? editModeContent() : createModeContent()}
|
|
3132
3132
|
<div className="whatsapp-scroll-div" />
|
|
3133
3133
|
</CapColumn>
|
|
3134
|
-
<CapColumn span={10}
|
|
3134
|
+
<CapColumn span={10}>
|
|
3135
3135
|
{getPreviewSection()}
|
|
3136
3136
|
</CapColumn>
|
|
3137
3137
|
</CapRow>
|