@capillarytech/creatives-library 8.0.339 → 8.0.340-beta.0

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.
Files changed (159) hide show
  1. package/app.js +8 -1
  2. package/global-styles.js +4 -0
  3. package/package.json +2 -2
  4. package/styles/components/navigation/_leftnav.scss +1 -1
  5. package/utils/tests/tagValidations.test.js +20 -0
  6. package/v2Components/AccessForbidden/index.js +1 -1
  7. package/v2Components/CapActionButton/index.js +5 -5
  8. package/v2Components/CapCustomSkeleton/index.js +1 -1
  9. package/v2Components/CapDeviceContent/index.js +5 -5
  10. package/v2Components/CapDocumentUpload/index.js +1 -1
  11. package/v2Components/CapImageUpload/index.js +1 -1
  12. package/v2Components/CapInAppCTA/index.js +118 -112
  13. package/v2Components/CapMpushCTA/index.js +72 -66
  14. package/v2Components/CapTagList/index.js +32 -27
  15. package/v2Components/CapTagList/style.scss +29 -0
  16. package/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +63 -0
  17. package/v2Components/CapTagListWithInput/index.js +4 -0
  18. package/v2Components/CapVideoUpload/index.js +1 -1
  19. package/v2Components/CapWhatsappCTA/index.js +130 -124
  20. package/v2Components/CapWhatsappCarouselButton/index.js +27 -29
  21. package/v2Components/CapWhatsappQuickReply/index.js +7 -7
  22. package/v2Components/Carousel/index.js +1 -1
  23. package/v2Components/CommonTestAndPreview/AddTestCustomer.js +1 -1
  24. package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +3 -3
  25. package/v2Components/CommonTestAndPreview/CustomerCreationModal.js +1 -1
  26. package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +4 -4
  27. package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +1 -1
  28. package/v2Components/CommonTestAndPreview/ExistingCustomerModal.js +6 -6
  29. package/v2Components/CommonTestAndPreview/LeftPanelContent.js +5 -5
  30. package/v2Components/CommonTestAndPreview/PreviewSection.js +1 -1
  31. package/v2Components/CommonTestAndPreview/UnifiedPreview/DeviceFrame.js +1 -1
  32. package/v2Components/CommonTestAndPreview/UnifiedPreview/EmailPreviewContent.js +8 -8
  33. package/v2Components/CommonTestAndPreview/UnifiedPreview/InAppPreviewContent.js +14 -13
  34. package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +22 -21
  35. package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +9 -9
  36. package/v2Components/CommonTestAndPreview/UnifiedPreview/SmsPreviewContent.js +8 -8
  37. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +10 -10
  38. package/v2Components/CommonTestAndPreview/UnifiedPreview/WhatsAppPreviewContent.js +13 -12
  39. package/v2Components/CommonTestAndPreview/UnifiedPreview/ZaloPreviewContent.js +4 -3
  40. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +10 -5
  41. package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +1 -1
  42. package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +3 -4
  43. package/v2Components/CommonTestAndPreview/index.js +1 -1
  44. package/v2Components/CustomerSearchSection/_customerSearch.scss +2 -1
  45. package/v2Components/CustomerSearchSection/index.js +9 -9
  46. package/v2Components/EmailMobilePreview/index.js +1 -1
  47. package/v2Components/ErrorInfoNote/index.js +13 -11
  48. package/v2Components/ErrorInfoNote/style.scss +1 -1
  49. package/v2Components/FormBuilder/_formBuilder.scss +1 -0
  50. package/v2Components/FormBuilder/index.js +39 -40
  51. package/v2Components/HtmlEditor/HTMLEditor.js +10 -5
  52. package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +1 -0
  53. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +927 -2
  54. package/v2Components/HtmlEditor/_htmlEditor.scss +2 -1
  55. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +4 -1
  56. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +2 -2
  57. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +2 -2
  58. package/v2Components/HtmlEditor/components/EditorToolbar/PreviewModeGroup.js +2 -2
  59. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +2 -2
  60. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +1 -0
  61. package/v2Components/HtmlEditor/components/PreviewPane/index.js +2 -2
  62. package/v2Components/HtmlEditor/components/SplitContainer/SplitContainer.js +2 -2
  63. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +2 -1
  64. package/v2Components/HtmlEditor/components/ValidationPanel/index.js +6 -9
  65. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +2 -2
  66. package/v2Components/NavigationBar/index.js +7 -1
  67. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +3 -4
  68. package/v2Components/TemplatePreview/_templatePreview.scss +5 -3
  69. package/v2Components/TemplatePreview/index.js +11 -9
  70. package/v2Components/TestAndPreviewSlidebox/CustomValuesEditor.js +3 -3
  71. package/v2Components/TestAndPreviewSlidebox/LeftPanelContent.js +5 -5
  72. package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +3 -3
  73. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +4 -2
  74. package/v2Containers/BeeEditor/index.js +3 -0
  75. package/v2Containers/BeePopupEditor/index.js +1 -1
  76. package/v2Containers/CommunicationFlow/CommunicationFlow.js +5 -5
  77. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.js +4 -3
  78. package/v2Containers/CommunicationFlow/steps/CommunicationStrategyStep/CommunicationStrategyStep.js +2 -2
  79. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/DeliverySettingsSection.js +3 -2
  80. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.js +7 -7
  81. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.scss +0 -5
  82. package/v2Containers/CommunicationFlow/steps/DynamicControlsStep/DynamicControlsStep.js +2 -2
  83. package/v2Containers/CommunicationFlow/steps/MessageTypeStep/MessageTypeStep.js +2 -2
  84. package/v2Containers/CreativesContainer/SlideBoxContent.js +28 -1
  85. package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -1
  86. package/v2Containers/CreativesContainer/index.js +4 -1
  87. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +47 -0
  88. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
  89. package/v2Containers/Ebill/index.js +10 -9
  90. package/v2Containers/Email/index.js +8 -7
  91. package/v2Containers/Email/initialSchema.js +1 -1
  92. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +6 -1
  93. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +3 -0
  94. package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +20 -2
  95. package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +16 -1
  96. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +3 -0
  97. package/v2Containers/EmailWrapper/index.js +4 -0
  98. package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +1 -0
  99. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +9 -0
  100. package/v2Containers/FTP/index.js +1 -1
  101. package/v2Containers/Facebook/Advertisement/index.js +4 -4
  102. package/v2Containers/Facebook/index.js +2 -2
  103. package/v2Containers/InApp/index.js +21 -16
  104. package/v2Containers/InApp/index.scss +0 -7
  105. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +2 -2
  106. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +1 -0
  107. package/v2Containers/InappAdvance/index.js +4 -4
  108. package/v2Containers/LanguageProvider/index.js +3 -3
  109. package/v2Containers/LanguageProvider/tests/index.test.js +3 -3
  110. package/v2Containers/Line/Container/Image/index.js +1 -1
  111. package/v2Containers/Line/Container/ImageCarousel/Content.js +1 -1
  112. package/v2Containers/Line/Container/ImageCarousel/index.js +5 -5
  113. package/v2Containers/Line/Container/ImageMap/index.js +3 -3
  114. package/v2Containers/Line/Container/Sticker/index.js +2 -2
  115. package/v2Containers/Line/Container/Sticker/utils.js +1 -1
  116. package/v2Containers/Line/Container/Video/index.js +1 -1
  117. package/v2Containers/Line/Container/Wrapper/index.js +3 -3
  118. package/v2Containers/Line/Container/Wrapper/style.js +1 -5
  119. package/v2Containers/Line/Container/index.js +2 -2
  120. package/v2Containers/Login/components/LoginForm/index.js +34 -47
  121. package/v2Containers/Login/index.js +5 -5
  122. package/v2Containers/MobilePush/Create/index.js +2 -0
  123. package/v2Containers/MobilePush/Edit/index.js +2 -0
  124. package/v2Containers/MobilePushNew/components/CtaButtons.js +2 -2
  125. package/v2Containers/MobilePushNew/components/MediaUploaders.js +9 -9
  126. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +4 -4
  127. package/v2Containers/MobilePushNew/index.js +2 -2
  128. package/v2Containers/MobilePushNew/index.scss +6 -3
  129. package/v2Containers/MobilepushWrapper/index.js +3 -1
  130. package/v2Containers/Rcs/index.js +25 -19
  131. package/v2Containers/Rcs/index.scss +0 -7
  132. package/v2Containers/Sms/Create/index.js +2 -0
  133. package/v2Containers/Sms/Edit/index.js +2 -0
  134. package/v2Containers/SmsTrai/Edit/index.js +5 -2
  135. package/v2Containers/SmsWrapper/index.js +2 -0
  136. package/v2Containers/TagList/index.js +62 -5
  137. package/v2Containers/TagList/messages.js +4 -0
  138. package/v2Containers/TagList/tests/TagList.test.js +124 -20
  139. package/v2Containers/TagList/tests/mockdata.js +17 -0
  140. package/v2Containers/Templates/index.js +16 -16
  141. package/v2Containers/Viber/index.js +22 -14
  142. package/v2Containers/Viber/index.scss +0 -7
  143. package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +1 -1
  144. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +2 -2
  145. package/v2Containers/WebPush/Create/components/BrandIconSection.js +1 -1
  146. package/v2Containers/WebPush/Create/components/ButtonForm.js +2 -2
  147. package/v2Containers/WebPush/Create/components/ButtonList.js +4 -4
  148. package/v2Containers/WebPush/Create/components/ButtonsLinksSection.js +4 -4
  149. package/v2Containers/WebPush/Create/components/FormActions.js +3 -3
  150. package/v2Containers/WebPush/Create/components/MessageSection.js +2 -2
  151. package/v2Containers/WebPush/Create/components/NotificationTitleSection.js +2 -2
  152. package/v2Containers/WebPush/Create/components/_buttons.scss +2 -2
  153. package/v2Containers/WebPush/Create/hooks/useTagManagement.js +0 -2
  154. package/v2Containers/WebPush/Create/index.js +9 -1
  155. package/v2Containers/WebPush/Create/index.scss +6 -3
  156. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +1 -1
  157. package/v2Containers/Whatsapp/index.js +33 -28
  158. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +20 -0
  159. package/v2Containers/Zalo/index.js +5 -3
@@ -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,
@@ -645,7 +646,7 @@ export const SmsTraiEdit = (props) => {
645
646
  </TraiEditTemplateDetails>
646
647
  )}
647
648
  <CapColumn span={14}>
648
- <CapRow>
649
+ <CapRow useLegacy>
649
650
  <CapHeader
650
651
  title={formatMessage(messages.traiEditTitle)}
651
652
  size="regular"
@@ -660,12 +661,14 @@ 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
  />
666
668
  </CapRow>
667
669
 
668
670
  <CapRow
671
+ useLegacy
669
672
  style={{
670
673
  backgroundColor: CAP_G10,
671
674
  padding: CAP_SPACE_16,
@@ -673,7 +676,7 @@ export const SmsTraiEdit = (props) => {
673
676
  >
674
677
  {renderedContent()}
675
678
  </CapRow>
676
- <CapRow>
679
+ <CapRow useLegacy>
677
680
  {smsLengthForVar()}
678
681
  </CapRow>
679
682
  <CapCheckbox onChange={unicodeHandler} checked={isUnicodeAllowed} disabled={disablehandler()}>
@@ -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 { tags, injectedTags, selectedOfferDetails } = this.props;
98
- const { tags: prevTags, injectedTags: prevInjectedTags, selectedOfferDetails: prevSelectedOfferDetails } = prevProps;
99
-
100
- if (tags !== prevTags || injectedTags !== prevInjectedTags || selectedOfferDetails !== prevSelectedOfferDetails) {
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
  });
@@ -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
- const propsObj = {
20
- ...TagListData,
21
- onTagSelect: jest.fn(),
22
- ...props,
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 tags correctly from generateTags and show tags under profile', () => {
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
+ };
@@ -1906,7 +1906,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1906
1906
  <span title={template?.name}>
1907
1907
  {template?.name}
1908
1908
  {currentChannel === INAPP && (
1909
- <CapRow>
1909
+ <CapRow useLegacy>
1910
1910
  <CapColoredTag
1911
1911
  tagColor={INAPP_LAYOUT_DETAILS[inappBodyType]?.tagColor}
1912
1912
  tagTextColor={
@@ -1937,7 +1937,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1937
1937
  // Show preview icon for other channels (e.g., WeChat, Line, Facebook, Ebill)
1938
1938
  if (currentChannel === ZALO && isZaloPreviewLoading) {
1939
1939
  return (
1940
- <CapSpin style={{ marginRight: "16px", position: "static", display: "inline" }} spinning />
1940
+ <CapSpin style={{ position: "static", display: "inline" }} spinning />
1941
1941
  );
1942
1942
  }
1943
1943
 
@@ -2312,7 +2312,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2312
2312
  case WHATSAPP: {
2313
2313
  const { whatsappImageSrc = '', templateMsg, docPreview, whatsappVideoPreviewImg = '', templateHeaderPreview, templateFooterPreview, carouselData = [] } = getWhatsappContent(template);
2314
2314
  templateData.title = (
2315
- <CapRow>
2315
+ <CapRow useLegacy>
2316
2316
  <CapLabel className="whatsapp-rcs-template-name">{template?.name}</CapLabel>
2317
2317
  <WhatsappStatusContainer template={template} />
2318
2318
  </CapRow>
@@ -2405,15 +2405,15 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2405
2405
  const name = get(template, "name", "");
2406
2406
  const statusDisplay=getRcsStatusType(status);
2407
2407
  templateData.title = (
2408
- <CapRow>
2408
+ <CapRow useLegacy>
2409
2409
  <CapLabel className="whatsapp-rcs-template-name">{name}</CapLabel>
2410
- <CapRow type="flex" align="middle" className="rcs-status-container zalo-status-color">
2410
+ <CapColumn type="flex" align="middle" className="rcs-status-container zalo-status-color">
2411
2411
  <CapStatus
2412
2412
  type={statusDisplay}
2413
2413
  text={statusDisplay && this.props.intl.formatMessage(rcsMessages?.[`${statusDisplay}_STATUS`])}
2414
2414
  labelType="label3"
2415
2415
  />
2416
- </CapRow>
2416
+ </CapColumn>
2417
2417
  </CapRow>
2418
2418
  );
2419
2419
 
@@ -2431,11 +2431,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2431
2431
  } = {},
2432
2432
  } = template;
2433
2433
  templateData.title = (
2434
- <CapRow>
2434
+ <CapRow useLegacy>
2435
2435
  <CapLabel className="zalo-template-name">
2436
2436
  {templateId}
2437
2437
  </CapLabel>
2438
- <CapRow
2438
+ <CapColumn
2439
2439
  type="flex"
2440
2440
  align="middle"
2441
2441
  className="zalo-status-container zalo-status-color"
@@ -2451,7 +2451,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2451
2451
  text={status && this.props.intl.formatMessage(zaloMessages?.[`${status}_STATUS`])}
2452
2452
  labelType="label3"
2453
2453
  />
2454
- </CapRow>
2454
+ </CapColumn>
2455
2455
  </CapRow>
2456
2456
  );
2457
2457
  templateData.content = <CapLabel type="label19" className="zalo-listing-content desc">{template.name}</CapLabel>;
@@ -3477,8 +3477,8 @@ return (<div>
3477
3477
  content = (<div className="sms-template-content">
3478
3478
  <div style={{textAlign: 'center', lineHeight: '260px'}} className="sms-text">
3479
3479
  <div>
3480
- <button type="button" className="ant-btn cap-button edit-button ant-btn-ghost" onClick={() => this.handleBlankTemplateAction('uploadFile')}><span>Upload File</span></button>
3481
- <button type="button" className="ant-btn cap-button preview-button ant-btn-danger" onClick={() => this.handleBlankTemplateAction('editor')}><span>Use Editor</span></button>
3480
+ <button type="button" className="ant-btn cap-button-v2 edit-button ant-btn-ghost" onClick={() => this.handleBlankTemplateAction('uploadFile')}><span>Upload File</span></button>
3481
+ <button type="button" className="ant-btn cap-button-v2 preview-button ant-btn-danger" onClick={() => this.handleBlankTemplateAction('editor')}><span>Use Editor</span></button>
3482
3482
  </div>
3483
3483
  </div>
3484
3484
  </div>);
@@ -3488,13 +3488,13 @@ return (<div>
3488
3488
  <div>
3489
3489
  <button
3490
3490
  type="button"
3491
- className="ant-btn cap-button edit-button ant-btn-ghost"
3491
+ className="ant-btn cap-button-v2 edit-button ant-btn-ghost"
3492
3492
  onClick={() => this.handleBlankTemplateAction('textTemplate', channel)}>
3493
3493
  <span>{this.props.intl.formatMessage(messages.textTemplate)}</span>
3494
3494
  </button>
3495
3495
  <button
3496
3496
  type="button"
3497
- className="ant-btn cap-button preview-button ant-btn-danger"
3497
+ className="ant-btn cap-button-v2 preview-button ant-btn-danger"
3498
3498
  onClick={() => this.handleBlankTemplateAction('imageTemplate', channel)}>
3499
3499
  <span>{this.props.intl.formatMessage(messages.imageTemplate)}</span>
3500
3500
  </button>
@@ -4453,7 +4453,7 @@ return (<div>
4453
4453
  message={formatMessage(messages.zaloOnlyApprovedTemplates)}
4454
4454
  />
4455
4455
  ) : null}
4456
- <CapRow>
4456
+ <CapRow useLegacy>
4457
4457
  <Pagination
4458
4458
  templateInProgress={
4459
4459
  this.props.Templates.getAllTemplatesInProgress
@@ -4493,7 +4493,7 @@ return (<div>
4493
4493
  )}
4494
4494
  </CapRow>
4495
4495
 
4496
- <CapRow>
4496
+ <CapRow useLegacy>
4497
4497
  {!isEmpty(creativesParams.mode) &&
4498
4498
  isFullMode && ( //creatives container for fullmode
4499
4499
  <CreativesContainer
@@ -4517,7 +4517,7 @@ return (<div>
4517
4517
  />
4518
4518
  )}
4519
4519
  </CapRow>
4520
- <CapRow>
4520
+ <CapRow useLegacy>
4521
4521
  {(this.state.channel.toLowerCase() === "ebill" ||
4522
4522
  this.state.channel.toLowerCase() === "email") &&
4523
4523
  htmlPreviewContent && (
@@ -16,6 +16,7 @@ import CapNotification from '@capillarytech/cap-ui-library/CapNotification';
16
16
  import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
17
17
  import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
18
18
  import CapRadioGroup from '@capillarytech/cap-ui-library/CapRadioGroup';
19
+ import ConfigProvider from 'antd/lib/config-provider';
19
20
  import CapAskAira from '@capillarytech/cap-ui-library/CapAskAira';
20
21
  import { GA } from '@capillarytech/cap-ui-utils';
21
22
  import * as globalActions from '../Cap/actions';
@@ -82,6 +83,7 @@ export const Viber = (props) => {
82
83
  viberData = {},
83
84
  selectedOfferDetails = [],
84
85
  eventContextTags,
86
+ waitEventContextTags,
85
87
  // TestAndPreviewSlidebox props
86
88
  showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
87
89
  handleTestAndPreview: propsHandleTestAndPreview,
@@ -287,6 +289,7 @@ export const Viber = (props) => {
287
289
  userLocale={localStorage.getItem("jlocale") || "en"}
288
290
  selectedOfferDetails={selectedOfferDetails}
289
291
  eventContextTags={eventContextTags}
292
+ waitEventContextTags={waitEventContextTags}
290
293
  />
291
294
  </CapColumn>
292
295
  <div className="viber-textarea-wrapper">
@@ -373,13 +376,15 @@ export const Viber = (props) => {
373
376
  <CapHeading type="h4" className="viber-render-heading">
374
377
  {formatMessage(messages.mediaLabel)}
375
378
  </CapHeading>
376
- <CapRadioGroup
377
- id="viber-media-radio"
378
- options={mediaRadioOptions}
379
- value={templateMediaType}
380
- onChange={onTemplateMediaTypeChange}
381
- className="viber-media-radio"
382
- />
379
+ <ConfigProvider theme={{ components: { Radio: { radioSize: 20, dotSize: 8 } } }}>
380
+ <CapRadioGroup
381
+ id="viber-media-radio"
382
+ options={mediaRadioOptions}
383
+ value={templateMediaType}
384
+ onChange={onTemplateMediaTypeChange}
385
+ className="viber-media-radio"
386
+ />
387
+ </ConfigProvider>
383
388
  </>
384
389
  );
385
390
 
@@ -592,6 +597,7 @@ export const Viber = (props) => {
592
597
  userLocale={localStorage.getItem("jlocale") || "en"}
593
598
  selectedOfferDetails={selectedOfferDetails}
594
599
  eventContextTags={eventContextTags}
600
+ waitEventContextTags={waitEventContextTags}
595
601
  />
596
602
  <CapColumn className="cta-actions">
597
603
  <CapButton
@@ -651,13 +657,15 @@ export const Viber = (props) => {
651
657
  {formatMessage(messages.videoButtonDisabled)}
652
658
  </CapLabel>
653
659
  )}
654
- <CapRadioGroup
655
- options={buttonRadioOptions}
656
- value={buttonType}
657
- onChange={onChangeButtonType}
658
- disabled={templateMediaType === VIBER_MEDIA_TYPES.VIDEO}
659
- className="viber-btn-radio-group"
660
- />
660
+ <ConfigProvider theme={{ components: { Radio: { radioSize: 20, dotSize: 8 } } }}>
661
+ <CapRadioGroup
662
+ options={buttonRadioOptions}
663
+ value={buttonType}
664
+ onChange={onChangeButtonType}
665
+ disabled={templateMediaType === VIBER_MEDIA_TYPES.VIDEO}
666
+ className="viber-btn-radio-group"
667
+ />
668
+ </ConfigProvider>
661
669
  {isBtnTypeCta && ButtonViber}
662
670
  </div>
663
671
  );
@@ -7,13 +7,6 @@
7
7
  margin-right: $CAP_SPACE_24;
8
8
  }
9
9
 
10
- .ant-radio-inner::after{
11
- top: 3px;
12
- left: 3px;
13
- }
14
- .ant-radio-inner{
15
- border: 1px solid #d9d9d9;
16
- }
17
10
  .ant-radio-checked .ant-radio-inner{
18
11
  border: 1px solid #47af46;
19
12
  }
@@ -147,7 +147,7 @@
147
147
  }
148
148
  .embedded-mode {
149
149
  .cover-image-row {
150
- display: none;
150
+ display: none !important;
151
151
  }
152
152
  }
153
153
  }
@@ -500,12 +500,12 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
500
500
  if (id === 0) {
501
501
  returnObj.push(
502
502
  <div style={{ width: "100%", height: 116, position: "relative" }}>
503
- <CapRow>
503
+ <CapRow useLegacy>
504
504
  <img alt="default" width="100%" height="110px" src={contentData.imageUrl} />
505
505
  <div style={{ position: "absolute", bottom: "5%", left: "5%" }}>{contentData.formData['title-value'] ? contentData.formData['title-value'] : ""}</div>
506
506
  </CapRow>
507
507
  {Object.keys(templateData).length === 1 ?
508
- <CapRow style={{ height: 32 }}>
508
+ <CapRow useLegacy style={{ height: 32 }}>
509
509
  {contentData.formData['cover-abstract-value'] ? contentData.formData['cover-abstract-value'] : ""}
510
510
  </CapRow>
511
511
  :
@@ -56,7 +56,7 @@ export const BrandIconSection = ({
56
56
  />
57
57
  </CapRow>
58
58
  {brandIconOption === BRAND_ICON_OPTIONS.UPLOAD_IMAGE && (
59
- <CapRow
59
+ <CapRow useLegacy
60
60
  className="webpush-brand-icon-upload-section"
61
61
  style={isLocked ? { pointerEvents: 'none', opacity: 0.5 } : undefined}
62
62
  aria-disabled={isLocked}
@@ -98,7 +98,7 @@ const ButtonForm = ({
98
98
 
99
99
  return (
100
100
  <div className="webpush-button-form" onKeyDown={handleKeyDown}>
101
- <CapRow className="button-form-row">
101
+ <CapRow useLegacy className="button-form-row">
102
102
  <CapHeading type="h4" className="button-form-heading">
103
103
  <FormattedMessage {...messages.buttonText} />
104
104
  </CapHeading>
@@ -116,7 +116,7 @@ const ButtonForm = ({
116
116
  />
117
117
  </div>
118
118
  </CapRow>
119
- <CapRow className="button-form-row">
119
+ <CapRow useLegacy className="button-form-row">
120
120
  <CapHeading type="h4" className="button-form-heading">
121
121
  <FormattedMessage {...messages.buttonUrlLabel} />
122
122
  </CapHeading>