@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
|
@@ -5,28 +5,34 @@ 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
|
+
import { OfferTag, badgesTags, offer } from '../../../utils/tests/common.mockdata';
|
|
10
|
+
import * as commonUtils from "../../../utils/common";
|
|
9
11
|
import { Provider } from 'react-redux';
|
|
10
12
|
import { screen, render } from '../../../utils/test-utils';
|
|
11
13
|
import history from '../../../utils/history';
|
|
12
14
|
const { getByText, queryByText } = screen;
|
|
13
15
|
|
|
16
|
+
const buildProps = (props = {}) => ({
|
|
17
|
+
...TagListData,
|
|
18
|
+
onTagSelect: jest.fn(),
|
|
19
|
+
...props,
|
|
20
|
+
});
|
|
14
21
|
|
|
15
|
-
const initializeTagList = (props) => {
|
|
22
|
+
const initializeTagList = (props = {}) => {
|
|
16
23
|
const store = configureStore({}, initialReducer, history);
|
|
17
24
|
const Component = injectIntl(TagList);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
const propsObj = buildProps(props);
|
|
26
|
+
return {
|
|
27
|
+
...render(
|
|
28
|
+
<Provider store={store}>
|
|
29
|
+
<Component {...propsObj} />
|
|
30
|
+
</Provider>
|
|
31
|
+
),
|
|
32
|
+
store,
|
|
33
|
+
Component,
|
|
34
|
+
propsObj,
|
|
23
35
|
};
|
|
24
|
-
|
|
25
|
-
return render(
|
|
26
|
-
<Provider store={store}>
|
|
27
|
-
<Component {...propsObj} />
|
|
28
|
-
</Provider>
|
|
29
|
-
);
|
|
30
36
|
};
|
|
31
37
|
|
|
32
38
|
const addLabelBtnAssertion = () => {
|
|
@@ -41,19 +47,117 @@ describe("TagList test : UNIT", () => {
|
|
|
41
47
|
addLabelBtnAssertion();
|
|
42
48
|
});
|
|
43
49
|
|
|
44
|
-
it('should render event context
|
|
45
|
-
initializeTagList({eventContextTags});
|
|
50
|
+
it('should render event context tag section from generateTags', () => {
|
|
51
|
+
initializeTagList({ eventContextTags, moduleFilterEnabled: false });
|
|
46
52
|
addLabelBtnAssertion();
|
|
47
53
|
const EVENT_CONTEXT_TAG_HEADER = getByText(/Entry event/i);
|
|
48
54
|
expect(EVENT_CONTEXT_TAG_HEADER).toBeInTheDocument();
|
|
49
|
-
fireEvent.click(EVENT_CONTEXT_TAG_HEADER);
|
|
50
|
-
// Customer profile tags
|
|
51
|
-
const CUSTOMER_PROFILE = getByText(/Current Customer/i);
|
|
52
|
-
fireEvent.click(CUSTOMER_PROFILE);
|
|
53
|
-
expect(getByText(/lifetimePurchases/i)).toBeInTheDocument();
|
|
54
55
|
|
|
55
56
|
// Behavioural event profile tags should not be visible as label and profile name is not present
|
|
56
57
|
const BEHAVIOURAL_EVENT_PROFILE = queryByText(/Behavioural event/i);
|
|
57
58
|
expect(BEHAVIOURAL_EVENT_PROFILE).not.toBeInTheDocument();
|
|
58
59
|
});
|
|
60
|
+
|
|
61
|
+
it('should render wait event context section when waitEventContextTags is provided', () => {
|
|
62
|
+
initializeTagList({ waitEventContextTags, moduleFilterEnabled: false });
|
|
63
|
+
addLabelBtnAssertion();
|
|
64
|
+
const WAIT_EVENT_HEADER = getByText(/Order Placed \(Wait Block\)/i);
|
|
65
|
+
expect(WAIT_EVENT_HEADER).toBeInTheDocument();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should merge empty waitEventContextTags with entry event tags', () => {
|
|
69
|
+
initializeTagList({ eventContextTags, waitEventContextTags: {}, moduleFilterEnabled: false });
|
|
70
|
+
addLabelBtnAssertion();
|
|
71
|
+
expect(getByText(/Entry event/i)).toBeInTheDocument();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('calls parent onContextChange with Outbound when tags and injectedTags are empty on popover open', () => {
|
|
75
|
+
const onContextChange = jest.fn();
|
|
76
|
+
initializeTagList({
|
|
77
|
+
tags: [],
|
|
78
|
+
injectedTags: {},
|
|
79
|
+
onContextChange,
|
|
80
|
+
onTagSelect: jest.fn(),
|
|
81
|
+
});
|
|
82
|
+
// Default fetch is triggered when the Add Label popover opens (not on mount)
|
|
83
|
+
addLabelBtnAssertion();
|
|
84
|
+
expect(onContextChange).toHaveBeenCalledWith('Outbound');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('applies fetchingSchemaError from props via componentWillReceiveProps', () => {
|
|
88
|
+
const { rerender, Component, propsObj, store } = initializeTagList({ fetchingSchemaError: false });
|
|
89
|
+
addLabelBtnAssertion();
|
|
90
|
+
rerender(
|
|
91
|
+
<Provider store={store}>
|
|
92
|
+
<Component {...propsObj} fetchingSchemaError />
|
|
93
|
+
</Provider>
|
|
94
|
+
);
|
|
95
|
+
expect(screen.getByText(/add label/i)).toBeInTheDocument();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('disables Add label when restrictPersonalization is true', () => {
|
|
99
|
+
initializeTagList({
|
|
100
|
+
restrictPersonalization: true,
|
|
101
|
+
disabled: false,
|
|
102
|
+
moduleFilterEnabled: false,
|
|
103
|
+
});
|
|
104
|
+
const btn = screen.getByText(/add label/i).closest('button');
|
|
105
|
+
expect(btn).toBeDisabled();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('calls transformCouponTags when selectedOfferDetails and coupon tags are present', () => {
|
|
109
|
+
const spy = jest.spyOn(TagList.prototype, 'transformCouponTags');
|
|
110
|
+
initializeTagList({
|
|
111
|
+
tags: OfferTag,
|
|
112
|
+
injectedTags: {},
|
|
113
|
+
selectedOfferDetails: [{ id: 'c1', couponName: 'Promo Coupon', couponSeriesId: 'c1' }],
|
|
114
|
+
moduleFilterEnabled: false,
|
|
115
|
+
});
|
|
116
|
+
expect(spy).toHaveBeenCalled();
|
|
117
|
+
spy.mockRestore();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('calls transformBadgeTags from common when badge offer and Badge tags are present', () => {
|
|
121
|
+
const spy = jest.spyOn(commonUtils, 'transformBadgeTags');
|
|
122
|
+
initializeTagList({
|
|
123
|
+
tags: badgesTags,
|
|
124
|
+
injectedTags: {},
|
|
125
|
+
selectedOfferDetails: offer,
|
|
126
|
+
moduleFilterEnabled: false,
|
|
127
|
+
});
|
|
128
|
+
expect(spy).toHaveBeenCalled();
|
|
129
|
+
spy.mockRestore();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('unmounts without throwing', () => {
|
|
133
|
+
const { unmount } = initializeTagList();
|
|
134
|
+
expect(() => unmount()).not.toThrow();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('regenerates tags when props.tags change (componentDidUpdate)', () => {
|
|
138
|
+
const { rerender, Component, store } = initializeTagList({ tags: TagListData.tags });
|
|
139
|
+
const extra = [
|
|
140
|
+
...TagListData.tags,
|
|
141
|
+
{
|
|
142
|
+
_id: 'extra-tag',
|
|
143
|
+
type: 'TAG',
|
|
144
|
+
definition: {
|
|
145
|
+
label: { en: 'Extra' },
|
|
146
|
+
value: 'extra_value',
|
|
147
|
+
subtags: [],
|
|
148
|
+
'tag-header': false,
|
|
149
|
+
supportedModules: [{ context: 'default', layout: 'sms', mandatory: false }],
|
|
150
|
+
},
|
|
151
|
+
scope: { tag: 'STANDARD', orgId: -1, verticals: [] },
|
|
152
|
+
isActive: true,
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
rerender(
|
|
156
|
+
<Provider store={store}>
|
|
157
|
+
<Component {...buildProps({ tags: extra })} />
|
|
158
|
+
</Provider>
|
|
159
|
+
);
|
|
160
|
+
addLabelBtnAssertion();
|
|
161
|
+
expect(screen.getByText(/add label/i)).toBeInTheDocument();
|
|
162
|
+
});
|
|
59
163
|
});
|
|
@@ -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
|
+
};
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
.ant-tabs-content{
|
|
4
4
|
margin-top: 16px;
|
|
5
|
+
// .creatives-templates-list.full-mode{
|
|
6
|
+
.v2-pagination-container, .v2-pagination-container-half {
|
|
5
7
|
.ant-tabs-tabpane-active{
|
|
6
8
|
padding: unset;
|
|
7
9
|
}
|
|
8
10
|
}
|
|
11
|
+
}
|
|
9
12
|
|
|
10
13
|
@media screen and (max-width: 1172px) {
|
|
11
14
|
.creatives-templates-list.full-mode{
|
|
@@ -20,8 +23,11 @@
|
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
26
|
+
// }
|
|
23
27
|
|
|
24
28
|
@media screen and (min-width: 1172px) {
|
|
29
|
+
.creatives-templates-list.full-mode{
|
|
30
|
+
.v2-pagination-container, .v2-pagination-container-half {
|
|
25
31
|
.creatives-templates-list.full-mode{
|
|
26
32
|
.v2-pagination-container {
|
|
27
33
|
.cap-custom-card-list-row {
|
|
@@ -33,16 +39,21 @@
|
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
36
44
|
}
|
|
37
45
|
|
|
46
|
+
|
|
38
47
|
.creatives-templates-list {
|
|
39
48
|
|
|
40
49
|
.delete-template-confirm {
|
|
41
50
|
.ant-modal-footer {
|
|
42
51
|
padding: $CAP_SPACE_16 $CAP_SPACE_24 $CAP_SPACE_24 $CAP_SPACE_24;
|
|
43
52
|
}
|
|
53
|
+
}
|
|
44
54
|
|
|
45
55
|
.ant-modal-header {
|
|
56
|
+
.v2-pagination-container, .v2-pagination-container-half {
|
|
46
57
|
padding: $CAP_SPACE_24 $CAP_SPACE_24 $CAP_SPACE_08 $CAP_SPACE_24;
|
|
47
58
|
}
|
|
48
59
|
|
|
@@ -181,10 +192,13 @@
|
|
|
181
192
|
.whatsapp-container {
|
|
182
193
|
background-color: $CAP_WHITE;
|
|
183
194
|
padding: $CAP_SPACE_12;
|
|
195
|
+
overflow-y: hidden;
|
|
184
196
|
}
|
|
185
197
|
.scroll-container {
|
|
186
198
|
overflow-x: auto;
|
|
187
199
|
display: flex;
|
|
200
|
+
flex-wrap: nowrap;
|
|
201
|
+
width: 100%;
|
|
188
202
|
padding-top: $CAP_SPACE_06;
|
|
189
203
|
padding-right: $CAP_SPACE_06;
|
|
190
204
|
white-space: nowrap;
|
|
@@ -218,6 +232,91 @@
|
|
|
218
232
|
}
|
|
219
233
|
}
|
|
220
234
|
|
|
235
|
+
// RCS template listing preview: match WhatsApp carousel "peek" behavior
|
|
236
|
+
.RCS {
|
|
237
|
+
.cap-custom-card {
|
|
238
|
+
.ant-card-body {
|
|
239
|
+
.ant-card-meta {
|
|
240
|
+
background-color: $CAP_G09;
|
|
241
|
+
padding: 0;
|
|
242
|
+
.ant-card-meta-description {
|
|
243
|
+
.whatsapp-container,.cap-rcs-creatives {
|
|
244
|
+
background-color: $CAP_WHITE;
|
|
245
|
+
padding: $CAP_SPACE_12;
|
|
246
|
+
border-radius: 0.25rem;
|
|
247
|
+
.cap-divider-v2{
|
|
248
|
+
margin: $CAP_SPACE_12 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
.scroll-container {
|
|
252
|
+
overflow-x: auto;
|
|
253
|
+
display: flex;
|
|
254
|
+
padding-top: $CAP_SPACE_06;
|
|
255
|
+
padding-right: $CAP_SPACE_06;
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
scrollbar-width: none; // Hide scrollbar in Firefox
|
|
258
|
+
&::-webkit-scrollbar {
|
|
259
|
+
display: none; // Hide scrollbar in Chrome/Safari/Opera
|
|
260
|
+
}
|
|
261
|
+
overflow-y: hidden;
|
|
262
|
+
.whatsapp-carousel-container {
|
|
263
|
+
padding: $CAP_SPACE_04 0px $CAP_SPACE_08;
|
|
264
|
+
border-radius: $CAP_SPACE_06;
|
|
265
|
+
background-color: $CAP_WHITE;
|
|
266
|
+
width: 80%;
|
|
267
|
+
flex-shrink: 0;
|
|
268
|
+
margin-right: $CAP_SPACE_04;
|
|
269
|
+
white-space: pre-wrap;
|
|
270
|
+
word-break: break-word;
|
|
271
|
+
overflow: auto;
|
|
272
|
+
text-align: left;
|
|
273
|
+
.whatsapp-carousel-card {
|
|
274
|
+
margin: $CAP_SPACE_02 $CAP_SPACE_06 $CAP_SPACE_01 $CAP_SPACE_08;
|
|
275
|
+
.whatsapp-carousel-body {
|
|
276
|
+
margin-bottom: $CAP_SPACE_08;
|
|
277
|
+
white-space: pre-wrap;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// RCS CTA buttons in listing (reuse WhatsApp-ish look)
|
|
284
|
+
.rcs-cta-preview {
|
|
285
|
+
margin: $CAP_SPACE_12 0;
|
|
286
|
+
display: flex;
|
|
287
|
+
justify-content: center;
|
|
288
|
+
font-size: $FONT_SIZE_M;
|
|
289
|
+
align-items: center;
|
|
290
|
+
color: #1970DA;
|
|
291
|
+
svg {
|
|
292
|
+
margin-right: $CAP_SPACE_04;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.rcs-video-preview-placeholder {
|
|
297
|
+
background: #f5f5f5;
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.rcs-video-preview-label {
|
|
304
|
+
color: #7a7a7a;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.rcs-listing-title {
|
|
308
|
+
font-weight: 600;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.whatsapp-divider {
|
|
312
|
+
margin: 0;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
221
320
|
.MOBILEPUSH {
|
|
222
321
|
.ant-card-body {
|
|
223
322
|
padding: 0;
|
|
@@ -132,7 +132,7 @@ import { INAPP_LAYOUT_DETAILS, INAPP_MESSAGE_LAYOUT_TYPES, INAPP_MEDIA_TYPES, BI
|
|
|
132
132
|
import { ZALO_STATUS_OPTIONS, ZALO_STATUSES } from '../Zalo/constants';
|
|
133
133
|
import { getWhatsappContent, getWhatsappStatus, getWhatsappCategory, getWhatsappCta, getWhatsappQuickReply, getWhatsappAutoFill, getWhatsappCarouselButtonView } from '../Whatsapp/utils';
|
|
134
134
|
import { getRCSContent } from '../Rcs/utils';
|
|
135
|
-
import {RCS_STATUSES} from '../Rcs/constants';
|
|
135
|
+
import { RCS_STATUSES, HOST_INFOBIP } from '../Rcs/constants';
|
|
136
136
|
import zaloMessages from '../Zalo/messages';
|
|
137
137
|
import rcsMessages from '../Rcs/messages';
|
|
138
138
|
import inAppMessages from '../InApp/messages';
|
|
@@ -1781,12 +1781,20 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1781
1781
|
}
|
|
1782
1782
|
|
|
1783
1783
|
filterRcsTemplates = (templates) => {
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1784
|
+
const selectedRcsAccountName = this.props?.Templates?.selectedRcsAccount?.name || '';
|
|
1785
|
+
const hostName = this.state?.hostName;
|
|
1786
|
+
let nextTemplates = templates || [];
|
|
1787
|
+
if (selectedRcsAccountName) {
|
|
1788
|
+
nextTemplates = nextTemplates.filter(
|
|
1789
|
+
(t) => get(t, 'versions.base.content.RCS.rcsContent.accountName', '') === selectedRcsAccountName
|
|
1790
|
+
);
|
|
1788
1791
|
}
|
|
1789
|
-
|
|
1792
|
+
if (!this.props.isFullMode && hostName !== HOST_INFOBIP) {
|
|
1793
|
+
return nextTemplates.filter(
|
|
1794
|
+
(t) => get(t, 'versions.base.content.RCS.rcsContent.cardContent[0].Status', 'unavailable') === RCS_STATUSES.approved
|
|
1795
|
+
);
|
|
1796
|
+
}
|
|
1797
|
+
return nextTemplates;
|
|
1790
1798
|
}
|
|
1791
1799
|
|
|
1792
1800
|
filterZaloTemplates = (templates) => {
|
|
@@ -2421,13 +2429,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2421
2429
|
templateData.title = (
|
|
2422
2430
|
<CapRow>
|
|
2423
2431
|
<CapLabel className="whatsapp-rcs-template-name">{name}</CapLabel>
|
|
2424
|
-
<CapRow type="flex" align="middle" className="rcs-status-container zalo-status-color">
|
|
2432
|
+
{this.state.hostName !== HOST_INFOBIP && <CapRow type="flex" align="middle" className="rcs-status-container zalo-status-color">
|
|
2425
2433
|
<CapStatus
|
|
2426
2434
|
type={statusDisplay}
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2435
|
+
text={statusDisplay && this.props.intl.formatMessage(rcsMessages?.[`${statusDisplay}_STATUS`])}
|
|
2436
|
+
labelType="label3"
|
|
2437
|
+
/>
|
|
2438
|
+
</CapRow>
|
|
2439
|
+
}
|
|
2431
2440
|
</CapRow>
|
|
2432
2441
|
);
|
|
2433
2442
|
|
|
@@ -2951,6 +2960,7 @@ return (<div>
|
|
|
2951
2960
|
let routeParams = {};
|
|
2952
2961
|
const {fbAdManager} = this.props;
|
|
2953
2962
|
const isLibraryMode = this.isEnabledInLibraryModule("callCreateFromProps");
|
|
2963
|
+
|
|
2954
2964
|
if (!isLibraryMode) {
|
|
2955
2965
|
timeTracker.startTimer(CHANNEL_CREATE_TRACK_MAPPING[channel]);
|
|
2956
2966
|
}
|
|
@@ -4209,9 +4219,14 @@ return (<div>
|
|
|
4209
4219
|
const isWechatEmbedded = !this.props.isFullMode && channel.toUpperCase() === WECHAT;
|
|
4210
4220
|
const channelLowerCase = (channel || '').toLowerCase();
|
|
4211
4221
|
const isTraiDltFeature = this.checkDLTfeatureEnable();
|
|
4212
|
-
|
|
4213
4222
|
const createButton =
|
|
4214
|
-
(
|
|
4223
|
+
(
|
|
4224
|
+
(
|
|
4225
|
+
channelLowerCase === WHATSAPP_LOWERCASE
|
|
4226
|
+
|| channelLowerCase === RCS_LOWERCASE
|
|
4227
|
+
)
|
|
4228
|
+
&& !this.props.isFullMode
|
|
4229
|
+
)
|
|
4215
4230
|
? (
|
|
4216
4231
|
<CapLink
|
|
4217
4232
|
onClick={this.openCreativesFullMode}
|
|
@@ -4483,7 +4498,7 @@ return (<div>
|
|
|
4483
4498
|
/>
|
|
4484
4499
|
) : null}
|
|
4485
4500
|
|
|
4486
|
-
{channel.toLowerCase() === RCS_LOWERCASE && !isFullMode ? (
|
|
4501
|
+
{channel.toLowerCase() === RCS_LOWERCASE && !isFullMode && this.state?.hostName !== HOST_INFOBIP ? (
|
|
4487
4502
|
<CapInfoNote
|
|
4488
4503
|
message={formatMessage(messages.rcsOnlyApprovedTemplates)}
|
|
4489
4504
|
/>
|
|
@@ -82,6 +82,7 @@ export const Viber = (props) => {
|
|
|
82
82
|
viberData = {},
|
|
83
83
|
selectedOfferDetails = [],
|
|
84
84
|
eventContextTags,
|
|
85
|
+
waitEventContextTags,
|
|
85
86
|
// TestAndPreviewSlidebox props
|
|
86
87
|
showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
|
|
87
88
|
handleTestAndPreview: propsHandleTestAndPreview,
|
|
@@ -287,6 +288,7 @@ export const Viber = (props) => {
|
|
|
287
288
|
userLocale={localStorage.getItem("jlocale") || "en"}
|
|
288
289
|
selectedOfferDetails={selectedOfferDetails}
|
|
289
290
|
eventContextTags={eventContextTags}
|
|
291
|
+
waitEventContextTags={waitEventContextTags}
|
|
290
292
|
/>
|
|
291
293
|
</CapColumn>
|
|
292
294
|
<div className="viber-textarea-wrapper">
|
|
@@ -592,6 +594,7 @@ export const Viber = (props) => {
|
|
|
592
594
|
userLocale={localStorage.getItem("jlocale") || "en"}
|
|
593
595
|
selectedOfferDetails={selectedOfferDetails}
|
|
594
596
|
eventContextTags={eventContextTags}
|
|
597
|
+
waitEventContextTags={waitEventContextTags}
|
|
595
598
|
/>
|
|
596
599
|
<CapColumn className="cta-actions">
|
|
597
600
|
<CapButton
|
|
@@ -84,6 +84,7 @@ const MemoizedTagList = memo(({
|
|
|
84
84
|
injectedTags,
|
|
85
85
|
selectedOfferDetails,
|
|
86
86
|
eventContextTags,
|
|
87
|
+
waitEventContextTags,
|
|
87
88
|
forwardedTags,
|
|
88
89
|
onTagSelect,
|
|
89
90
|
restrictPersonalization = false,
|
|
@@ -99,6 +100,7 @@ const MemoizedTagList = memo(({
|
|
|
99
100
|
injectedTags={injectedTags}
|
|
100
101
|
selectedOfferDetails={selectedOfferDetails}
|
|
101
102
|
eventContextTags={eventContextTags}
|
|
103
|
+
waitEventContextTags={waitEventContextTags}
|
|
102
104
|
forwardedTags={forwardedTags}
|
|
103
105
|
onTagSelect={onTagSelect}
|
|
104
106
|
restrictPersonalization={restrictPersonalization}
|
|
@@ -116,6 +118,7 @@ const MemoizedTagList = memo(({
|
|
|
116
118
|
&& prevProps.injectedTags === nextProps.injectedTags
|
|
117
119
|
&& prevProps.selectedOfferDetails === nextProps.selectedOfferDetails
|
|
118
120
|
&& prevProps.eventContextTags === nextProps.eventContextTags
|
|
121
|
+
&& prevProps.waitEventContextTags === nextProps.waitEventContextTags
|
|
119
122
|
&& prevProps.forwardedTags === nextProps.forwardedTags
|
|
120
123
|
&& prevProps.onTagSelect === nextProps.onTagSelect
|
|
121
124
|
&& prevProps.restrictPersonalization === nextProps.restrictPersonalization
|
|
@@ -152,6 +155,7 @@ const WebPushCreate = ({
|
|
|
152
155
|
forwardedTags,
|
|
153
156
|
selectedOfferDetails = [],
|
|
154
157
|
eventContextTags = [],
|
|
158
|
+
waitEventContextTags = {},
|
|
155
159
|
templateActions: templateActionsProps,
|
|
156
160
|
Templates,
|
|
157
161
|
restrictPersonalization = false,
|
|
@@ -232,6 +236,7 @@ const WebPushCreate = ({
|
|
|
232
236
|
supportedTags: memoizedSupportedTags,
|
|
233
237
|
injectedTags,
|
|
234
238
|
eventContextTags,
|
|
239
|
+
waitEventContextTags,
|
|
235
240
|
});
|
|
236
241
|
const { tags, handleOnTagsContextChange, validationConfig } = tagState;
|
|
237
242
|
const { weCrmAccounts } = Templates;
|
|
@@ -837,12 +842,13 @@ const WebPushCreate = ({
|
|
|
837
842
|
injectedTags,
|
|
838
843
|
selectedOfferDetails,
|
|
839
844
|
eventContextTags,
|
|
845
|
+
waitEventContextTags,
|
|
840
846
|
forwardedTags,
|
|
841
847
|
restrictPersonalization,
|
|
842
848
|
disabled: restrictPersonalization,
|
|
843
849
|
disableTooltipMsg: restrictPersonalization ? formatMessage(messages.personalizationNotSupportedAnonymous) : undefined,
|
|
844
850
|
}),
|
|
845
|
-
[tags, injectedTags, selectedOfferDetails, eventContextTags, forwardedTags, restrictPersonalization, formatMessage],
|
|
851
|
+
[tags, injectedTags, selectedOfferDetails, eventContextTags, waitEventContextTags, forwardedTags, restrictPersonalization, formatMessage],
|
|
846
852
|
);
|
|
847
853
|
|
|
848
854
|
// Memoized TagList components with optimized props
|
|
@@ -1083,6 +1089,7 @@ WebPushCreate.propTypes = {
|
|
|
1083
1089
|
forwardedTags: PropTypes.object,
|
|
1084
1090
|
selectedOfferDetails: PropTypes.array,
|
|
1085
1091
|
eventContextTags: PropTypes.array,
|
|
1092
|
+
waitEventContextTags: PropTypes.object,
|
|
1086
1093
|
templateActions: PropTypes.object,
|
|
1087
1094
|
restrictPersonalization: PropTypes.bool,
|
|
1088
1095
|
};
|
|
@@ -1111,6 +1118,7 @@ WebPushCreate.defaultProps = {
|
|
|
1111
1118
|
forwardedTags: {},
|
|
1112
1119
|
selectedOfferDetails: [],
|
|
1113
1120
|
eventContextTags: [],
|
|
1121
|
+
waitEventContextTags: {},
|
|
1114
1122
|
templateActions: {},
|
|
1115
1123
|
Templates: {},
|
|
1116
1124
|
restrictPersonalization: false,
|
|
@@ -1149,7 +1157,7 @@ const withWebPushSaga = injectSaga({
|
|
|
1149
1157
|
});
|
|
1150
1158
|
|
|
1151
1159
|
const withTemplateSaga = injectSaga({
|
|
1152
|
-
key: '
|
|
1160
|
+
key: 'templates',
|
|
1153
1161
|
saga: v2TemplateSaga,
|
|
1154
1162
|
mode: DAEMON,
|
|
1155
1163
|
});
|
|
@@ -181,6 +181,7 @@ export const Whatsapp = (props) => {
|
|
|
181
181
|
getFormData,
|
|
182
182
|
selectedOfferDetails,
|
|
183
183
|
eventContextTags,
|
|
184
|
+
waitEventContextTags = {},
|
|
184
185
|
metaDataStatus = "",
|
|
185
186
|
showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
|
|
186
187
|
handleTestAndPreview: propsHandleTestAndPreview,
|
|
@@ -933,6 +934,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
933
934
|
injectedTags={injectedTags || {}}
|
|
934
935
|
selectedOfferDetails={selectedOfferDetails}
|
|
935
936
|
eventContextTags={eventContextTags}
|
|
937
|
+
waitEventContextTags={waitEventContextTags}
|
|
936
938
|
/>
|
|
937
939
|
)}
|
|
938
940
|
</>
|
|
@@ -1934,6 +1936,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1934
1936
|
injectedTags={injectedTags || {}}
|
|
1935
1937
|
selectedOfferDetails={selectedOfferDetails}
|
|
1936
1938
|
eventContextTags={eventContextTags}
|
|
1939
|
+
waitEventContextTags={waitEventContextTags}
|
|
1937
1940
|
/>
|
|
1938
1941
|
)
|
|
1939
1942
|
: !isAuthenticationTemplate && (
|
|
@@ -2740,6 +2743,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2740
2743
|
injectedTags={injectedTags || {}}
|
|
2741
2744
|
selectedOfferDetails={selectedOfferDetails}
|
|
2742
2745
|
eventContextTags={eventContextTags}
|
|
2746
|
+
waitEventContextTags={waitEventContextTags}
|
|
2743
2747
|
/>
|
|
2744
2748
|
)
|
|
2745
2749
|
}
|
|
@@ -2858,6 +2862,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2858
2862
|
injectedTags={injectedTags || {}}
|
|
2859
2863
|
selectedOfferDetails={selectedOfferDetails}
|
|
2860
2864
|
eventContextTags={eventContextTags}
|
|
2865
|
+
waitEventContextTags={waitEventContextTags}
|
|
2861
2866
|
/>
|
|
2862
2867
|
)}
|
|
2863
2868
|
{isBtnTypeQuickReply && (
|
|
@@ -76,6 +76,7 @@ export const Zalo = (props) => {
|
|
|
76
76
|
selectedOfferDetails,
|
|
77
77
|
hostName: zaloHostName = '',
|
|
78
78
|
eventContextTags,
|
|
79
|
+
waitEventContextTags,
|
|
79
80
|
metaDataStatus = "",
|
|
80
81
|
// TestAndPreviewSlidebox props
|
|
81
82
|
showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
|
|
@@ -519,6 +520,7 @@ export const Zalo = (props) => {
|
|
|
519
520
|
injectedTags={injectedTags || {}}
|
|
520
521
|
selectedOfferDetails={selectedOfferDetails}
|
|
521
522
|
eventContextTags={eventContextTags}
|
|
523
|
+
waitEventContextTags={waitEventContextTags}
|
|
522
524
|
/>
|
|
523
525
|
}
|
|
524
526
|
/>
|