@capillarytech/creatives-library 8.0.345-alpha.12 → 8.0.345-alpha.14

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 (129) 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 +11 -3
  57. package/v2Containers/Email/sagas.js +9 -5
  58. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +4 -0
  59. package/v2Containers/Email/tests/sagas.test.js +21 -3
  60. package/v2Containers/Rcs/constants.js +8 -119
  61. package/v2Containers/Rcs/index.js +812 -2375
  62. package/v2Containers/Rcs/index.scss +6 -276
  63. package/v2Containers/Rcs/messages.js +3 -38
  64. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +70345 -98302
  65. package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +5 -0
  66. package/v2Containers/Rcs/tests/index.test.js +121 -152
  67. package/v2Containers/Rcs/tests/mockData.js +0 -38
  68. package/v2Containers/Rcs/tests/utils.test.js +30 -646
  69. package/v2Containers/Rcs/utils.js +11 -478
  70. package/v2Containers/Sms/Create/index.js +40 -100
  71. package/v2Containers/SmsTrai/Create/index.js +4 -9
  72. package/v2Containers/SmsTrai/Edit/constants.js +0 -2
  73. package/v2Containers/SmsTrai/Edit/index.js +130 -636
  74. package/v2Containers/SmsTrai/Edit/messages.js +4 -14
  75. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +2296 -4249
  76. package/v2Containers/SmsWrapper/index.js +8 -37
  77. package/v2Containers/TagList/index.js +0 -6
  78. package/v2Containers/Templates/_templates.scss +2 -163
  79. package/v2Containers/Templates/actions.js +0 -11
  80. package/v2Containers/Templates/constants.js +0 -2
  81. package/v2Containers/Templates/index.js +54 -119
  82. package/v2Containers/Templates/sagas.js +12 -57
  83. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1079 -1043
  84. package/v2Containers/Templates/tests/sagas.test.js +123 -193
  85. package/v2Containers/TemplatesV2/TemplatesV2.style.js +1 -72
  86. package/v2Containers/TemplatesV2/index.js +23 -86
  87. package/v2Containers/Whatsapp/index.js +20 -3
  88. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34 -578
  89. package/utils/rcsPayloadUtils.js +0 -92
  90. package/utils/templateVarUtils.js +0 -201
  91. package/utils/tests/templateVarUtils.test.js +0 -204
  92. package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js.rej +0 -18
  93. package/v2Components/CommonTestAndPreview/previewApiUtils.js +0 -59
  94. package/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +0 -67
  95. package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +0 -87
  96. package/v2Components/SmsFallback/constants.js +0 -73
  97. package/v2Components/SmsFallback/index.js +0 -955
  98. package/v2Components/SmsFallback/index.scss +0 -265
  99. package/v2Components/SmsFallback/messages.js +0 -78
  100. package/v2Components/SmsFallback/smsFallbackUtils.js +0 -118
  101. package/v2Components/SmsFallback/tests/SmsFallbackLocalSelector.test.js +0 -50
  102. package/v2Components/SmsFallback/tests/rcsSmsFallback.acceptance.test.js +0 -147
  103. package/v2Components/SmsFallback/tests/smsFallbackHandlers.test.js +0 -304
  104. package/v2Components/SmsFallback/tests/smsFallbackUi.test.js +0 -197
  105. package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +0 -277
  106. package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +0 -422
  107. package/v2Components/SmsFallback/useLocalTemplateList.js +0 -92
  108. package/v2Components/TemplatePreview/constants.js +0 -2
  109. package/v2Components/VarSegmentMessageEditor/constants.js +0 -2
  110. package/v2Components/VarSegmentMessageEditor/index.js +0 -125
  111. package/v2Components/VarSegmentMessageEditor/index.scss +0 -46
  112. package/v2Containers/CreativesContainer/CreativesSlideBoxWrapper.js +0 -43
  113. package/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +0 -67
  114. package/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +0 -90
  115. package/v2Containers/CreativesContainer/tests/embeddedSlideboxUtils.test.js +0 -258
  116. package/v2Containers/CreativesContainer/tests/useLocalTemplatesProp.test.js +0 -125
  117. package/v2Containers/Rcs/index.js.rej +0 -1336
  118. package/v2Containers/Rcs/index.scss.rej +0 -74
  119. package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +0 -225
  120. package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap.rej +0 -128
  121. package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +0 -318
  122. package/v2Containers/Sms/smsFormDataHelpers.js +0 -67
  123. package/v2Containers/Sms/tests/smsFormDataHelpers.test.js +0 -253
  124. package/v2Containers/SmsTrai/Edit/index.scss +0 -121
  125. package/v2Containers/Templates/TemplatesActionBar.js +0 -101
  126. package/v2Containers/Templates/tests/TemplatesActionBar.test.js +0 -120
  127. package/v2Containers/Templates/tests/smsTemplatesListApi.test.js +0 -180
  128. package/v2Containers/Templates/utils/smsTemplatesListApi.js +0 -79
  129. package/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +0 -131
@@ -32,37 +32,16 @@ import {
32
32
  DELIVERY_SETTING_KEY_SENDER_REPLY_TO,
33
33
  DELIVERY_SETTING_KEY_SOURCE_ACCOUNT_IDENTIFIER,
34
34
  DELIVERY_SETTING_KEY_SENDER_MOB_NUM,
35
- DELIVERY_SETTING_KEY_SMS_FALLBACK_DOMAIN_ID,
36
35
  } from './constants';
37
36
  import './ModifyDeliverySettings.scss';
38
37
 
39
38
  const findDefault = (array) => find(array, { default: true }) || (array && array[0]) || {};
40
39
 
41
- /**
42
- * Drop empty GSM rows. Optionally drop rows whose value equals domain name — some APIs duplicate
43
- * domain label as a bogus sender row; RCS/DLT often legitimately use the same string (e.g. DetailsForGW1).
44
- */
45
- const filterUsableGsmSendersForDomain = (domain, gsmSenders, { skipDomainNameEchoFilter = false } = {}) => {
46
- const normalizedDomainName =
47
- domain?.domainName != null ? String(domain.domainName).trim().toLowerCase() : '';
48
- return (gsmSenders || []).filter((gsmSenderRow) => {
49
- const rawValue = gsmSenderRow?.value;
50
- if (rawValue == null) return false;
51
- const trimmedSenderValue = String(rawValue).trim();
52
- if (!trimmedSenderValue) return false;
53
- const senderMatchesDomainLabel =
54
- normalizedDomainName && trimmedSenderValue.toLowerCase() === normalizedDomainName;
55
- if (!skipDomainNameEchoFilter && senderMatchesDomainLabel) return false;
56
- return true;
57
- });
58
- };
59
-
60
40
  const ModifyDeliverySettings = (props) => {
61
41
  const {
62
42
  channel,
63
43
  deliverySettings: initialSettings = {},
64
44
  senderDetailsOptions = [],
65
- smsFallbackSenderDetailsOptions = [],
66
45
  wecrmAccounts = [],
67
46
  onSaveDeliverySettings,
68
47
  onClose,
@@ -123,21 +102,17 @@ const ModifyDeliverySettings = (props) => {
123
102
  if (!(channel === CHANNELS.SMS && smsTraiDltEnabled)) {
124
103
  return allDomainOptions;
125
104
  }
126
- // Without template registered sender IDs, strict DLT filter removes every domain — keep full list.
127
- if (!registeredSenderIds?.length) {
128
- return allDomainOptions;
129
- }
130
105
 
131
- return allDomainOptions.filter((domain) => (domain?.gsmSenders || []).some(
132
- (gsmSenderOption) => registeredSenderIds?.includes(gsmSenderOption?.value),
106
+ return allDomainOptions.filter((domain) => (domain.gsmSenders || []).some(
107
+ (gsmId) => registeredSenderIds.includes(gsmId.value),
133
108
  ));
134
109
  }, [allDomainOptions, channel, registeredSenderIds, smsTraiDltEnabled]);
135
110
 
136
111
  const selectedDomain = useMemo(
137
112
  () => (senderDetailsOptions || []).find(
138
- (senderDomain) => senderDomain.domainId === get(localSettings, DELIVERY_SETTING_KEY_DOMAIN_ID),
113
+ (d) => d.domainId === get(localSettings, DELIVERY_SETTING_KEY_DOMAIN_ID),
139
114
  ) || {},
140
- [senderDetailsOptions, get(localSettings, DELIVERY_SETTING_KEY_DOMAIN_ID)],
115
+ [senderDetailsOptions, localSettings.domainId],
141
116
  );
142
117
  const {
143
118
  gsmSenders: selectedDomainGsmSenders = [],
@@ -145,103 +120,25 @@ const ModifyDeliverySettings = (props) => {
145
120
  emailRepliers: selectedDomainEmailRepliers = [],
146
121
  } = selectedDomain;
147
122
 
148
- const rcsSenderOptions = useMemo(
149
- () => {
150
- if (channel !== CHANNELS.RCS) return [];
151
- const rcsDomainRows = senderDetailsOptions || [];
152
- const selectedRcsDomainId = get(localSettings, DELIVERY_SETTING_KEY_DOMAIN_ID);
153
- const rcsDomainsForDropdown =
154
- selectedRcsDomainId != null && selectedRcsDomainId !== ''
155
- ? rcsDomainRows.filter((senderDomain) => senderDomain?.domainId === selectedRcsDomainId)
156
- : rcsDomainRows;
157
- return rcsDomainsForDropdown.flatMap((senderDomain) =>
158
- filterUsableGsmSendersForDomain(senderDomain, senderDomain?.gsmSenders, {
159
- skipDomainNameEchoFilter: true,
160
- }).map((gsmSenderRow) => ({
161
- value: senderDomain?.domainId != null && gsmSenderRow?.value != null
162
- ? `${senderDomain.domainId}|${gsmSenderRow.value}`
163
- : gsmSenderRow?.value,
164
- label: String(gsmSenderRow?.value ?? ''),
165
- })));
166
- },
167
- [channel, senderDetailsOptions, localSettings],
168
- );
169
-
170
- const rcsGsmSenderIdForSelect = useMemo(() => {
171
- const raw = get(localSettings, DELIVERY_SETTING_KEY_GSM_SENDER_ID);
172
- if (raw == null || raw === '') return undefined;
173
- const allowed = new Set((rcsSenderOptions || []).map((senderOption) => senderOption.value));
174
- return allowed.has(raw) ? raw : undefined;
175
- }, [localSettings, rcsSenderOptions]);
176
-
177
- const smsFallbackDomainOptions = useMemo(
178
- () => {
179
- const raw = (smsFallbackSenderDetailsOptions || []).map((senderDetails) => ({
180
- label: senderDetails.domainName || senderDetails.domainId,
181
- value: senderDetails.domainId,
182
- ...senderDetails,
183
- }));
184
- if (!(channel === CHANNELS.RCS && smsTraiDltEnabled && registeredSenderIds?.length)) {
185
- return raw;
186
- }
187
- return raw.filter((domain) => (domain?.gsmSenders || []).some(
188
- (gsmSenderOption) => registeredSenderIds?.includes(gsmSenderOption?.value),
189
- ));
190
- },
191
- [channel, smsFallbackSenderDetailsOptions, smsTraiDltEnabled, registeredSenderIds],
192
- );
193
-
194
- const smsSenderOptions = useMemo(
195
- () => {
196
- if (channel !== CHANNELS.RCS) return [];
197
- const smsFallbackDomainRows = smsFallbackSenderDetailsOptions || [];
198
- const selectedSmsFallbackDomainId = get(localSettings, DELIVERY_SETTING_KEY_SMS_FALLBACK_DOMAIN_ID);
199
- const smsFallbackDomainsForDropdown =
200
- selectedSmsFallbackDomainId != null && selectedSmsFallbackDomainId !== ''
201
- ? smsFallbackDomainRows.filter((senderDomain) => senderDomain?.domainId === selectedSmsFallbackDomainId)
202
- : smsFallbackDomainRows;
203
- const shouldFilterSmsSendersByDltRegistration = smsTraiDltEnabled && registeredSenderIds?.length;
204
- return smsFallbackDomainsForDropdown.flatMap((senderDomain) =>
205
- filterUsableGsmSendersForDomain(senderDomain, senderDomain?.gsmSenders)
206
- .filter((smsGsmSenderRow) =>
207
- !shouldFilterSmsSendersByDltRegistration || registeredSenderIds?.includes(smsGsmSenderRow?.value))
208
- .map((gsmSenderRow) => ({
209
- value: senderDomain?.domainId != null && gsmSenderRow?.value != null
210
- ? `${senderDomain.domainId}|${gsmSenderRow.value}`
211
- : gsmSenderRow?.value,
212
- label: String(gsmSenderRow?.value ?? ''),
213
- })));
214
- },
215
- [channel, smsFallbackSenderDetailsOptions, localSettings, smsTraiDltEnabled, registeredSenderIds],
216
- );
217
-
218
- const smsFallbackGsmIdForSelect = useMemo(() => {
219
- const raw = get(localSettings, DELIVERY_SETTING_KEY_CDMA_SENDER_ID);
220
- if (raw == null || raw === '') return undefined;
221
- const allowed = new Set((smsSenderOptions || []).map((senderOption) => senderOption.value));
222
- return allowed.has(raw) ? raw : undefined;
223
- }, [localSettings, smsSenderOptions]);
224
-
225
123
  const gsmOptions = useMemo(
226
124
  () => {
227
- const smsGsmSendersForSelect = channel === CHANNELS.SMS && smsTraiDltEnabled && registeredSenderIds?.length
228
- ? selectedDomainGsmSenders.filter((gsmSenderOption) =>
229
- registeredSenderIds?.includes(gsmSenderOption?.value))
125
+ const smsGsmSenders = channel === CHANNELS.SMS && smsTraiDltEnabled
126
+ ? selectedDomainGsmSenders.filter((gsmId) => registeredSenderIds.includes(gsmId.value))
230
127
  : selectedDomainGsmSenders;
231
128
 
232
- return smsGsmSendersForSelect.map((gsmSenderRow) => ({
233
- label: gsmSenderRow?.value || gsmSenderRow?.label,
234
- value: gsmSenderRow?.value,
129
+ return smsGsmSenders.map((o) => ({
130
+ label: o.value || o.label,
131
+ value: o.value,
235
132
  }));
236
133
  },
237
134
  [channel, registeredSenderIds, selectedDomainGsmSenders, smsTraiDltEnabled],
238
135
  );
239
136
 
240
137
  const emailSenderOptions = useMemo(
241
- () => selectedDomainEmailSenders.map((emailSenderRow) => ({
242
- label: emailSenderRow.value || emailSenderRow.label,
243
- value: emailSenderRow.value,
244
- senderLabel: emailSenderRow.label,
138
+ () => selectedDomainEmailSenders.map((o) => ({
139
+ label: o.value || o.label,
140
+ value: o.value,
141
+ senderLabel: o.label,
245
142
  })),
246
143
  [selectedDomainEmailSenders],
247
144
  );
@@ -307,47 +204,13 @@ const ModifyDeliverySettings = (props) => {
307
204
  });
308
205
  }, []);
309
206
 
310
- const onSmsFallbackDomainChange = useCallback(
311
- (value) => {
312
- setLocalSettings((prev) => {
313
- const next = cloneDeep(prev);
314
- next[DELIVERY_SETTING_KEY_SMS_FALLBACK_DOMAIN_ID] = value;
315
- const selectedSmsFallbackDomain = (smsFallbackSenderDetailsOptions || []).find(
316
- (senderDomain) => senderDomain?.domainId === value,
317
- );
318
- const usableSmsFallbackGsmSenders = filterUsableGsmSendersForDomain(
319
- selectedSmsFallbackDomain,
320
- selectedSmsFallbackDomain?.gsmSenders,
321
- );
322
- const firstSmsFallbackGsmSender = usableSmsFallbackGsmSenders[0];
323
- const composite = selectedSmsFallbackDomain?.domainId != null && firstSmsFallbackGsmSender?.value != null
324
- ? `${selectedSmsFallbackDomain.domainId}|${firstSmsFallbackGsmSender.value}`
325
- : (firstSmsFallbackGsmSender?.value || '');
326
- next[DELIVERY_SETTING_KEY_CDMA_SENDER_ID] = composite;
327
- return next;
328
- });
329
- },
330
- [smsFallbackSenderDetailsOptions],
331
- );
332
-
333
207
  const onDomainChange = useCallback(
334
208
  (value) => {
335
- const domain = domainOptions.find((domainOption) => domainOption.value === value);
209
+ const domain = domainOptions.find((d) => d.value === value);
336
210
  updateSetting(DELIVERY_SETTING_KEY_DOMAIN_ID, value);
337
211
  if (domain?.dgmId != null) updateSetting(DELIVERY_SETTING_KEY_DOMAIN_GATEWAY_MAP_ID, domain.dgmId);
338
- if (channel === CHANNELS.RCS && domain) {
339
- const usableRcsGsmSenders = filterUsableGsmSendersForDomain(domain, domain?.gsmSenders, {
340
- skipDomainNameEchoFilter: true,
341
- });
342
- const firstRcsGsmSender = usableRcsGsmSenders[0];
343
- const composite = domain?.domainId != null && firstRcsGsmSender?.value != null
344
- ? `${domain.domainId}|${firstRcsGsmSender.value}`
345
- : (firstRcsGsmSender?.value || '');
346
- updateSetting(DELIVERY_SETTING_KEY_GSM_SENDER_ID, composite);
347
- return;
348
- }
349
212
  if (channel === CHANNELS.SMS && domain) {
350
- const smsGsmSenders = smsTraiDltEnabled && registeredSenderIds?.length
213
+ const smsGsmSenders = smsTraiDltEnabled
351
214
  ? (domain.gsmSenders || []).filter((gsmId) => registeredSenderIds.includes(gsmId.value))
352
215
  : domain.gsmSenders;
353
216
  const def = findDefault(smsGsmSenders);
@@ -367,20 +230,9 @@ const ModifyDeliverySettings = (props) => {
367
230
  );
368
231
 
369
232
  const handleDone = useCallback(() => {
370
- const next = cloneDeep(localSettings);
371
- if (channel === CHANNELS.RCS) {
372
- const rawRcs = get(next, DELIVERY_SETTING_KEY_GSM_SENDER_ID);
373
- if (rawRcs && !(rcsSenderOptions || []).some((senderOption) => senderOption.value === rawRcs)) {
374
- next[DELIVERY_SETTING_KEY_GSM_SENDER_ID] = '';
375
- }
376
- const rawSms = get(next, DELIVERY_SETTING_KEY_CDMA_SENDER_ID);
377
- if (rawSms && !(smsSenderOptions || []).some((senderOption) => senderOption.value === rawSms)) {
378
- next[DELIVERY_SETTING_KEY_CDMA_SENDER_ID] = '';
379
- }
380
- }
381
- onSaveDeliverySettings(next);
233
+ onSaveDeliverySettings(localSettings);
382
234
  if (onClose) onClose();
383
- }, [channel, localSettings, onSaveDeliverySettings, onClose, rcsSenderOptions, smsSenderOptions]);
235
+ }, [localSettings, onSaveDeliverySettings, onClose]);
384
236
 
385
237
  const renderSelectRow = useCallback(
386
238
  ({
@@ -434,7 +286,7 @@ const ModifyDeliverySettings = (props) => {
434
286
  value: get(localSettings, DELIVERY_SETTING_KEY_SENDER_EMAIL),
435
287
  onChange: (val) => {
436
288
  const sender = selectedDomainEmailSenders.find(
437
- (emailSenderRow) => emailSenderRow.value === val,
289
+ (s) => s.value === val,
438
290
  );
439
291
  updateSetting(DELIVERY_SETTING_KEY_SENDER_EMAIL, val);
440
292
  updateSetting(DELIVERY_SETTING_KEY_SENDER_LABEL, sender?.label || val);
@@ -446,7 +298,7 @@ const ModifyDeliverySettings = (props) => {
446
298
  value: get(localSettings, DELIVERY_SETTING_KEY_SENDER_LABEL) || '',
447
299
  onChange: (val) => {
448
300
  const sender = selectedDomainEmailSenders.find(
449
- (emailSenderRow) => (emailSenderRow.label || emailSenderRow.value) === val,
301
+ (s) => (s.label || s.value) === val,
450
302
  );
451
303
  if (sender) {
452
304
  updateSetting(DELIVERY_SETTING_KEY_SENDER_EMAIL, sender.value);
@@ -474,7 +326,7 @@ const ModifyDeliverySettings = (props) => {
474
326
  onChange: (val) => {
475
327
  updateSetting(DELIVERY_SETTING_KEY_SOURCE_ACCOUNT_IDENTIFIER, val);
476
328
  const domain = (senderDetailsOptions || []).find(
477
- (whatsappAccountRow) => whatsappAccountRow.sourceAccountIdentifier === val,
329
+ (d) => d.sourceAccountIdentifier === val,
478
330
  );
479
331
  const first = domain?.gsmSenders?.[0];
480
332
  updateSetting(DELIVERY_SETTING_KEY_SENDER_MOB_NUM, first?.value || '');
@@ -488,39 +340,10 @@ const ModifyDeliverySettings = (props) => {
488
340
  onChange: (val) => updateSetting(DELIVERY_SETTING_KEY_SENDER_MOB_NUM, val),
489
341
  },
490
342
  ];
491
- const rcsFields = [
492
- {
493
- titleMessage: messages.rcsDomainLabel,
494
- options: domainOptions,
495
- value: get(localSettings, DELIVERY_SETTING_KEY_DOMAIN_ID),
496
- onChange: (val) => onDomainChange(val),
497
- },
498
- {
499
- titleMessage: messages.rcsSenderIdLabel,
500
- options: rcsSenderOptions,
501
- value: rcsGsmSenderIdForSelect,
502
- onChange: (val) => updateSetting(DELIVERY_SETTING_KEY_GSM_SENDER_ID, val),
503
- },
504
- ...((smsFallbackSenderDetailsOptions || []).length > 0 ? [
505
- {
506
- titleMessage: messages.fallbackSmsDomainLabel,
507
- options: smsFallbackDomainOptions,
508
- value: get(localSettings, DELIVERY_SETTING_KEY_SMS_FALLBACK_DOMAIN_ID),
509
- onChange: onSmsFallbackDomainChange,
510
- },
511
- {
512
- titleMessage: messages.fallbackSmsSenderIdLabel,
513
- options: smsSenderOptions,
514
- value: smsFallbackGsmIdForSelect,
515
- onChange: (val) => updateSetting(DELIVERY_SETTING_KEY_CDMA_SENDER_ID, val),
516
- },
517
- ] : []),
518
- ];
519
343
  const byChannel = {
520
344
  [CHANNELS.SMS]: smsFields,
521
345
  [CHANNELS.EMAIL]: emailFields,
522
346
  [CHANNELS.WHATSAPP]: whatsappFields,
523
- [CHANNELS.RCS]: rcsFields,
524
347
  };
525
348
  return byChannel[channel] || [];
526
349
  }, [
@@ -533,13 +356,6 @@ const ModifyDeliverySettings = (props) => {
533
356
  wecrmAccountOptions,
534
357
  whatsappAccountOptionsForDisplay,
535
358
  whatsappSenderOptions,
536
- rcsSenderOptions,
537
- rcsGsmSenderIdForSelect,
538
- smsSenderOptions,
539
- smsFallbackGsmIdForSelect,
540
- smsFallbackDomainOptions,
541
- smsFallbackSenderDetailsOptions,
542
- onSmsFallbackDomainChange,
543
359
  localSettings,
544
360
  selectedDomainEmailSenders,
545
361
  senderDetailsOptions,
@@ -574,10 +390,9 @@ const ModifyDeliverySettings = (props) => {
574
390
  };
575
391
 
576
392
  ModifyDeliverySettings.propTypes = {
577
- channel: PropTypes.oneOf([CHANNELS.SMS, CHANNELS.EMAIL, CHANNELS.WHATSAPP, CHANNELS.RCS]).isRequired,
393
+ channel: PropTypes.oneOf([CHANNELS.SMS, CHANNELS.EMAIL, CHANNELS.WHATSAPP]).isRequired,
578
394
  deliverySettings: PropTypes.object,
579
395
  senderDetailsOptions: PropTypes.array,
580
- smsFallbackSenderDetailsOptions: PropTypes.array,
581
396
  wecrmAccounts: PropTypes.array,
582
397
  onSaveDeliverySettings: PropTypes.func.isRequired,
583
398
  onClose: PropTypes.func,
@@ -593,7 +408,6 @@ ModifyDeliverySettings.propTypes = {
593
408
  ModifyDeliverySettings.defaultProps = {
594
409
  deliverySettings: {},
595
410
  senderDetailsOptions: [],
596
- smsFallbackSenderDetailsOptions: [],
597
411
  wecrmAccounts: [],
598
412
  onClose: undefined,
599
413
  isLoading: false,
@@ -21,8 +21,6 @@ export const DELIVERY_SETTING_KEY_SENDER_LABEL = 'senderLabel';
21
21
  export const DELIVERY_SETTING_KEY_SENDER_REPLY_TO = 'senderReplyTo';
22
22
  export const DELIVERY_SETTING_KEY_SOURCE_ACCOUNT_IDENTIFIER = 'sourceAccountIdentifier';
23
23
  export const DELIVERY_SETTING_KEY_SENDER_MOB_NUM = 'senderMobNum';
24
- /** RCS: SMS fallback domain (separate from primary RCS domainId) */
25
- export const DELIVERY_SETTING_KEY_SMS_FALLBACK_DOMAIN_ID = 'smsFallbackDomainId';
26
24
 
27
25
  /** data-testid for delivery settings edit icon */
28
26
  export const TEST_ID_DELIVERY_SETTINGS_EDIT = 'delivery-settings-edit';
@@ -34,7 +32,6 @@ export const CHANNELS_WITH_DELIVERY_SETTINGS = [
34
32
  CHANNELS.SMS,
35
33
  CHANNELS.EMAIL,
36
34
  CHANNELS.WHATSAPP,
37
- CHANNELS.RCS,
38
35
  ];
39
36
 
40
37
  /** Default empty delivery setting per channel (campaigns-style shape) */
@@ -59,21 +56,8 @@ export const DEFAULT_DELIVERY_SETTING_WHATSAPP = {
59
56
  sourceAccountIdentifier: '',
60
57
  };
61
58
 
62
- /** RCS: gsmSenderId = RCS sender, cdmaSenderId = SMS fallback sender (reuse same keys) */
63
- export const DEFAULT_DELIVERY_SETTING_RCS = {
64
- domainId: null,
65
- domainGatewayMapId: null,
66
- gsmSenderId: '',
67
- smsFallbackDomainId: null,
68
- cdmaSenderId: '',
69
- };
70
-
71
59
  export const DEFAULT_DELIVERY_SETTINGS_BY_CHANNEL = {
72
60
  [CHANNELS.SMS]: DEFAULT_DELIVERY_SETTING_SMS,
73
61
  [CHANNELS.EMAIL]: DEFAULT_DELIVERY_SETTING_EMAIL,
74
62
  [CHANNELS.WHATSAPP]: DEFAULT_DELIVERY_SETTING_WHATSAPP,
75
- [CHANNELS.RCS]: DEFAULT_DELIVERY_SETTING_RCS,
76
63
  };
77
-
78
- /** API `contactInfo.type` keys that map to RCS-style GSM sender rows (env-specific naming). */
79
- export const RCS_CONTACT_INFO_GSM_TYPE_KEYS = ['gsm_sender_id', 'rcs_sender_id', 'rcs_sender'];
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * DeliverySettings — summary row + CapSlideBox trigger for Test and Preview.
3
- * Rendered for SMS, Email, WhatsApp, RCS (ModifyDeliverySettings). RCS uses gsmSenderId + cdmaSenderId (SMS fallback).
3
+ * Rendered only for SMS, Email, WhatsApp. Uses cap-ui-library only.
4
4
  *
5
5
  * Reference: cap-campaigns-v2 DeliverySettingsV2 (summary + modify panel).
6
6
  */
7
7
 
8
- import React, { useState, useCallback, useMemo } from "react";
8
+ import React, { useState, useCallback } from "react";
9
9
  import PropTypes from "prop-types";
10
10
  import CapRow from "@capillarytech/cap-ui-library/CapRow";
11
11
  import CapHeading from "@capillarytech/cap-ui-library/CapHeading";
@@ -22,7 +22,6 @@ import {
22
22
  SUMMARY_EMPTY_PLACEHOLDER,
23
23
  DELIVERY_SETTING_KEY_DOMAIN_ID,
24
24
  DELIVERY_SETTING_KEY_GSM_SENDER_ID,
25
- DELIVERY_SETTING_KEY_CDMA_SENDER_ID,
26
25
  DELIVERY_SETTING_KEY_SENDER_EMAIL,
27
26
  DELIVERY_SETTING_KEY_SENDER_LABEL,
28
27
  DELIVERY_SETTING_KEY_SENDER_REPLY_TO,
@@ -36,7 +35,7 @@ const DeliverySettings = (props) => {
36
35
  const {
37
36
  channel,
38
37
  deliverySettings = {},
39
- senderDetailsByChannel = {},
38
+ senderDetailsOptions = [],
40
39
  wecrmAccounts = [],
41
40
  onSaveDeliverySettings,
42
41
  isLoadingSenderDetails,
@@ -44,7 +43,6 @@ const DeliverySettings = (props) => {
44
43
  smsTraiDltEnabled,
45
44
  registeredSenderIds,
46
45
  whatsappAccountFromForm,
47
- isChannelSmsFallbackPreviewEnabled,
48
46
  } = props;
49
47
 
50
48
  const [isSlideBoxOpen, setSlideBoxOpen] = useState(false);
@@ -60,68 +58,17 @@ const DeliverySettings = (props) => {
60
58
  [onSaveDeliverySettings, closeSlideBox]
61
59
  );
62
60
 
63
- const senderDetailsOptions = useMemo(
64
- () => (senderDetailsByChannel[channel] || []),
65
- [senderDetailsByChannel, channel],
66
- );
67
- const smsDomainsForRcs = useMemo(
68
- () => (channel === CHANNELS.RCS ? (senderDetailsByChannel[CHANNELS.SMS] || []) : []),
69
- [channel, senderDetailsByChannel],
70
- );
71
-
72
61
  if (!CHANNELS_WITH_DELIVERY_SETTINGS.includes(channel)) {
73
62
  return null;
74
63
  }
75
64
 
76
65
  const notConfiguredLabel = formatMessage(messages.notConfigured);
77
66
 
78
- const getDisplayFromDomains = (domains, compositeValue) => {
79
- if (!compositeValue || !domains?.length) return compositeValue || SUMMARY_EMPTY_PLACEHOLDER;
80
- for (const senderDomain of domains) {
81
- for (const gsmSenderRow of senderDomain.gsmSenders || []) {
82
- const value = senderDomain.domainId != null && gsmSenderRow.value != null
83
- ? `${senderDomain.domainId}|${gsmSenderRow.value}`
84
- : gsmSenderRow.value;
85
- if (value === compositeValue && (senderDomain.domainName || gsmSenderRow.value)) {
86
- return [senderDomain.domainName, gsmSenderRow.value].filter(Boolean).join(' · ');
87
- }
88
- }
89
- }
90
- return compositeValue || SUMMARY_EMPTY_PLACEHOLDER;
91
- };
92
-
93
- /** RCS summary: show sender ID only (no "domain · sender"). */
94
- const getSenderIdOnlyFromComposite = (domains, compositeValue) => {
95
- if (!compositeValue || !domains?.length) return compositeValue || SUMMARY_EMPTY_PLACEHOLDER;
96
- for (const senderDomain of domains) {
97
- for (const gsmSenderRow of senderDomain.gsmSenders || []) {
98
- const value = senderDomain.domainId != null && gsmSenderRow.value != null
99
- ? `${senderDomain.domainId}|${gsmSenderRow.value}`
100
- : gsmSenderRow.value;
101
- if (value === compositeValue && gsmSenderRow.value != null) {
102
- return String(gsmSenderRow.value);
103
- }
104
- }
105
- }
106
- return compositeValue || SUMMARY_EMPTY_PLACEHOLDER;
107
- };
108
-
109
67
  const getSummaryText = () => {
110
68
  const empty = SUMMARY_EMPTY_PLACEHOLDER;
111
- if (channel === CHANNELS.RCS) {
112
- const rcsVal = get(deliverySettings, DELIVERY_SETTING_KEY_GSM_SENDER_ID) || '';
113
- const smsVal = get(deliverySettings, DELIVERY_SETTING_KEY_CDMA_SENDER_ID) || '';
114
- const summaryRcs = {
115
- rcsSenderId: getSenderIdOnlyFromComposite(senderDetailsOptions, rcsVal),
116
- };
117
- if (isChannelSmsFallbackPreviewEnabled) {
118
- summaryRcs.smsFallbackSenderId = getSenderIdOnlyFromComposite(smsDomainsForRcs, smsVal);
119
- }
120
- return summaryRcs;
121
- }
122
69
  if (channel === CHANNELS.SMS) {
123
70
  const domain = (senderDetailsOptions || []).find(
124
- (senderDomain) => senderDomain.domainId === get(deliverySettings, DELIVERY_SETTING_KEY_DOMAIN_ID),
71
+ (d) => d.domainId === get(deliverySettings, DELIVERY_SETTING_KEY_DOMAIN_ID),
125
72
  );
126
73
  const domainName = domain?.domainName || empty;
127
74
  const senderId = get(deliverySettings, DELIVERY_SETTING_KEY_GSM_SENDER_ID) || empty;
@@ -129,7 +76,7 @@ const DeliverySettings = (props) => {
129
76
  }
130
77
  if (channel === CHANNELS.EMAIL) {
131
78
  const domain = (senderDetailsOptions || []).find(
132
- (senderDomain) => senderDomain.domainId === get(deliverySettings, DELIVERY_SETTING_KEY_DOMAIN_ID),
79
+ (d) => d.domainId === get(deliverySettings, DELIVERY_SETTING_KEY_DOMAIN_ID),
133
80
  );
134
81
  const emailDomain = domain?.domainName || empty;
135
82
  const senderEmail = get(deliverySettings, DELIVERY_SETTING_KEY_SENDER_EMAIL) || empty;
@@ -156,12 +103,7 @@ const DeliverySettings = (props) => {
156
103
 
157
104
  const summary = getSummaryText();
158
105
  let hasValues = false;
159
- if (channel === CHANNELS.RCS) {
160
- hasValues = (summary.rcsSenderId && summary.rcsSenderId !== SUMMARY_EMPTY_PLACEHOLDER)
161
- || (isChannelSmsFallbackPreviewEnabled
162
- && summary.smsFallbackSenderId
163
- && summary.smsFallbackSenderId !== SUMMARY_EMPTY_PLACEHOLDER);
164
- } else if (channel === CHANNELS.SMS) {
106
+ if (channel === CHANNELS.SMS) {
165
107
  hasValues = summary.senderDomain !== SUMMARY_EMPTY_PLACEHOLDER
166
108
  || summary.senderId !== SUMMARY_EMPTY_PLACEHOLDER;
167
109
  } else if (channel === CHANNELS.EMAIL) {
@@ -180,15 +122,6 @@ const DeliverySettings = (props) => {
180
122
  const getSummaryObject = () => {
181
123
  if (!hasValues) return null;
182
124
  const label = (msg) => formatMessage(msg);
183
- if (channel === CHANNELS.RCS) {
184
- const rcsSummary = {
185
- [label(messages.rcsSenderIdLabel)]: summary.rcsSenderId,
186
- };
187
- if (isChannelSmsFallbackPreviewEnabled) {
188
- rcsSummary[label(messages.fallbackSmsSenderIdLabel)] = summary.smsFallbackSenderId;
189
- }
190
- return rcsSummary;
191
- }
192
125
  if (channel === CHANNELS.SMS) {
193
126
  return {
194
127
  [label(messages.senderDomainSummary)]: summary.senderDomain,
@@ -232,7 +165,7 @@ const DeliverySettings = (props) => {
232
165
  Object.entries(summaryObject).map(([key, value]) => (
233
166
  <CapRow type="flex" key={key} className="delivery-settings__summary-entry">
234
167
  <CapLabel type="label1" className="delivery-settings__summary-key">{key}</CapLabel>
235
- <CapLabel type="label9" className="delivery-settings__summary-value">
168
+ <CapLabel type="label9">
236
169
  :
237
170
  {' '}
238
171
  {value}
@@ -261,11 +194,6 @@ const DeliverySettings = (props) => {
261
194
  channel={channel}
262
195
  deliverySettings={deliverySettings}
263
196
  senderDetailsOptions={senderDetailsOptions}
264
- smsFallbackSenderDetailsOptions={
265
- channel === CHANNELS.RCS && isChannelSmsFallbackPreviewEnabled
266
- ? smsDomainsForRcs
267
- : undefined
268
- }
269
197
  wecrmAccounts={wecrmAccounts}
270
198
  onSaveDeliverySettings={handleSave}
271
199
  onClose={closeSlideBox}
@@ -285,9 +213,9 @@ const DeliverySettings = (props) => {
285
213
  DeliverySettings.propTypes = {
286
214
  channel: PropTypes.string.isRequired,
287
215
  deliverySettings: PropTypes.object,
288
- senderDetailsByChannel: PropTypes.object,
216
+ senderDetailsOptions: PropTypes.array,
289
217
  wecrmAccounts: PropTypes.array,
290
- onSaveDeliverySettings: PropTypes.func,
218
+ onSaveDeliverySettings: PropTypes.func.isRequired,
291
219
  isLoadingSenderDetails: PropTypes.bool,
292
220
  formatMessage: PropTypes.func,
293
221
  smsTraiDltEnabled: PropTypes.bool,
@@ -295,20 +223,17 @@ DeliverySettings.propTypes = {
295
223
  whatsappAccountFromForm: PropTypes.shape({
296
224
  accountName: PropTypes.string,
297
225
  }),
298
- isChannelSmsFallbackPreviewEnabled: PropTypes.bool,
299
226
  };
300
227
 
301
228
  DeliverySettings.defaultProps = {
302
229
  deliverySettings: {},
303
- senderDetailsByChannel: {},
230
+ senderDetailsOptions: [],
304
231
  wecrmAccounts: [],
305
- onSaveDeliverySettings: () => {},
306
232
  isLoadingSenderDetails: false,
307
233
  formatMessage: undefined,
308
234
  smsTraiDltEnabled: false,
309
235
  registeredSenderIds: [],
310
236
  whatsappAccountFromForm: undefined,
311
- isChannelSmsFallbackPreviewEnabled: false,
312
237
  };
313
238
 
314
239
  export default DeliverySettings;
@@ -108,34 +108,4 @@ export default defineMessages({
108
108
  id: `${prefix}.disabledMessage`,
109
109
  defaultMessage: 'Message template selected belongs to this account',
110
110
  },
111
- /** RCS: primary domain (slidebox) */
112
- rcsDomainLabel: {
113
- id: `${prefix}.rcsDomainLabel`,
114
- defaultMessage: 'RCS domain:',
115
- },
116
- /** RCS: SMS fallback domain (slidebox) */
117
- fallbackSmsDomainLabel: {
118
- id: `${prefix}.fallbackSmsDomainLabel`,
119
- defaultMessage: 'Fallback SMS domain:',
120
- },
121
- /** RCS: "RCS sender ID" */
122
- rcsSenderIdLabel: {
123
- id: `${prefix}.rcsSenderIdLabel`,
124
- defaultMessage: 'RCS sender ID',
125
- },
126
- /** RCS: "Fallback SMS sender ID" */
127
- fallbackSmsSenderIdLabel: {
128
- id: `${prefix}.fallbackSmsSenderIdLabel`,
129
- defaultMessage: 'Fallback SMS sender ID',
130
- },
131
- /** RCS: "Domain" (for domain · sender ID display) */
132
- domainLabel: {
133
- id: `${prefix}.domainLabel`,
134
- defaultMessage: 'Domain',
135
- },
136
- /** RCS: placeholder for sender ID dropdown */
137
- selectSenderId: {
138
- id: `${prefix}.selectSenderId`,
139
- defaultMessage: 'Select sender ID',
140
- },
141
111
  });