@capillarytech/creatives-library 8.0.345-alpha.15 → 8.0.345-alpha.16

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 (130) hide show
  1. package/constants/unified.js +0 -29
  2. package/package.json +1 -1
  3. package/services/tests/api.test.js +0 -13
  4. package/utils/commonUtils.js +1 -19
  5. package/v2Components/CapActionButton/constants.js +0 -7
  6. package/v2Components/CapActionButton/index.js +109 -167
  7. package/v2Components/CapActionButton/index.scss +6 -157
  8. package/v2Components/CapActionButton/messages.js +3 -19
  9. package/v2Components/CapActionButton/tests/index.test.js +17 -41
  10. package/v2Components/CapTagList/index.js +0 -10
  11. package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +49 -70
  12. package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +2 -8
  13. package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +21 -207
  14. package/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +0 -16
  15. package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +10 -85
  16. package/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +0 -30
  17. package/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +11 -79
  18. package/v2Components/CommonTestAndPreview/SendTestMessage.js +5 -10
  19. package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +15 -160
  20. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +76 -341
  21. package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +4 -133
  22. package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +0 -11
  23. package/v2Components/CommonTestAndPreview/constants.js +2 -38
  24. package/v2Components/CommonTestAndPreview/index.js +186 -676
  25. package/v2Components/CommonTestAndPreview/messages.js +3 -49
  26. package/v2Components/CommonTestAndPreview/sagas.js +6 -15
  27. package/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +284 -308
  28. package/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +65 -231
  29. package/v2Components/CommonTestAndPreview/tests/DeliverySettings/index.test.js +5 -118
  30. package/v2Components/CommonTestAndPreview/tests/DeliverySettings/utils/parseSenderDetailsResponse.test.js +0 -341
  31. package/v2Components/CommonTestAndPreview/tests/PreviewSection.test.js +1 -8
  32. package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +13 -34
  33. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/RcsPreviewContent.test.js +283 -281
  34. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +1 -199
  35. package/v2Components/CommonTestAndPreview/tests/index.test.js +4 -132
  36. package/v2Components/CommonTestAndPreview/tests/sagas.test.js +2 -2
  37. package/v2Components/FormBuilder/index.js +10 -8
  38. package/v2Components/TemplatePreview/_templatePreview.scss +23 -33
  39. package/v2Components/TemplatePreview/index.js +28 -143
  40. package/v2Components/TemplatePreview/tests/index.test.js +0 -142
  41. package/v2Components/TestAndPreviewSlidebox/index.js +1 -13
  42. package/v2Components/TestAndPreviewSlidebox/sagas.js +4 -11
  43. package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +1 -3
  44. package/v2Containers/CreativesContainer/SlideBoxContent.js +4 -36
  45. package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -10
  46. package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -29
  47. package/v2Containers/CreativesContainer/constants.js +0 -9
  48. package/v2Containers/CreativesContainer/index.js +103 -300
  49. package/v2Containers/CreativesContainer/index.scss +1 -51
  50. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +34 -78
  51. package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +16 -79
  52. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +0 -8
  53. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +98 -357
  54. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +15 -20
  55. package/v2Containers/CreativesContainer/tests/index.test.js +9 -71
  56. package/v2Containers/Email/reducer.js +12 -3
  57. package/v2Containers/Email/sagas.js +9 -4
  58. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +4 -0
  59. package/v2Containers/Email/tests/reducer.test.js +47 -0
  60. package/v2Containers/Email/tests/sagas.test.js +146 -6
  61. package/v2Containers/Rcs/constants.js +8 -119
  62. package/v2Containers/Rcs/index.js +811 -2383
  63. package/v2Containers/Rcs/index.scss +6 -276
  64. package/v2Containers/Rcs/messages.js +3 -38
  65. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +70073 -98018
  66. package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +5 -0
  67. package/v2Containers/Rcs/tests/index.test.js +121 -152
  68. package/v2Containers/Rcs/tests/mockData.js +0 -38
  69. package/v2Containers/Rcs/tests/utils.test.js +30 -646
  70. package/v2Containers/Rcs/utils.js +11 -478
  71. package/v2Containers/Sms/Create/index.js +40 -100
  72. package/v2Containers/SmsTrai/Create/index.js +4 -9
  73. package/v2Containers/SmsTrai/Edit/constants.js +0 -2
  74. package/v2Containers/SmsTrai/Edit/index.js +130 -636
  75. package/v2Containers/SmsTrai/Edit/messages.js +4 -14
  76. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +2296 -4249
  77. package/v2Containers/SmsWrapper/index.js +8 -37
  78. package/v2Containers/TagList/index.js +0 -6
  79. package/v2Containers/Templates/_templates.scss +2 -163
  80. package/v2Containers/Templates/actions.js +0 -11
  81. package/v2Containers/Templates/constants.js +0 -2
  82. package/v2Containers/Templates/index.js +54 -119
  83. package/v2Containers/Templates/sagas.js +12 -57
  84. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1079 -1043
  85. package/v2Containers/Templates/tests/sagas.test.js +123 -193
  86. package/v2Containers/TemplatesV2/TemplatesV2.style.js +1 -72
  87. package/v2Containers/TemplatesV2/index.js +23 -86
  88. package/v2Containers/Whatsapp/index.js +20 -3
  89. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34 -578
  90. package/utils/rcsPayloadUtils.js +0 -92
  91. package/utils/templateVarUtils.js +0 -201
  92. package/utils/tests/templateVarUtils.test.js +0 -204
  93. package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js.rej +0 -18
  94. package/v2Components/CommonTestAndPreview/previewApiUtils.js +0 -59
  95. package/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +0 -67
  96. package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +0 -87
  97. package/v2Components/SmsFallback/constants.js +0 -73
  98. package/v2Components/SmsFallback/index.js +0 -955
  99. package/v2Components/SmsFallback/index.scss +0 -265
  100. package/v2Components/SmsFallback/messages.js +0 -78
  101. package/v2Components/SmsFallback/smsFallbackUtils.js +0 -118
  102. package/v2Components/SmsFallback/tests/SmsFallbackLocalSelector.test.js +0 -50
  103. package/v2Components/SmsFallback/tests/rcsSmsFallback.acceptance.test.js +0 -147
  104. package/v2Components/SmsFallback/tests/smsFallbackHandlers.test.js +0 -304
  105. package/v2Components/SmsFallback/tests/smsFallbackUi.test.js +0 -197
  106. package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +0 -277
  107. package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +0 -422
  108. package/v2Components/SmsFallback/useLocalTemplateList.js +0 -92
  109. package/v2Components/TemplatePreview/constants.js +0 -2
  110. package/v2Components/VarSegmentMessageEditor/constants.js +0 -2
  111. package/v2Components/VarSegmentMessageEditor/index.js +0 -125
  112. package/v2Components/VarSegmentMessageEditor/index.scss +0 -46
  113. package/v2Containers/CreativesContainer/CreativesSlideBoxWrapper.js +0 -43
  114. package/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +0 -67
  115. package/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +0 -90
  116. package/v2Containers/CreativesContainer/tests/embeddedSlideboxUtils.test.js +0 -258
  117. package/v2Containers/CreativesContainer/tests/useLocalTemplatesProp.test.js +0 -125
  118. package/v2Containers/Rcs/index.js.rej +0 -1336
  119. package/v2Containers/Rcs/index.scss.rej +0 -74
  120. package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +0 -225
  121. package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap.rej +0 -128
  122. package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +0 -318
  123. package/v2Containers/Sms/smsFormDataHelpers.js +0 -67
  124. package/v2Containers/Sms/tests/smsFormDataHelpers.test.js +0 -253
  125. package/v2Containers/SmsTrai/Edit/index.scss +0 -121
  126. package/v2Containers/Templates/TemplatesActionBar.js +0 -101
  127. package/v2Containers/Templates/tests/TemplatesActionBar.test.js +0 -120
  128. package/v2Containers/Templates/tests/smsTemplatesListApi.test.js +0 -180
  129. package/v2Containers/Templates/utils/smsTemplatesListApi.js +0 -79
  130. package/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +0 -131
@@ -10,14 +10,12 @@ import { isTraiDLTEnable } from '../../utils/common';
10
10
  import SmsEdit from '../Sms/Edit';
11
11
  import SmsTraiCreate from '../SmsTrai/Create';
12
12
  import SmsTraiEdit from '../SmsTrai/Edit';
13
-
14
13
  const SmsWrapper = (props) => {
15
14
  const {
16
15
  isCreateSms,
17
16
  isEditSms,
18
17
  setIsLoadingContent,
19
18
  location,
20
- route: routeFromProps,
21
19
  isGetFormData,
22
20
  getFormSubscriptionData,
23
21
  isFullMode,
@@ -40,33 +38,15 @@ const SmsWrapper = (props) => {
40
38
  handleCloseTestAndPreview,
41
39
  isTestAndPreviewMode,
42
40
  onValidationFail,
43
- embeddedSmsFallback = false,
44
- onEmbeddedSmsFooterValidity,
45
- forceFullTagContext = false,
46
41
  } = props;
47
42
 
48
- /** FormBuilder / SMS Create assume `location.query`; connected-router shapes may omit it. */
49
- const smsLocation = (() => {
50
- const loc = location || {};
51
- const q = loc.query;
52
- if (q && typeof q === 'object') {
53
- return { ...loc, query: { ...q } };
54
- }
55
- return {
56
- pathname: loc.pathname || '/sms/create',
57
- search: loc.search || '',
58
- query: { type: 'embedded', module: 'library' },
59
- };
60
- })();
61
-
62
43
  const smsProps = {
63
44
  onCreateComplete,
64
45
  setIsLoadingContent,
65
- location: smsLocation,
66
- route: routeFromProps || { name: 'sms' },
46
+ location,
47
+ route: { name: 'sms' },
67
48
  isGetFormData,
68
49
  getFormSubscriptionData,
69
- templateData,
70
50
  getDefaultTags,
71
51
  isFullMode,
72
52
  forwardedTags,
@@ -82,33 +62,24 @@ const SmsWrapper = (props) => {
82
62
  handleCloseTestAndPreview,
83
63
  isTestAndPreviewMode,
84
64
  onValidationFail,
85
- forceFullTagContext,
86
- embeddedSmsFallback,
87
- onEmbeddedSmsFooterValidity,
88
- ...(embeddedSmsFallback
89
- ? {
90
- tagListGetPopupContainer: () => document.body,
91
- tagListPopoverOverlayStyle: { zIndex: 10020 },
92
- tagListPopoverOverlayClassName: 'sms-fallback-taglist-popover rcs-sms-fallback-taglist-popover',
93
- }
94
- : {}),
95
65
  };
96
- const useTraiSmsFlow = isTraiDLTEnable(isFullMode, smsRegister);
66
+ const isTraiDlt = isTraiDLTEnable(isFullMode, smsRegister);
97
67
  return <>
98
68
  {
99
- isCreateSms && (useTraiSmsFlow ?
69
+ isCreateSms && (isTraiDlt ?
100
70
  <SmsTraiCreate
101
71
  isComponent
102
72
  {...smsProps}
103
73
  onShowTemplates={onShowTemplates}
104
74
  /> :
105
75
  <SmsCreate
106
- isComponent
107
- {...smsProps}
76
+ isComponent {
77
+ ...smsProps
78
+ }
108
79
  />
109
80
  )
110
81
  }
111
- {isEditSms && (useTraiSmsFlow ?
82
+ {isEditSms && (isTraiDlt ?
112
83
  <SmsTraiEdit
113
84
  {...smsProps}
114
85
  params={{id: templateData._id}}
@@ -477,9 +477,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
477
477
  disableTooltipMsg={tooltipMsg}
478
478
  fetchingSchemaError={this?.state?.tagsError}
479
479
  popoverPlacement={this.props.popoverPlacement}
480
- overlayStyle={this.props.popoverOverlayStyle}
481
- overlayClassName={this.props.popoverOverlayClassName}
482
- getPopupContainer={this.props.getPopupContainer}
483
480
  />
484
481
  </div>
485
482
  );
@@ -516,9 +513,6 @@ TagList.propTypes = {
516
513
  // message to show when Add Label button is disabled (e.g. personalization restriction)
517
514
  disableTooltipMsg: PropTypes.string,
518
515
  restrictPersonalization: PropTypes.bool,
519
- popoverOverlayStyle: PropTypes.object,
520
- popoverOverlayClassName: PropTypes.string,
521
- getPopupContainer: PropTypes.func,
522
516
  intl: PropTypes.shape({
523
517
  formatMessage: PropTypes.func.isRequired,
524
518
  locale: PropTypes.string,
@@ -2,13 +2,10 @@
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 {
7
5
  .ant-tabs-tabpane-active{
8
6
  padding: unset;
9
7
  }
10
8
  }
11
- }
12
9
 
13
10
  @media screen and (max-width: 1172px) {
14
11
  .creatives-templates-list.full-mode{
@@ -23,11 +20,8 @@
23
20
  }
24
21
  }
25
22
  }
26
- // }
27
23
 
28
24
  @media screen and (min-width: 1172px) {
29
- .creatives-templates-list.full-mode{
30
- .v2-pagination-container, .v2-pagination-container-half {
31
25
  .creatives-templates-list.full-mode{
32
26
  .v2-pagination-container {
33
27
  .cap-custom-card-list-row {
@@ -39,21 +33,16 @@
39
33
  }
40
34
  }
41
35
  }
42
- }
43
- }
44
36
  }
45
37
 
46
-
47
38
  .creatives-templates-list {
48
39
 
49
40
  .delete-template-confirm {
50
41
  .ant-modal-footer {
51
42
  padding: $CAP_SPACE_16 $CAP_SPACE_24 $CAP_SPACE_24 $CAP_SPACE_24;
52
43
  }
53
- }
54
44
 
55
45
  .ant-modal-header {
56
- .v2-pagination-container, .v2-pagination-container-half {
57
46
  padding: $CAP_SPACE_24 $CAP_SPACE_24 $CAP_SPACE_08 $CAP_SPACE_24;
58
47
  }
59
48
 
@@ -192,13 +181,10 @@
192
181
  .whatsapp-container {
193
182
  background-color: $CAP_WHITE;
194
183
  padding: $CAP_SPACE_12;
195
- overflow-y: hidden;
196
184
  }
197
185
  .scroll-container {
198
186
  overflow-x: auto;
199
187
  display: flex;
200
- flex-wrap: nowrap;
201
- width: 100%;
202
188
  padding-top: $CAP_SPACE_06;
203
189
  padding-right: $CAP_SPACE_06;
204
190
  white-space: nowrap;
@@ -232,92 +218,6 @@
232
218
  }
233
219
  }
234
220
 
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
- overflow-y: hidden;
254
- display: flex;
255
- flex-wrap: nowrap;
256
- padding-top: $CAP_SPACE_06;
257
- padding-right: $CAP_SPACE_06;
258
- white-space: nowrap;
259
- scrollbar-width: none; // Hide scrollbar in Firefox
260
- &::-webkit-scrollbar {
261
- display: none; // Hide scrollbar in Chrome/Safari/Opera
262
- }
263
- .whatsapp-carousel-container {
264
- padding: $CAP_SPACE_04 0px $CAP_SPACE_08;
265
- border-radius: $CAP_SPACE_06;
266
- background-color: $CAP_WHITE;
267
- width: 80%;
268
- flex-shrink: 0;
269
- margin-right: $CAP_SPACE_04;
270
- white-space: pre-wrap;
271
- word-break: break-word;
272
- overflow: auto;
273
- text-align: left;
274
- .whatsapp-carousel-card {
275
- margin: $CAP_SPACE_02 $CAP_SPACE_06 $CAP_SPACE_01 $CAP_SPACE_08;
276
- .whatsapp-carousel-body {
277
- margin-bottom: $CAP_SPACE_08;
278
- white-space: pre-wrap;
279
- }
280
- }
281
- }
282
- }
283
-
284
- // RCS CTA buttons in listing (reuse WhatsApp-ish look)
285
- .rcs-cta-preview {
286
- margin: $CAP_SPACE_12 0;
287
- display: flex;
288
- justify-content: center;
289
- font-size: $FONT_SIZE_M;
290
- align-items: center;
291
- color: #1970DA;
292
- svg {
293
- margin-right: $CAP_SPACE_04;
294
- }
295
- }
296
-
297
- .rcs-video-preview-placeholder {
298
- background: #f5f5f5;
299
- display: flex;
300
- align-items: center;
301
- justify-content: center;
302
- }
303
-
304
- .rcs-video-preview-label {
305
- color: #7a7a7a;
306
- }
307
-
308
- .rcs-listing-title {
309
- font-weight: 600;
310
- }
311
-
312
- .whatsapp-divider {
313
- margin: 0;
314
- }
315
- }
316
- }
317
- }
318
- }
319
- }
320
-
321
221
  .MOBILEPUSH {
322
222
  .ant-card-body {
323
223
  padding: 0;
@@ -759,29 +659,11 @@
759
659
  }
760
660
 
761
661
  .action-container{
762
- margin-top: $CAP_SPACE_08;
763
- margin-bottom: $CAP_SPACE_16;
662
+ margin-top: 8px;
663
+ margin-bottom: 16px;
764
664
  display: flex;
765
665
  justify-content: space-between;
766
666
  align-items: center;
767
-
768
- &__toolbar-row {
769
- display: flex;
770
- align-items: center;
771
- gap: 0.75rem;
772
- }
773
-
774
- &__toolbar-row .search-text {
775
- width: 13.125rem;
776
- min-width: 13.125rem;
777
- flex: 1;
778
- }
779
-
780
- &__create-row {
781
- display: flex;
782
- justify-content: space-between;
783
- align-items: center;
784
- }
785
667
  }
786
668
 
787
669
  .popover-action-container:hover{
@@ -1219,47 +1101,4 @@
1219
1101
  .inapp-illustration-parent {
1220
1102
  height: "calc(100vh - 325px)";
1221
1103
  overflow: 'auto';
1222
- }
1223
-
1224
- /* Local SMS / slidebox: viewport-based .v2-pagination-container-half height leaves empty space below and clips cards */
1225
- .creatives-templates-container--local-sms.library-mode {
1226
- .creatives-templates-list.library-mode > .cap-row:first-of-type > div {
1227
- display: flex;
1228
- flex-direction: column;
1229
- flex: 1 1 auto;
1230
- min-height: 0;
1231
- overflow: hidden;
1232
- }
1233
-
1234
- .creatives-templates-list.library-mode > .cap-row:first-of-type > div > div:first-child {
1235
- display: flex;
1236
- flex-direction: column;
1237
- flex: 1 1 auto;
1238
- min-height: 0;
1239
- overflow: hidden;
1240
- }
1241
-
1242
- /* Block below search/filter: grid + skeletons — must grow to use space above footer */
1243
- .creatives-templates-list.library-mode > .cap-row:first-of-type > div > div:first-child > div:nth-child(2) {
1244
- flex: 1 1 auto;
1245
- min-height: 0;
1246
- display: flex;
1247
- flex-direction: column;
1248
- overflow: hidden;
1249
- }
1250
-
1251
- /*
1252
- * Scroll needs a definite height. Pure flex + height:auto + max-height:100% often won’t bound (no % base), so no scrollbar.
1253
- * Use a taller slice than global 100vh-20rem so the grid uses space under search; still overflow-y:auto for long lists.
1254
- */
1255
- .v2-pagination-container,
1256
- .v2-pagination-container-half {
1257
- flex: 0 1 auto;
1258
- min-height: 0;
1259
- height: calc(100vh - 12rem);
1260
- max-height: calc(100vh - 12rem);
1261
- overflow-y: auto;
1262
- overflow-x: hidden;
1263
- -webkit-overflow-scrolling: touch;
1264
- }
1265
1104
  }
@@ -15,17 +15,6 @@ export function getAllTemplates(channel, queryParams, intlCopyOf = '') {
15
15
  };
16
16
  }
17
17
 
18
-
19
- export function getLocalSmsTemplates(queryParams, intlCopyOf = '', onSuccess, onFailure) {
20
- return {
21
- type: types.GET_LOCAL_SMS_TEMPLATES_REQUEST,
22
- queryParams,
23
- intlCopyOf,
24
- onSuccess,
25
- onFailure,
26
- };
27
- }
28
-
29
18
  export function resetTemplate() {
30
19
  return {
31
20
  type: types.RESET_TEMPLATE,
@@ -10,8 +10,6 @@ export const GET_ALL_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_ALL_TEM
10
10
  export const GET_ALL_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_SUCCESS';
11
11
  export const GET_ALL_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_FAILURE';
12
12
 
13
- export const GET_LOCAL_SMS_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_LOCAL_SMS_TEMPLATES_REQUEST';
14
-
15
13
  export const DELETE_TEMPLATE_REQUEST = 'app/v2Containers/Templates/DELETE_TEMPLATE_REQUEST';
16
14
  export const DELETE_RCS_TEMPLATE_REQUEST = 'app/v2Containers/Templates/DELETE_RCS_TEMPLATE_REQUEST';
17
15
  export const DELETE_TEMPLATE_SUCCESS = 'app/v2Containers/Templates/DELETE_TEMPLATE_SUCCESS';
@@ -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, HOST_INFOBIP } from '../Rcs/constants';
135
+ import {RCS_STATUSES} from '../Rcs/constants';
136
136
  import zaloMessages from '../Zalo/messages';
137
137
  import rcsMessages from '../Rcs/messages';
138
138
  import inAppMessages from '../InApp/messages';
@@ -468,13 +468,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
468
468
  if (this.props.location.query.type === 'embedded') {
469
469
  this.props.actions.resetAccount();
470
470
  }
471
- // When using local templates (e.g. SMS fallback selector), do not fetch from API or we overwrite global store and break background RCS list
472
- const useLocalTemplates = get(
473
- this.props,
474
- 'localTemplatesConfig.useLocalTemplates',
475
- get(this.props, 'useLocalTemplates', false),
476
- );
477
- if (!useLocalTemplates && ['line', VIBER_CHANNEL, FACEBOOK_CHANNEL, 'sms', 'email', 'ebill'].includes((this.state.channel || '').toLowerCase())) {
471
+ if (['line', VIBER_CHANNEL, FACEBOOK_CHANNEL, 'sms', 'email', 'ebill'].includes((this.state.channel || '').toLowerCase())) {
478
472
  const queryParams = {
479
473
  // name: this.state.searchText,
480
474
  // sortBy: this.state.sortBy,
@@ -987,16 +981,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
987
981
 
988
982
  componentWillUnmount() {
989
983
  window.removeEventListener("message", this.handleFrameTasks);
990
- // When using local templates (e.g. SMS fallback selector), do not clear global store or background RCS list is wiped
991
- const useLocalTemplates = get(
992
- this.props,
993
- 'localTemplatesConfig.useLocalTemplates',
994
- get(this.props, 'useLocalTemplates', false),
995
- );
996
- if (!useLocalTemplates) {
997
- this.props.actions.resetTemplateStoreData();
998
- this.props.globalActions.clearMetaEntities();
999
- }
984
+ this.props.actions.resetTemplateStoreData();
985
+ this.props.globalActions.clearMetaEntities();
1000
986
  // Clear any pending timeouts to prevent memory leaks
1001
987
  if (this._clearEditTimeout) {
1002
988
  clearTimeout(this._clearEditTimeout);
@@ -1781,20 +1767,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1781
1767
  }
1782
1768
 
1783
1769
  filterRcsTemplates = (templates) => {
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
- );
1770
+ let { selectedRcsStatus } = this.state;
1771
+ selectedRcsStatus = !this.props.isFullMode ? RCS_STATUSES.approved : '';
1772
+ if (selectedRcsStatus) {
1773
+ return templates?.filter((template) => template?.versions?.base?.content?.RCS?.rcsContent?.cardContent?.[0]?.Status === selectedRcsStatus);
1791
1774
  }
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;
1775
+ return templates;
1798
1776
  }
1799
1777
 
1800
1778
  filterZaloTemplates = (templates) => {
@@ -1969,7 +1947,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1969
1947
  style={{ marginRight: "16px" }}
1970
1948
  type="eye"
1971
1949
  onClick={() => {
1972
- if (!this.props.isFullMode || this.props.isDltFromRcs || this.props.isSmsFallbackFromRcs) {
1950
+ if (!this.props.isFullMode || this.props.isDltFromRcs) {
1973
1951
  if (!get(template, "versions.base.content.zalo.previewUrl", "")) {
1974
1952
  this.setState({ zaloPreviewItemId: template?._id });
1975
1953
  }
@@ -2429,14 +2407,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2429
2407
  templateData.title = (
2430
2408
  <CapRow>
2431
2409
  <CapLabel className="whatsapp-rcs-template-name">{name}</CapLabel>
2432
- {this.state.hostName !== HOST_INFOBIP && <CapRow type="flex" align="middle" className="rcs-status-container zalo-status-color">
2410
+ <CapRow type="flex" align="middle" className="rcs-status-container zalo-status-color">
2433
2411
  <CapStatus
2434
2412
  type={statusDisplay}
2435
- text={statusDisplay && this.props.intl.formatMessage(rcsMessages?.[`${statusDisplay}_STATUS`])}
2436
- labelType="label3"
2437
- />
2438
- </CapRow>
2439
- }
2413
+ text={statusDisplay && this.props.intl.formatMessage(rcsMessages?.[`${statusDisplay}_STATUS`])}
2414
+ labelType="label3"
2415
+ />
2416
+ </CapRow>
2440
2417
  </CapRow>
2441
2418
  );
2442
2419
 
@@ -2960,7 +2937,6 @@ return (<div>
2960
2937
  let routeParams = {};
2961
2938
  const {fbAdManager} = this.props;
2962
2939
  const isLibraryMode = this.isEnabledInLibraryModule("callCreateFromProps");
2963
-
2964
2940
  if (!isLibraryMode) {
2965
2941
  timeTracker.startTimer(CHANNEL_CREATE_TRACK_MAPPING[channel]);
2966
2942
  }
@@ -3306,13 +3282,6 @@ return (<div>
3306
3282
  this.setState({modeType});
3307
3283
  }
3308
3284
  const { _id: id } = template;
3309
- const {
3310
- localTemplatesConfig,
3311
- fbAdManager,
3312
- isDltFromRcs,
3313
- isSmsFallbackFromRcs,
3314
- onSelectTemplate,
3315
- } = this.props;
3316
3285
  const type = this.props.location.query.type;
3317
3286
  const module = this.props.location.query.module;
3318
3287
  const isLanguageSupport = (this.props.location.query.isLanguageSupport) ? this.props.location.query.isLanguageSupport : false;
@@ -3398,12 +3367,10 @@ return (<div>
3398
3367
  }
3399
3368
  if (this.isEnabledInLibraryModule("callSelectFromProps")) {
3400
3369
  let data = id;
3401
- if (localTemplatesConfig?.useLocalTemplates) {
3402
- data = template;
3403
- } else if (fbAdManager || isDltFromRcs || isSmsFallbackFromRcs) {
3370
+ if (this.props.fbAdManager || this.props.isDltFromRcs) {
3404
3371
  data = this.selectTemplate(id);
3405
3372
  }
3406
- onSelectTemplate(data, fbAdManager);
3373
+ this.props.onSelectTemplate(data, this.props.fbAdManager);
3407
3374
  } else {
3408
3375
  timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
3409
3376
  if (this.state.channel.toLowerCase() === 'ebill') {
@@ -4219,14 +4186,9 @@ return (<div>
4219
4186
  const isWechatEmbedded = !this.props.isFullMode && channel.toUpperCase() === WECHAT;
4220
4187
  const channelLowerCase = (channel || '').toLowerCase();
4221
4188
  const isTraiDltFeature = this.checkDLTfeatureEnable();
4189
+
4222
4190
  const createButton =
4223
- (
4224
- (
4225
- channelLowerCase === WHATSAPP_LOWERCASE
4226
- || channelLowerCase === RCS_LOWERCASE
4227
- )
4228
- && !this.props.isFullMode
4229
- )
4191
+ ( (channelLowerCase === WHATSAPP_LOWERCASE || channelLowerCase === RCS_LOWERCASE) && !this.props.isFullMode )
4230
4192
  ? (
4231
4193
  <CapLink
4232
4194
  onClick={this.openCreativesFullMode}
@@ -4252,23 +4214,17 @@ return (<div>
4252
4214
  if (([WHATSAPP_LOWERCASE, ZALO_LOWERCASE, RCS_LOWERCASE].includes(this.state?.channel?.toLocaleLowerCase()) && isEmpty(this.state?.hostName))) {
4253
4215
  isfilterContentVisisble = false;
4254
4216
  }
4255
-
4256
- const useLocalTemplates = this.props.localTemplatesConfig?.useLocalTemplates;
4257
- const builtFilterContent = ((isfilterContentVisisble || [WECHAT, MOBILE_PUSH, INAPP].includes(this.state.channel.toUpperCase())) && (
4258
- <div className="action-container">
4259
- <div className="action-container__toolbar-row">
4260
- {isfilterContentVisisble ? (
4261
- <CapInput.Search
4262
- className="search-text"
4263
- placeholder={this.props.intl.formatMessage(messages.searchText)}
4264
- value={this.state.searchText}
4265
- onChange={(e) => this.searchTemplate(e.target.value, this.state.channel)}
4266
- onSearch={() => this.searchTemplate(this.state.searchText, this.state.channel)}
4267
- onClear={() => this.searchTemplate('', this.state.channel)}
4268
- onScroll={(e) => e.stopPropagation()}
4269
- disabled={this.checkSearchDisabled()}
4270
- />
4271
- ) : null}
4217
+ const filterContent = (( isfilterContentVisisble || [WECHAT, MOBILE_PUSH, INAPP].includes(this.state.channel.toUpperCase())) && <div className="action-container">
4218
+ {isfilterContentVisisble && <CapInput.Search
4219
+ className="search-text"
4220
+ style={{width: '210px'}}
4221
+ placeholder={this.props.intl.formatMessage(messages.searchText)}
4222
+ value={this.state.searchText}
4223
+ onChange={(e) => this.searchTemplate(e.target.value, this.state.channel)}
4224
+ disabled={this.checkSearchDisabled()}
4225
+ onClear={() => this.searchTemplate('', this.state.channel)}
4226
+ onScroll={(e) => e.stopPropagation()}
4227
+ />}
4272
4228
  {
4273
4229
  channel.toUpperCase() === WECHAT && <CapRadio.CapRadioGroup className="wechat-filters" defaultValue={wechatFilter} onChange={this.setWechatFilter}>
4274
4230
  <CapRadio.Button value={WECHAT_FILTERS.ALL}><CapLabel type="label2">
@@ -4414,27 +4370,20 @@ return (<div>
4414
4370
  </div>
4415
4371
  )
4416
4372
  }
4417
- </div>
4418
- <div>
4419
- <div className="action-container__create-row">
4420
- {
4421
- this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE && (isWhatsappCountExeeded) ? (
4422
- <CapTooltip title={whatsappCountExceedText}>
4423
- <div className="button-disabled-tooltip-wrapper">
4424
- {createButton}
4425
- </div>
4426
- </CapTooltip>
4427
- )
4428
- : isfilterContentVisisble && !isWechatEmbedded && !this.props.isDltFromRcs && !this.props.isSmsFallbackFromRcs && createButton
4429
- }
4430
- </div>
4431
- </div>
4373
+ <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
4374
+ {
4375
+ this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE && (isWhatsappCountExeeded)? (
4376
+ <CapTooltip title={whatsappCountExceedText}>
4377
+ <div className="button-disabled-tooltip-wrapper">
4378
+ {createButton}
4379
+ </div>
4380
+ </CapTooltip>
4381
+ )
4382
+ : isfilterContentVisisble && !isWechatEmbedded && !this.props.isDltFromRcs && createButton
4383
+ }
4432
4384
  </div>
4433
- ));
4434
- const localTemplatesFilterContent = get(this.props, 'localTemplatesConfig.localTemplatesFilterContent', null);
4435
- const filterContent = (useLocalTemplates && localTemplatesFilterContent) != null
4436
- ? localTemplatesFilterContent
4437
- : builtFilterContent;
4385
+
4386
+ </div>);
4438
4387
  let htmlPreviewContent = "";
4439
4388
  if (this.state.channel.toLowerCase() === 'ebill') {
4440
4389
  htmlPreviewContent = this.state.previewTemplate && this.state.previewTemplate.versions && this.state.previewTemplate.versions.base && this.state.previewTemplate.versions.base['ebill-editor'];
@@ -4444,10 +4393,7 @@ return (<div>
4444
4393
 
4445
4394
 
4446
4395
  const creativesParams = this.getCreativesParams();
4447
- const templates = useLocalTemplates
4448
- ? (this.props.localTemplatesConfig?.localTemplates || [])
4449
- : (this.props.TemplatesList || []);
4450
- const isLoadingWhenLocal = useLocalTemplates && !!this.props.localTemplatesConfig?.localTemplatesLoading;
4396
+ const templates = this.props.TemplatesList || [];
4451
4397
  const {route} = this.props;
4452
4398
  const loadingTipMap = {
4453
4399
  sendingFile: 'uploadingFile',
@@ -4462,11 +4408,9 @@ return (<div>
4462
4408
  (deleteRcsTemplateInProgress && 'deletingTemplate') ||
4463
4409
  (this.props.EmailCreate.duplicateTemplateInProgress && 'duplicatingTemplate');
4464
4410
 
4465
- const loadingTip = useLocalTemplates && this.props.localTemplatesConfig?.localTemplatesLoadingTip
4466
- ? this.props.localTemplatesConfig.localTemplatesLoadingTip
4467
- : (messages[loadingTipIntl] ? this.props.intl.formatMessage(messages[loadingTipIntl]) : this.props.intl.formatMessage(messages.gettingAllTemplates));
4411
+ const loadingTip = messages[loadingTipIntl] ? this.props.intl.formatMessage(messages[loadingTipIntl]) : this.props.intl.formatMessage(messages.gettingAllTemplates);
4468
4412
  const showNoTemplatesFoundZalo = this.state.channel.toUpperCase() === ZALO && isEmpty(this.state.searchedZaloTemplates) && this.state.searchingZaloTemplate;
4469
- const showNoTemplatesFoundOther = ![ZALO].includes(this.state.channel.toUpperCase()) && isEmpty(templates) && (useLocalTemplates ? !isLoadingWhenLocal : !this.props.Templates.getAllTemplatesInProgress) && (useLocalTemplates || !isEmpty(this.state.searchText));
4413
+ const showNoTemplatesFoundOther = ![ZALO].includes(this.state.channel.toUpperCase()) && isEmpty(this.props.TemplatesList) && !this.props.Templates.getAllTemplatesInProgress && !isEmpty(this.state.searchText);
4470
4414
  const showNoTemplatesFound = showNoTemplatesFoundZalo || showNoTemplatesFoundOther;
4471
4415
 
4472
4416
  return (
@@ -4498,7 +4442,7 @@ return (<div>
4498
4442
  />
4499
4443
  ) : null}
4500
4444
 
4501
- {channel.toLowerCase() === RCS_LOWERCASE && !isFullMode && this.state?.hostName !== HOST_INFOBIP ? (
4445
+ {channel.toLowerCase() === RCS_LOWERCASE && !isFullMode ? (
4502
4446
  <CapInfoNote
4503
4447
  message={formatMessage(messages.rcsOnlyApprovedTemplates)}
4504
4448
  />
@@ -4511,22 +4455,22 @@ return (<div>
4511
4455
  ) : null}
4512
4456
  <CapRow>
4513
4457
  <Pagination
4514
- templateInProgress={useLocalTemplates ? isLoadingWhenLocal : this.props.Templates.getAllTemplatesInProgress}
4458
+ templateInProgress={
4459
+ this.props.Templates.getAllTemplatesInProgress
4460
+ }
4515
4461
  onPageChange={
4516
- templates.length
4517
- ? (useLocalTemplates ? (this.props.localTemplatesConfig?.localTemplatesOnPageChange || (() => {})) : this.onPaginationChange)
4518
- : () => {}
4462
+ templates.length ? this.onPaginationChange : () => {}
4519
4463
  }
4520
4464
  >
4521
4465
  {this.getTemplateDataForGrid({
4522
4466
  previewTemplateId: this.state.zaloPreviewItemId,
4523
- isLoading: useLocalTemplates ? isLoadingWhenLocal : isLoading,
4524
- isInitialLoading: useLocalTemplates ? isLoadingWhenLocal && templates.length === 0 : isInitialLoading,
4467
+ isLoading,
4468
+ isInitialLoading,
4525
4469
  loadingTip,
4526
4470
  channel: this.state.channel,
4527
4471
  templates: this.state.searchingZaloTemplate
4528
4472
  ? this.state.searchedZaloTemplates
4529
- : templates,
4473
+ : this.props.TemplatesList,
4530
4474
  filterContent,
4531
4475
  handlers: {
4532
4476
  handlePreviewClick: this.handlePreviewClick,
@@ -4709,15 +4653,6 @@ Templates.propTypes = {
4709
4653
  WebPush: PropTypes.object,
4710
4654
  smsRegister: PropTypes.any,
4711
4655
  isDltFromRcs: PropTypes.bool,
4712
- isSmsFallbackFromRcs: PropTypes.bool,
4713
- localTemplatesConfig: PropTypes.shape({
4714
- useLocalTemplates: PropTypes.bool,
4715
- localTemplates: PropTypes.arrayOf(PropTypes.object),
4716
- localTemplatesLoading: PropTypes.bool,
4717
- localTemplatesLoadingTip: PropTypes.string,
4718
- localTemplatesFilterContent: PropTypes.node,
4719
- localTemplatesOnPageChange: PropTypes.func,
4720
- }),
4721
4656
  };
4722
4657
 
4723
4658
  const mapStateToProps = createStructuredSelector({