@capillarytech/creatives-library 8.0.340-0 → 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 (134) 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/v2Components/AccessForbidden/index.js +1 -1
  6. package/v2Components/CapActionButton/index.js +5 -5
  7. package/v2Components/CapCustomSkeleton/index.js +1 -1
  8. package/v2Components/CapDeviceContent/index.js +5 -5
  9. package/v2Components/CapDocumentUpload/index.js +1 -1
  10. package/v2Components/CapImageUpload/index.js +1 -1
  11. package/v2Components/CapInAppCTA/index.js +118 -112
  12. package/v2Components/CapMpushCTA/index.js +72 -66
  13. package/v2Components/CapTagList/index.js +5 -5
  14. package/v2Components/CapVideoUpload/index.js +1 -1
  15. package/v2Components/CapWhatsappCTA/index.js +128 -124
  16. package/v2Components/CapWhatsappCarouselButton/index.js +27 -29
  17. package/v2Components/CapWhatsappQuickReply/index.js +7 -7
  18. package/v2Components/Carousel/index.js +1 -1
  19. package/v2Components/CommonTestAndPreview/AddTestCustomer.js +1 -1
  20. package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +3 -3
  21. package/v2Components/CommonTestAndPreview/CustomerCreationModal.js +1 -1
  22. package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +4 -4
  23. package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +1 -1
  24. package/v2Components/CommonTestAndPreview/ExistingCustomerModal.js +6 -6
  25. package/v2Components/CommonTestAndPreview/LeftPanelContent.js +5 -5
  26. package/v2Components/CommonTestAndPreview/PreviewSection.js +1 -1
  27. package/v2Components/CommonTestAndPreview/UnifiedPreview/DeviceFrame.js +1 -1
  28. package/v2Components/CommonTestAndPreview/UnifiedPreview/EmailPreviewContent.js +8 -8
  29. package/v2Components/CommonTestAndPreview/UnifiedPreview/InAppPreviewContent.js +14 -13
  30. package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +22 -21
  31. package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +9 -9
  32. package/v2Components/CommonTestAndPreview/UnifiedPreview/SmsPreviewContent.js +8 -8
  33. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +10 -10
  34. package/v2Components/CommonTestAndPreview/UnifiedPreview/WhatsAppPreviewContent.js +13 -12
  35. package/v2Components/CommonTestAndPreview/UnifiedPreview/ZaloPreviewContent.js +4 -3
  36. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +10 -5
  37. package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +1 -1
  38. package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +3 -4
  39. package/v2Components/CommonTestAndPreview/index.js +1 -1
  40. package/v2Components/CustomerSearchSection/_customerSearch.scss +2 -1
  41. package/v2Components/CustomerSearchSection/index.js +9 -9
  42. package/v2Components/EmailMobilePreview/index.js +1 -1
  43. package/v2Components/ErrorInfoNote/index.js +13 -11
  44. package/v2Components/ErrorInfoNote/style.scss +1 -1
  45. package/v2Components/FormBuilder/_formBuilder.scss +1 -0
  46. package/v2Components/FormBuilder/index.js +32 -40
  47. package/v2Components/HtmlEditor/HTMLEditor.js +4 -4
  48. package/v2Components/HtmlEditor/_htmlEditor.scss +2 -1
  49. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +1 -1
  50. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +2 -2
  51. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +2 -2
  52. package/v2Components/HtmlEditor/components/EditorToolbar/PreviewModeGroup.js +2 -2
  53. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +2 -2
  54. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +1 -0
  55. package/v2Components/HtmlEditor/components/PreviewPane/index.js +2 -2
  56. package/v2Components/HtmlEditor/components/SplitContainer/SplitContainer.js +2 -2
  57. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +2 -1
  58. package/v2Components/HtmlEditor/components/ValidationPanel/index.js +6 -9
  59. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +2 -2
  60. package/v2Components/NavigationBar/index.js +7 -1
  61. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +3 -4
  62. package/v2Components/TemplatePreview/_templatePreview.scss +5 -3
  63. package/v2Components/TemplatePreview/index.js +11 -9
  64. package/v2Components/TestAndPreviewSlidebox/CustomValuesEditor.js +3 -3
  65. package/v2Components/TestAndPreviewSlidebox/LeftPanelContent.js +5 -5
  66. package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +3 -3
  67. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +4 -2
  68. package/v2Containers/BeePopupEditor/index.js +1 -1
  69. package/v2Containers/CommunicationFlow/CommunicationFlow.js +5 -5
  70. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.js +4 -3
  71. package/v2Containers/CommunicationFlow/steps/CommunicationStrategyStep/CommunicationStrategyStep.js +2 -2
  72. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/DeliverySettingsSection.js +3 -2
  73. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.js +7 -7
  74. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.scss +0 -5
  75. package/v2Containers/CommunicationFlow/steps/DynamicControlsStep/DynamicControlsStep.js +2 -2
  76. package/v2Containers/CommunicationFlow/steps/MessageTypeStep/MessageTypeStep.js +2 -2
  77. package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -1
  78. package/v2Containers/CreativesContainer/index.js +1 -1
  79. package/v2Containers/Ebill/index.js +10 -9
  80. package/v2Containers/Email/index.js +7 -7
  81. package/v2Containers/Email/initialSchema.js +1 -1
  82. package/v2Containers/FTP/index.js +1 -1
  83. package/v2Containers/Facebook/Advertisement/index.js +4 -4
  84. package/v2Containers/Facebook/index.js +2 -2
  85. package/v2Containers/InApp/index.js +21 -16
  86. package/v2Containers/InApp/index.scss +0 -7
  87. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +2 -2
  88. package/v2Containers/InappAdvance/index.js +4 -4
  89. package/v2Containers/LanguageProvider/index.js +3 -3
  90. package/v2Containers/LanguageProvider/tests/index.test.js +3 -3
  91. package/v2Containers/Line/Container/Image/index.js +1 -1
  92. package/v2Containers/Line/Container/ImageCarousel/Content.js +1 -1
  93. package/v2Containers/Line/Container/ImageCarousel/index.js +5 -5
  94. package/v2Containers/Line/Container/ImageMap/index.js +3 -3
  95. package/v2Containers/Line/Container/Sticker/index.js +2 -2
  96. package/v2Containers/Line/Container/Sticker/utils.js +1 -1
  97. package/v2Containers/Line/Container/Video/index.js +1 -1
  98. package/v2Containers/Line/Container/Wrapper/index.js +3 -3
  99. package/v2Containers/Line/Container/Wrapper/style.js +1 -5
  100. package/v2Containers/Line/Container/index.js +2 -2
  101. package/v2Containers/Login/components/LoginForm/index.js +34 -47
  102. package/v2Containers/Login/index.js +5 -5
  103. package/v2Containers/MobilePushNew/components/CtaButtons.js +2 -2
  104. package/v2Containers/MobilePushNew/components/MediaUploaders.js +9 -9
  105. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +4 -4
  106. package/v2Containers/MobilePushNew/index.js +2 -2
  107. package/v2Containers/MobilePushNew/index.scss +6 -3
  108. package/v2Containers/Rcs/index.js +24 -19
  109. package/v2Containers/Rcs/index.scss +0 -7
  110. package/v2Containers/SmsTrai/Edit/index.js +3 -2
  111. package/v2Containers/Templates/index.js +16 -16
  112. package/v2Containers/Viber/constants.js +0 -8
  113. package/v2Containers/Viber/index.js +19 -19
  114. package/v2Containers/Viber/index.scss +0 -7
  115. package/v2Containers/Viber/reducer.js +21 -44
  116. package/v2Containers/Viber/sagas.js +21 -62
  117. package/v2Containers/Viber/tests/index.test.js +0 -80
  118. package/v2Containers/Viber/tests/saga.test.js +40 -365
  119. package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +1 -1
  120. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +2 -2
  121. package/v2Containers/WebPush/Create/components/BrandIconSection.js +1 -1
  122. package/v2Containers/WebPush/Create/components/ButtonForm.js +2 -2
  123. package/v2Containers/WebPush/Create/components/ButtonList.js +4 -4
  124. package/v2Containers/WebPush/Create/components/ButtonsLinksSection.js +4 -4
  125. package/v2Containers/WebPush/Create/components/FormActions.js +3 -3
  126. package/v2Containers/WebPush/Create/components/MessageSection.js +2 -2
  127. package/v2Containers/WebPush/Create/components/NotificationTitleSection.js +2 -2
  128. package/v2Containers/WebPush/Create/components/_buttons.scss +2 -2
  129. package/v2Containers/WebPush/Create/index.scss +6 -3
  130. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +1 -1
  131. package/v2Containers/Whatsapp/index.js +28 -28
  132. package/v2Containers/Zalo/index.js +3 -3
  133. package/.npmrc copy +0 -2
  134. package/v2Containers/Viber/tests/reducer.test.js +0 -297
@@ -67,14 +67,16 @@
67
67
 
68
68
  .input-group {
69
69
  display: flex;
70
- flex-direction: column;
70
+ flex-direction: column !important;
71
+ flex-flow: column nowrap;
71
72
  gap: $CAP_SPACE_16;
72
73
  }
73
74
 
74
75
  .creatives-mpush-title,
75
76
  .creatives-mpush-message {
76
77
  display: flex;
77
- flex-direction: column;
78
+ flex-direction: column !important;
79
+ flex-flow: column nowrap;
78
80
  gap: $CAP_SPACE_08;
79
81
  }
80
82
 
@@ -122,8 +124,9 @@
122
124
  background: #fafafa;
123
125
  }
124
126
 
127
+ /* TODO: cap-react-ui-library class removed — review this override */
125
128
  .button-form .cap-input,
126
- .button-form .cap-select {
129
+ .button-form .cap-select-v2 {
127
130
  margin-bottom: $CAP_SPACE_16;
128
131
  }
129
132
 
@@ -16,6 +16,7 @@ import CapInput from '@capillarytech/cap-ui-library/CapInput';
16
16
  import CapAlert from '@capillarytech/cap-ui-library/CapAlert';
17
17
  import CapHeading from '@capillarytech/cap-ui-library/CapHeading';
18
18
  import CapRadioGroup from '@capillarytech/cap-ui-library/CapRadioGroup';
19
+ import ConfigProvider from 'antd/lib/config-provider';
19
20
  import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
20
21
  import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
21
22
  import CapHeader from '@capillarytech/cap-ui-library/CapHeader';
@@ -1144,7 +1145,7 @@ const splitTemplateVarString = (str) => {
1144
1145
  ) : (
1145
1146
  <CapButton
1146
1147
  data-testid="suffix-button"
1147
- type="flat"
1148
+ type="link"
1148
1149
  isAddBtn
1149
1150
  onClick={onTitleAddVar}
1150
1151
  disabled={!!templateTitleError}
@@ -1183,7 +1184,7 @@ const splitTemplateVarString = (str) => {
1183
1184
  )}
1184
1185
 
1185
1186
  {/* Template Message */}
1186
- <CapRow id="rcs-template-message-label">
1187
+ <CapRow useLegacy id="rcs-template-message-label">
1187
1188
  <CapHeader
1188
1189
  title={(
1189
1190
  <CapRow type="flex">
@@ -1206,7 +1207,7 @@ const splitTemplateVarString = (str) => {
1206
1207
  ) : (
1207
1208
  <CapButton
1208
1209
  data-testid="suffix-button"
1209
- type="flat"
1210
+ type="link"
1210
1211
  isAddBtn
1211
1212
  onClick={onMessageAddVar}
1212
1213
  disabled={templateDescError && templateDesc}
@@ -1217,7 +1218,7 @@ const splitTemplateVarString = (str) => {
1217
1218
  }
1218
1219
  />
1219
1220
  </CapRow>
1220
- <CapRow className="rcs-create-template-message-input">
1221
+ <CapRow useLegacy className="rcs-create-template-message-input">
1221
1222
  <div className="rcs_text_area_wrapper">
1222
1223
  {(isEditFlow || !isFullMode)
1223
1224
  ? renderedRCSEditMessage(splitTemplateVarString(templateDesc), MESSAGE_TEXT)
@@ -2276,7 +2277,7 @@ const splitTemplateVarString = (str) => {
2276
2277
 
2277
2278
  return (
2278
2279
  <>
2279
- {templateStatus !== '' && (<CapRow className="template-status-container">
2280
+ {templateStatus !== '' && (<CapRow useLegacy className="template-status-container">
2280
2281
  <CapLabel type="label2">
2281
2282
  {formatMessage(messages.templateStatusLabel)}
2282
2283
  </CapLabel>
@@ -2308,25 +2309,29 @@ const splitTemplateVarString = (str) => {
2308
2309
  />
2309
2310
  )}
2310
2311
  {renderLabel('templateTypeLabel')}
2311
- <CapRadioGroup
2312
- id="select-rcs-template-type"
2313
- options={TEMPLATE_TYPE_OPTIONS}
2314
- onChange={onTemplateTypeChange}
2315
- value={templateType}
2316
- disabled={(isEditFlow || !isFullMode)}
2317
- />
2312
+ <ConfigProvider theme={{ components: { Radio: { radioSize: 20, dotSize: 8 } } }}>
2313
+ <CapRadioGroup
2314
+ id="select-rcs-template-type"
2315
+ options={TEMPLATE_TYPE_OPTIONS}
2316
+ onChange={onTemplateTypeChange}
2317
+ value={templateType}
2318
+ disabled={(isEditFlow || !isFullMode)}
2319
+ />
2320
+ </ConfigProvider>
2318
2321
 
2319
2322
  {/* Show media only for rich_card or carousel */}
2320
2323
  {(templateType === contentType.rich_card || templateType === contentType.carousel) && (
2321
2324
  <>
2322
2325
  {renderLabel('mediaLabel')}
2323
- <CapRadioGroup
2324
- options={mediaRadioOptions || []}
2325
- value={templateMediaType}
2326
- onChange={onTemplateMediaTypeChange}
2327
- disabled={(isEditFlow || !isFullMode)}
2328
- className="rcs-radio"
2329
- />
2326
+ <ConfigProvider theme={{ components: { Radio: { radioSize: 20, dotSize: 8 } } }}>
2327
+ <CapRadioGroup
2328
+ options={mediaRadioOptions || []}
2329
+ value={templateMediaType}
2330
+ onChange={onTemplateMediaTypeChange}
2331
+ disabled={(isEditFlow || !isFullMode)}
2332
+ className="rcs-radio"
2333
+ />
2334
+ </ConfigProvider>
2330
2335
  <div className="rcs-container-image">
2331
2336
  {getMediaBasedComponent()}
2332
2337
  </div>
@@ -44,13 +44,6 @@
44
44
  margin-right: 50px;
45
45
  }
46
46
 
47
- .ant-radio-inner::after{
48
- top: 3px;
49
- left: 3px;
50
- }
51
- .ant-radio-inner{
52
- border: 1px solid #d9d9d9;
53
- }
54
47
  .ant-radio-checked .ant-radio-inner{
55
48
  border: 1px solid #47af46;
56
49
  }
@@ -646,7 +646,7 @@ export const SmsTraiEdit = (props) => {
646
646
  </TraiEditTemplateDetails>
647
647
  )}
648
648
  <CapColumn span={14}>
649
- <CapRow>
649
+ <CapRow useLegacy>
650
650
  <CapHeader
651
651
  title={formatMessage(messages.traiEditTitle)}
652
652
  size="regular"
@@ -668,6 +668,7 @@ export const SmsTraiEdit = (props) => {
668
668
  </CapRow>
669
669
 
670
670
  <CapRow
671
+ useLegacy
671
672
  style={{
672
673
  backgroundColor: CAP_G10,
673
674
  padding: CAP_SPACE_16,
@@ -675,7 +676,7 @@ export const SmsTraiEdit = (props) => {
675
676
  >
676
677
  {renderedContent()}
677
678
  </CapRow>
678
- <CapRow>
679
+ <CapRow useLegacy>
679
680
  {smsLengthForVar()}
680
681
  </CapRow>
681
682
  <CapCheckbox onChange={unicodeHandler} checked={isUnicodeAllowed} disabled={disablehandler()}>
@@ -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 && (
@@ -3,7 +3,6 @@ import React from 'react';
3
3
  import CapHeading from "@capillarytech/cap-ui-library/CapHeading";
4
4
  import CapLabel from "@capillarytech/cap-ui-library/CapLabel";
5
5
  import messages from "./messages";
6
- import { createAsyncAssetUploadConstants } from '../../utils/asyncAssetUpload';
7
6
 
8
7
  export const DEFAULT_ACTION = 'app/v2Containers/Viber/DEFAULT_ACTION';
9
8
  export const ALLOWED_EXTENSIONS_REGEX = (/\.(jpe?g|png)$/i);
@@ -17,13 +16,6 @@ export const UPLOAD_VIBER_ASSET_REQUEST = 'app/v2Containers/Viber/UPLOAD_ASSET_R
17
16
  export const UPLOAD_VIBER_ASSET_SUCCESS = 'app/v2Containers/Viber/UPLOAD_ASSET_SUCCESS';
18
17
  export const UPLOAD_VIBER_ASSET_FAILURE = 'app/v2Containers/Viber/UPLOAD_ASSET_FAILURE';
19
18
 
20
- const viberAsyncPrefix = 'app/v2Containers/Viber';
21
- const asyncUploadConstants = createAsyncAssetUploadConstants('VIBER', viberAsyncPrefix);
22
- export const UPLOAD_VIBER_ASSET_PROCESSING = asyncUploadConstants.UPLOAD_VIBER_ASSET_PROCESSING;
23
- export const UPLOAD_VIBER_ASSET_COMPLETED = asyncUploadConstants.UPLOAD_VIBER_ASSET_COMPLETED;
24
- export const UPLOAD_VIBER_ASSET_FAILED = asyncUploadConstants.UPLOAD_VIBER_ASSET_FAILED;
25
- export const UPLOAD_VIBER_ASSET_TIMEOUT = asyncUploadConstants.UPLOAD_VIBER_ASSET_TIMEOUT;
26
-
27
19
 
28
20
  export const CREATE_VIBER_TEMPLATE_REQUEST = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_REQUEST';
29
21
  export const CREATE_VIBER_TEMPLATE_SUCCESS = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_SUCCESS';
@@ -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';
@@ -375,13 +376,15 @@ export const Viber = (props) => {
375
376
  <CapHeading type="h4" className="viber-render-heading">
376
377
  {formatMessage(messages.mediaLabel)}
377
378
  </CapHeading>
378
- <CapRadioGroup
379
- id="viber-media-radio"
380
- options={mediaRadioOptions}
381
- value={templateMediaType}
382
- onChange={onTemplateMediaTypeChange}
383
- className="viber-media-radio"
384
- />
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>
385
388
  </>
386
389
  );
387
390
 
@@ -419,7 +422,6 @@ export const Viber = (props) => {
419
422
  channel={VIBER}
420
423
  errorMessage={formatMessage(messages.videoErrorMessage)}
421
424
  showVideoNameAndDuration
422
- assetUploading={viber?.assetUploading}
423
425
  />
424
426
  );
425
427
 
@@ -655,13 +657,15 @@ export const Viber = (props) => {
655
657
  {formatMessage(messages.videoButtonDisabled)}
656
658
  </CapLabel>
657
659
  )}
658
- <CapRadioGroup
659
- options={buttonRadioOptions}
660
- value={buttonType}
661
- onChange={onChangeButtonType}
662
- disabled={templateMediaType === VIBER_MEDIA_TYPES.VIDEO}
663
- className="viber-btn-radio-group"
664
- />
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>
665
669
  {isBtnTypeCta && ButtonViber}
666
670
  </div>
667
671
  );
@@ -796,10 +800,6 @@ export const Viber = (props) => {
796
800
  ) {
797
801
  return true;
798
802
  }
799
- // block submit while a media asset upload is still in progress
800
- if ((isMediaTypeImage || isMediaTypeVideo) && viber?.assetUploading) {
801
- return true;
802
- }
803
803
  if (isBtnTypeCta && !isCtaSaved) {
804
804
  return true;
805
805
  }
@@ -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
  }
@@ -6,71 +6,51 @@
6
6
 
7
7
  import { fromJS } from 'immutable';
8
8
  import * as types from './constants';
9
- import { createAsyncAssetUploadReducerCases } from '../../utils/asyncAssetUpload';
10
-
11
- const asyncUploadCases = createAsyncAssetUploadReducerCases({
12
- PROCESSING: types.UPLOAD_VIBER_ASSET_PROCESSING,
13
- COMPLETED: types.UPLOAD_VIBER_ASSET_COMPLETED,
14
- FAILED: types.UPLOAD_VIBER_ASSET_FAILED,
15
- TIMEOUT: types.UPLOAD_VIBER_ASSET_TIMEOUT,
16
- });
17
9
 
18
10
  const initialState = fromJS({
19
11
  uploadedAssetData: {},
20
12
  createTemplateInProgress: false,
21
- assetProcessing: {},
22
13
  });
23
14
 
24
15
  function viberReducer(state = initialState, action) {
25
16
  switch (action.type) {
26
17
  case types.CREATE_VIBER_TEMPLATE_REQUEST:
27
18
  return state
28
- .set('createTemplateInProgress', true)
29
- .set('createTemplateError', false)
30
- .set('createTemplateErrorMessage', fromJS(""));
19
+ .set('createTemplateInProgress', true)
20
+ .set('createTemplateError', false)
21
+ .set('createTemplateErrorMessage', fromJS(""));
31
22
  case types.CREATE_VIBER_TEMPLATE_SUCCESS:
32
23
  return state.set('createTemplateInProgress', false)
33
- .set('response', action.data)
34
- .set('createTemplateError', (action.statusCode !== undefined && action.statusCode > 300))
35
- .set('createTemplateErrorMessage', fromJS(action.errorMsg));
24
+ .set('response', action.data)
25
+ .set('createTemplateError', (action.statusCode !== undefined && action.statusCode > 300))
26
+ .set('createTemplateErrorMessage', fromJS(action.errorMsg));
36
27
  case types.CREATE_VIBER_TEMPLATE_FAILURE:
37
28
  return state
38
- .set('createTemplateInProgress', false)
39
- .set('createTemplateError', true)
40
- .set('createTemplateErrorMessage', fromJS(action.errorMsg));
29
+ .set('createTemplateInProgress', false)
30
+ .set('createTemplateError', true)
31
+ .set('createTemplateErrorMessage', fromJS(action.errorMsg));
41
32
  case types.UPLOAD_VIBER_ASSET_REQUEST:
42
33
  return state
43
- .set('uploadAssetSuccess', false)
44
- .set('assetUploading', true);
34
+ .set('uploadAssetSuccess', false)
35
+ .set('assetUploading', true);
45
36
  case types.UPLOAD_VIBER_ASSET_SUCCESS:
46
37
  return state
47
- .set('uploadAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
48
- .set('assetUploading', false)
49
- .set(action.templateType !== undefined ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData', fromJS(action.data));
38
+ .set('uploadAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
39
+ .set('assetUploading', false)
40
+ .set(action.templateType !== undefined ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData', action.data);
50
41
  case types.UPLOAD_VIBER_ASSET_FAILURE:
51
42
  return state
52
- .set('uploadAssetSuccess', false)
53
- .set('assetUploading', false);
54
- case asyncUploadCases.PROCESSING:
55
- return asyncUploadCases.handleProcessing(state, action);
56
- case asyncUploadCases.COMPLETED:
57
- return asyncUploadCases.handleCompleted(state, action);
58
- case asyncUploadCases.FAILED:
59
- return asyncUploadCases.handleFailed(state, action);
60
- case asyncUploadCases.TIMEOUT:
61
- return asyncUploadCases.handleTimeout(state, action);
43
+ .set('uploadAssetSuccess', false)
44
+ .set('assetUploading', false);
62
45
  case types.CLEAR_VIBER_ASSET:
63
46
  return state
64
- .delete(action.templateType !== undefined ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData')
65
- .set('assetProcessing', fromJS({}))
66
- .set('assetUploading', false)
67
- .set('uploadAssetSuccess', false);
47
+ .delete(action.templateType !== undefined ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData');
68
48
  // FOR EDIT
69
49
  case types.EDIT_VIBER_TEMPLATE_REQUEST:
70
50
  return state
71
- .set('editTemplateInProgress', true)
72
- .set('editTemplateError', false)
73
- .set('editTemplateErrorMessage', fromJS(""));
51
+ .set('editTemplateInProgress', true)
52
+ .set('editTemplateError', false)
53
+ .set('editTemplateErrorMessage', fromJS(""));
74
54
  case types.EDIT_VIBER_TEMPLATE_SUCCESS:
75
55
  return state.set('editTemplateInProgress', false)
76
56
  .set('editResponse', action.data)
@@ -95,10 +75,7 @@ function viberReducer(state = initialState, action) {
95
75
  return state
96
76
  .delete('uploadedAssetData')
97
77
  .delete('metaEntities')
98
- .delete('templateDetails')
99
- .set('assetProcessing', fromJS({}))
100
- .set('assetUploading', false)
101
- .set('uploadAssetSuccess', false);
78
+ .delete('templateDetails');
102
79
  default:
103
80
  return state;
104
81
  }
@@ -2,58 +2,17 @@ import {
2
2
  call, put, takeLatest, all,
3
3
  } from 'redux-saga/effects';
4
4
  import * as Api from '../../services/api';
5
- import { pollAssetStatus } from '../../sagas/assetPolling';
6
- import { createPollingConfig } from '../../utils/asyncAssetUpload';
7
- import { ASSET_STATUS } from '../../utils/assetStatusConstants';
8
5
  import * as types from './constants';
9
6
 
10
- export function* uploadViberAsset(params) {
7
+ export function* uploadViberAsset(file, assetType, fileParams ) {
11
8
  try {
12
- const result = yield call(Api.uploadFile, params);
13
- const responseData = result.response || {};
14
- const statusCode = result?.status?.code || result?.statusCode || 200;
15
-
16
- if (statusCode === 202 || responseData?.processingStatus === ASSET_STATUS.PROCESSING) {
17
- const assetId = responseData.assetId || responseData.asset?._id;
18
- const { templateType } = params;
19
- const assetType = params.assetType || responseData.asset?.type?.toLowerCase() || 'image';
20
-
21
- if (assetId) {
22
- yield put({
23
- type: types.UPLOAD_VIBER_ASSET_PROCESSING,
24
- payload: {
25
- assetId,
26
- asset: responseData.asset,
27
- processingStatus: ASSET_STATUS.PROCESSING,
28
- },
29
- });
30
-
31
- const actionTypes = {
32
- COMPLETED: types.UPLOAD_VIBER_ASSET_COMPLETED,
33
- FAILED: types.UPLOAD_VIBER_ASSET_FAILED,
34
- TIMEOUT: types.UPLOAD_VIBER_ASSET_TIMEOUT,
35
- };
36
- const pollingConfig = createPollingConfig(assetType, assetId, actionTypes, templateType);
37
- yield call(pollAssetStatus, pollingConfig);
38
- } else {
39
- const errorMessage = 'Asset upload initiated but no asset ID was returned from the server. Unable to track processing status.';
40
- yield put({
41
- type: types.UPLOAD_VIBER_ASSET_FAILED,
42
- payload: {
43
- assetId: undefined,
44
- error: errorMessage,
45
- },
46
- templateType,
47
- });
48
- }
49
- } else {
50
- yield put({
51
- type: types.UPLOAD_VIBER_ASSET_SUCCESS,
52
- data: responseData.asset,
53
- statusCode,
54
- templateType: params.templateType,
55
- });
56
- }
9
+ const result = yield call(Api.uploadFile, file, assetType, fileParams);
10
+ yield put({
11
+ type: types.UPLOAD_VIBER_ASSET_SUCCESS,
12
+ data: result.response.asset,
13
+ statusCode: result.status ? result.status.code : '',
14
+ templateType: file.templateType,
15
+ });
57
16
  } catch (error) {
58
17
  yield put({ type: types.UPLOAD_VIBER_ASSET_FAILURE, error });
59
18
  }
@@ -67,12 +26,7 @@ export function* createViberTemplate({ template, callback }) {
67
26
  errorMsg = result.message;
68
27
  throw errorMsg;
69
28
  }
70
- yield put({
71
- type: types.CREATE_VIBER_TEMPLATE_SUCCESS,
72
- data: result.response,
73
- statusCode: result.status ? result.status.code : '',
74
- errorMsg,
75
- });
29
+ yield put({ type: types.CREATE_VIBER_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg });
76
30
  if (callback) {
77
31
  callback(result.response);
78
32
  }
@@ -96,12 +50,7 @@ export function* editTemplate({ template, callback }) {
96
50
  if (callback) {
97
51
  callback(result.response);
98
52
  }
99
- yield put({
100
- type: types.EDIT_VIBER_TEMPLATE_SUCCESS,
101
- data: result.response,
102
- statusCode: result.status ? result.status.code : '',
103
- errorMsg,
104
- });
53
+ yield put({ type: types.EDIT_VIBER_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg });
105
54
  } catch (error) {
106
55
  yield put({ type: types.EDIT_VIBER_TEMPLATE_FAILURE, error, errorMsg });
107
56
  if (callback) {
@@ -112,6 +61,7 @@ export function* editTemplate({ template, callback }) {
112
61
 
113
62
  export function* getTemplateDetails({id, callback}) {
114
63
  try {
64
+
115
65
  const result = yield call(Api.getTemplateDetails, {id, channel: 'VIBER'});
116
66
  yield put({ type: types.GET_VIBER_TEMPLATE_DETAILS_SUCCESS, data: result.response });
117
67
  if (callback) {
@@ -125,19 +75,28 @@ export function* getTemplateDetails({id, callback}) {
125
75
 
126
76
  function* watchUploadViberAsset() {
127
77
  yield takeLatest(types.UPLOAD_VIBER_ASSET_REQUEST, uploadViberAsset);
78
+
79
+
128
80
  }
129
81
 
130
82
 
131
83
  function* watchCreateTemplate() {
84
+
132
85
  yield takeLatest(types.CREATE_VIBER_TEMPLATE_REQUEST, createViberTemplate);
86
+
87
+
133
88
  }
134
89
 
135
90
  function* watchGetTemplateDetails() {
136
91
  yield takeLatest(types.GET_VIBER_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
92
+
93
+
137
94
  }
138
95
 
139
96
  function* watchEditTemplate() {
140
97
  yield takeLatest(types.EDIT_VIBER_TEMPLATE_REQUEST, editTemplate);
98
+
99
+
141
100
  }
142
101
 
143
102
  export default [
@@ -154,4 +113,4 @@ export function* v2ViberSagas() {
154
113
  watchGetTemplateDetails(),
155
114
  watchEditTemplate(),
156
115
  ]);
157
- }
116
+ }