@capillarytech/creatives-library 8.0.330-alpha.0 → 8.0.330

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 (122) hide show
  1. package/constants/unified.js +0 -18
  2. package/package.json +1 -1
  3. package/services/api.js +0 -17
  4. package/services/tests/api.test.js +0 -85
  5. package/utils/commonUtils.js +0 -28
  6. package/utils/tests/commonUtil.test.js +0 -169
  7. package/v2Components/CapTagList/index.js +0 -10
  8. package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +49 -70
  9. package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +2 -8
  10. package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +21 -207
  11. package/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +0 -16
  12. package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +10 -85
  13. package/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +0 -30
  14. package/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +11 -79
  15. package/v2Components/CommonTestAndPreview/SendTestMessage.js +53 -87
  16. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -20
  17. package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +4 -133
  18. package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +34 -145
  19. package/v2Components/CommonTestAndPreview/actions.js +0 -10
  20. package/v2Components/CommonTestAndPreview/constants.js +1 -53
  21. package/v2Components/CommonTestAndPreview/index.js +168 -998
  22. package/v2Components/CommonTestAndPreview/messages.js +3 -147
  23. package/v2Components/CommonTestAndPreview/reducer.js +0 -10
  24. package/v2Components/CommonTestAndPreview/sagas.js +6 -15
  25. package/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +286 -328
  26. package/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +65 -231
  27. package/v2Components/CommonTestAndPreview/tests/DeliverySettings/index.test.js +5 -118
  28. package/v2Components/CommonTestAndPreview/tests/DeliverySettings/utils/parseSenderDetailsResponse.test.js +0 -341
  29. package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +24 -65
  30. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +1 -199
  31. package/v2Components/CommonTestAndPreview/tests/constants.test.js +1 -31
  32. package/v2Components/CommonTestAndPreview/tests/index.test.js +4 -168
  33. package/v2Components/CommonTestAndPreview/tests/reducer.test.js +0 -71
  34. package/v2Components/CommonTestAndPreview/tests/sagas.test.js +2 -2
  35. package/v2Components/CommonTestAndPreview/tests/selectors.test.js +0 -17
  36. package/v2Components/FormBuilder/index.js +1 -7
  37. package/v2Components/TestAndPreviewSlidebox/index.js +1 -13
  38. package/v2Components/TestAndPreviewSlidebox/sagas.js +4 -11
  39. package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +1 -3
  40. package/v2Containers/CreativesContainer/SlideBoxContent.js +4 -36
  41. package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -10
  42. package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -29
  43. package/v2Containers/CreativesContainer/constants.js +0 -9
  44. package/v2Containers/CreativesContainer/index.js +93 -292
  45. package/v2Containers/CreativesContainer/index.scss +1 -51
  46. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +34 -78
  47. package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +16 -79
  48. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +0 -8
  49. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +98 -357
  50. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +10 -20
  51. package/v2Containers/CreativesContainer/tests/index.test.js +9 -71
  52. package/v2Containers/Rcs/constants.js +3 -40
  53. package/v2Containers/Rcs/index.js +895 -1145
  54. package/v2Containers/Rcs/index.scss +6 -85
  55. package/v2Containers/Rcs/messages.js +2 -12
  56. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +2236 -41719
  57. package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +5 -0
  58. package/v2Containers/Rcs/tests/index.test.js +38 -41
  59. package/v2Containers/Rcs/tests/mockData.js +0 -38
  60. package/v2Containers/Rcs/tests/utils.test.js +1 -435
  61. package/v2Containers/Rcs/utils.js +10 -405
  62. package/v2Containers/Sms/Create/index.js +38 -100
  63. package/v2Containers/SmsTrai/Create/index.js +4 -9
  64. package/v2Containers/SmsTrai/Edit/constants.js +0 -2
  65. package/v2Containers/SmsTrai/Edit/index.js +128 -636
  66. package/v2Containers/SmsTrai/Edit/messages.js +4 -14
  67. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +2604 -4590
  68. package/v2Containers/SmsWrapper/index.js +8 -37
  69. package/v2Containers/TagList/index.js +0 -6
  70. package/v2Containers/Templates/_templates.scss +2 -63
  71. package/v2Containers/Templates/actions.js +0 -11
  72. package/v2Containers/Templates/constants.js +0 -2
  73. package/v2Containers/Templates/index.js +40 -90
  74. package/v2Containers/Templates/sagas.js +12 -57
  75. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1079 -1043
  76. package/v2Containers/Templates/tests/sagas.test.js +123 -193
  77. package/v2Containers/TemplatesV2/TemplatesV2.style.js +1 -72
  78. package/v2Containers/TemplatesV2/index.js +23 -86
  79. package/v2Containers/Whatsapp/index.js +20 -3
  80. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +4872 -5790
  81. package/utils/templateVarUtils.js +0 -201
  82. package/utils/tests/templateVarUtils.test.js +0 -204
  83. package/v2Components/CommonTestAndPreview/AddTestCustomer.js +0 -42
  84. package/v2Components/CommonTestAndPreview/CustomerCreationModal.js +0 -155
  85. package/v2Components/CommonTestAndPreview/ExistingCustomerModal.js +0 -93
  86. package/v2Components/CommonTestAndPreview/previewApiUtils.js +0 -59
  87. package/v2Components/CommonTestAndPreview/tests/AddTestCustomer.test.js +0 -66
  88. package/v2Components/CommonTestAndPreview/tests/CommonTestAndPreview.addTestCustomer.test.js +0 -648
  89. package/v2Components/CommonTestAndPreview/tests/CustomerCreationModal.test.js +0 -174
  90. package/v2Components/CommonTestAndPreview/tests/ExistingCustomerModal.test.js +0 -114
  91. package/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +0 -67
  92. package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +0 -87
  93. package/v2Components/SmsFallback/constants.js +0 -73
  94. package/v2Components/SmsFallback/index.js +0 -955
  95. package/v2Components/SmsFallback/index.scss +0 -265
  96. package/v2Components/SmsFallback/messages.js +0 -78
  97. package/v2Components/SmsFallback/smsFallbackUtils.js +0 -118
  98. package/v2Components/SmsFallback/tests/SmsFallbackLocalSelector.test.js +0 -50
  99. package/v2Components/SmsFallback/tests/rcsSmsFallback.acceptance.test.js +0 -147
  100. package/v2Components/SmsFallback/tests/smsFallbackHandlers.test.js +0 -304
  101. package/v2Components/SmsFallback/tests/smsFallbackUi.test.js +0 -197
  102. package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +0 -277
  103. package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +0 -422
  104. package/v2Components/SmsFallback/useLocalTemplateList.js +0 -92
  105. package/v2Components/VarSegmentMessageEditor/constants.js +0 -2
  106. package/v2Components/VarSegmentMessageEditor/index.js +0 -125
  107. package/v2Components/VarSegmentMessageEditor/index.scss +0 -46
  108. package/v2Containers/CreativesContainer/CreativesSlideBoxWrapper.js +0 -43
  109. package/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +0 -67
  110. package/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +0 -90
  111. package/v2Containers/CreativesContainer/tests/embeddedSlideboxUtils.test.js +0 -258
  112. package/v2Containers/CreativesContainer/tests/useLocalTemplatesProp.test.js +0 -125
  113. package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +0 -225
  114. package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +0 -318
  115. package/v2Containers/Sms/smsFormDataHelpers.js +0 -67
  116. package/v2Containers/Sms/tests/smsFormDataHelpers.test.js +0 -253
  117. package/v2Containers/SmsTrai/Edit/index.scss +0 -121
  118. package/v2Containers/Templates/TemplatesActionBar.js +0 -101
  119. package/v2Containers/Templates/tests/TemplatesActionBar.test.js +0 -120
  120. package/v2Containers/Templates/tests/smsTemplatesListApi.test.js +0 -180
  121. package/v2Containers/Templates/utils/smsTemplatesListApi.js +0 -79
  122. package/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +0 -131
@@ -9,91 +9,29 @@
9
9
 
10
10
  import get from 'lodash/get';
11
11
  import { CHANNELS } from '../../constants';
12
- import { RCS_CONTACT_INFO_GSM_TYPE_KEYS } from '../constants';
13
12
 
14
- /** Match API contactInfo.type (some envs use different casing). */
15
- const typeMatches = (itemType, expectedKey) => {
16
- if (!itemType || !expectedKey) return false;
17
- const a = String(itemType).toLowerCase().replace(/-/g, '_');
18
- const b = String(expectedKey).toLowerCase().replace(/-/g, '_');
19
- return a === b;
20
- };
21
-
22
- /**
23
- * Include row unless explicitly invalid — many APIs omit `valid`, which would
24
- * otherwise filter out every sender (RCS/SMS lists empty in UI).
25
- */
26
13
  const getSenderOptions = (contactInfo, key) =>
27
14
  (contactInfo || [])
28
- .filter((contactInfoItem) => typeMatches(contactInfoItem.type, key) && contactInfoItem.valid !== false)
15
+ .filter((contactInfoItem) => contactInfoItem.type === key && contactInfoItem.valid)
29
16
  .sort((contact) => (contact.default ? -1 : 0));
30
17
 
31
- /** RCS APIs may label senders under several `contactInfo.type` keys — see `RCS_CONTACT_INFO_GSM_TYPE_KEYS`. */
32
- const getRcsLikeGsmSenders = (contactInfo) => {
33
- const seen = new Set();
34
- const merged = [];
35
- RCS_CONTACT_INFO_GSM_TYPE_KEYS.forEach((key) => {
36
- getSenderOptions(contactInfo, key).forEach((row) => {
37
- const v = row?.value;
38
- // Skip empty/whitespace — they still pass `v != null` for "" and pollute RCS sender dropdowns.
39
- if (v == null || String(v).trim() === '' || seen.has(v)) return;
40
- seen.add(v);
41
- merged.push(row);
42
- });
43
- });
44
- return merged.sort((a, b) => (a.default ? -1 : 0) - (b.default ? -1 : 0));
45
- };
46
-
47
- /**
48
- * Campaigns domainProperties may return { entity } or { result: { entity } } / { data: { entity } }.
49
- */
50
- function unwrapEntity(response) {
51
- if (!response || typeof response !== 'object') return null;
52
- if (response.entity != null) return response.entity;
53
- const nested = get(response, 'result.entity') ?? get(response, 'data.entity');
54
- if (nested != null) return nested;
55
- if (response.entity === null) return null;
56
- return response;
57
- }
58
-
59
18
  /**
60
19
  * Parse raw API response for one channel into { domains: [...] }
61
- * @param {string} channel - SMS | EMAIL | WHATSAPP | RCS
20
+ * @param {string} channel - SMS | EMAIL | WHATSAPP
62
21
  * @param {Object} response - API response (e.g. { entity: { SMS: [...] } } or { entity: [...] })
63
22
  * @returns {{ domains: Array }} - domains array compatible with campaigns DeliverySettingsV2
64
23
  */
65
24
  export function parseSenderDetailsResponse(channel, response) {
66
- const entity = unwrapEntity(response);
67
- if (entity == null || entity === '') {
25
+ const entity = get(response, 'entity', response);
26
+ if (!entity) {
68
27
  return { domains: [] };
69
28
  }
70
29
 
71
- // Normalize once: entity keys may be any casing (SMS/sms/rcs) but downstream branches use CHANNELS.* (uppercase).
72
- const normalizedChannel =
73
- channel == null || String(channel).trim() === ''
74
- ? ''
75
- : String(channel).trim().toUpperCase();
76
-
77
- // Single-channel API: entity may be { [channel]: [...] } or direct array.
78
- // Some responses use different casing (e.g. rcs vs RCS) or a single domain object instead of an array.
79
- let channelSenderDetails =
80
- get(entity, channel, null)
81
- ?? (normalizedChannel ? get(entity, normalizedChannel, null) : null)
82
- ?? (normalizedChannel ? get(entity, normalizedChannel.toLowerCase(), null) : null);
83
-
30
+ // Single-channel API: entity may be { [channel]: [...] } or direct array
31
+ let channelSenderDetails = get(entity, channel, null);
84
32
  if (channelSenderDetails == null && Array.isArray(entity)) {
85
33
  channelSenderDetails = entity;
86
34
  }
87
-
88
- if (channelSenderDetails != null && !Array.isArray(channelSenderDetails)) {
89
- const single = channelSenderDetails;
90
- if (single && typeof single === 'object' && single.domainProperties) {
91
- channelSenderDetails = [single];
92
- } else {
93
- return { domains: [] };
94
- }
95
- }
96
-
97
35
  if (!Array.isArray(channelSenderDetails)) {
98
36
  return { domains: [] };
99
37
  }
@@ -104,7 +42,6 @@ export function parseSenderDetailsResponse(channel, response) {
104
42
  const { id: dgmId, priority, domainProperties = {} } = element;
105
43
  const {
106
44
  domainName,
107
- hostName,
108
45
  id = -1,
109
46
  contactInfo,
110
47
  connectionProperties: {
@@ -114,25 +51,21 @@ export function parseSenderDetailsResponse(channel, response) {
114
51
  } = {},
115
52
  } = domainProperties;
116
53
 
117
- const resolvedDomainName = domainName || hostName;
118
-
119
54
  const domain = {
120
55
  dgmId,
121
- domainName: resolvedDomainName,
56
+ domainName,
122
57
  domainId: id,
123
58
  priority: priority != null ? priority : 0,
124
59
  };
125
60
 
126
- if ([CHANNELS.SMS, CHANNELS.WHATSAPP, CHANNELS.RCS].includes(normalizedChannel)) {
61
+ if ([CHANNELS.SMS, CHANNELS.WHATSAPP].includes(channel)) {
127
62
  domain.cdmaSenders = getSenderOptions(contactInfo, 'cdma_sender_id');
128
- domain.gsmSenders = normalizedChannel === CHANNELS.RCS
129
- ? getRcsLikeGsmSenders(contactInfo)
130
- : getSenderOptions(contactInfo, 'gsm_sender_id');
63
+ domain.gsmSenders = getSenderOptions(contactInfo, 'gsm_sender_id');
131
64
  domain.sourceAccountIdentifier =
132
65
  sourceAccountIdentifier || wabaId || userid || '';
133
66
  }
134
67
 
135
- if (normalizedChannel === CHANNELS.EMAIL) {
68
+ if (channel === CHANNELS.EMAIL) {
136
69
  domain.emailSenders = getSenderOptions(contactInfo, 'sender_id');
137
70
  domain.emailRepliers = getSenderOptions(contactInfo, 'reply_to_id');
138
71
  }
@@ -143,8 +76,7 @@ export function parseSenderDetailsResponse(channel, response) {
143
76
  // Sort by priority and dedupe by domainName (match campaigns behaviour)
144
77
  domains.sort((a, b) => (a.priority || 0) - (b.priority || 0));
145
78
  const deduped = domains.reduce((acc, domain) => {
146
- const key = domain.domainName ?? domain.domainId;
147
- if (!acc.find((existing) => (existing.domainName ?? existing.domainId) === key)) {
79
+ if (!acc.find((d) => d.domainName === domain.domainName)) {
148
80
  acc.push(domain);
149
81
  }
150
82
  return acc;
@@ -6,13 +6,12 @@ import CapButton from '@capillarytech/cap-ui-library/CapButton';
6
6
  import CapHeader from '@capillarytech/cap-ui-library/CapHeader';
7
7
  import CapStepsAccordian from '@capillarytech/cap-ui-library/CapStepsAccordian';
8
8
  import CapTreeSelect from '@capillarytech/cap-ui-library/CapTreeSelect';
9
- import CapSelect from '@capillarytech/cap-ui-library/CapSelect';
10
9
  import isEmpty from 'lodash/isEmpty';
11
10
  import messages from './messages';
12
11
  import DeliverySettings from './DeliverySettings';
13
12
  import { CHANNELS } from './constants';
14
13
 
15
- const CHANNELS_WITH_DELIVERY_SETTINGS = [CHANNELS.SMS, CHANNELS.EMAIL, CHANNELS.WHATSAPP, CHANNELS.RCS];
14
+ const CHANNELS_WITH_DELIVERY_SETTINGS = [CHANNELS.SMS, CHANNELS.EMAIL, CHANNELS.WHATSAPP];
16
15
 
17
16
  const SendTestMessage = ({
18
17
  isFetchingTestCustomers,
@@ -25,89 +24,64 @@ const SendTestMessage = ({
25
24
  channel,
26
25
  isSendingTestMessage,
27
26
  formatMessage,
28
- renderAddTestCustomerButton,
29
- searchValue,
30
- setSearchValue,
31
27
  deliverySettings,
32
- senderDetailsByChannel = {},
28
+ senderDetailsOptions,
33
29
  wecrmAccounts,
34
30
  onSaveDeliverySettings,
35
31
  isLoadingSenderDetails,
36
32
  smsTraiDltEnabled,
37
33
  registeredSenderIds,
38
- isChannelSmsFallbackPreviewEnabled,
39
- }) => {
40
- const addCustomerContent = renderAddTestCustomerButton ? renderAddTestCustomerButton() : null;
41
- return (
42
- <CapStepsAccordian
43
- showNumberSteps={false}
44
- isChevronIcon
45
- expandIconPosition="right"
46
- items={[
47
- {
48
- header: (
49
- <CapHeader
50
- size="regular"
51
- description={<FormattedMessage {...messages.testMessageDescription} />}
52
- title={<FormattedMessage {...messages.sendTestMessage} />}
34
+ }) => (
35
+ <CapStepsAccordian
36
+ showNumberSteps={false}
37
+ isChevronIcon
38
+ expandIconPosition="right"
39
+ items={[
40
+ {
41
+ header: <CapHeader
42
+ size="regular"
43
+ description={<FormattedMessage {...messages.testMessageDescription} />}
44
+ title={<FormattedMessage {...messages.sendTestMessage} />}
45
+ />,
46
+ content: (
47
+ <CapRow className="send-test-content">
48
+ <CapHeader size="label1" title={<FormattedMessage {...messages.testCustomers} />} />
49
+ <CapTreeSelect
50
+ className="test-customers-tree-select"
51
+ loading={isFetchingTestCustomers || isFetchingTestGroups}
52
+ treeData={testEntitiesTreeData}
53
+ onChange={handleTestEntitiesChange}
54
+ value={selectedTestEntities}
55
+ multiple
56
+ placeholder={formatMessage(messages.testCustomersPlaceholder)}
53
57
  />
54
- ),
55
- content: (
56
- <CapRow className="send-test-content">
57
- <CapHeader size="label1" title={<FormattedMessage {...messages.testCustomers} />} />
58
- <CapTreeSelect
59
- className="test-customers-tree-select"
60
- dropdownMatchSelectWidth
61
- dropdownClassName="test-customers-tree-select-dropdown"
62
- listHeight={280}
63
- loading={isFetchingTestCustomers || isFetchingTestGroups}
64
- treeData={testEntitiesTreeData}
65
- onChange={handleTestEntitiesChange}
66
- value={selectedTestEntities}
67
- showSearch
68
- searchValue={searchValue}
69
- onSearch={setSearchValue}
70
- treeNodeFilterProp="title"
71
- {...(addCustomerContent ? { notFoundContent: addCustomerContent } : {})}
72
- multiple
73
- placeholder={formatMessage(messages.testCustomersPlaceholder)}
74
- dropdownStyle={{ zIndex: 900, maxHeight: 320 }}
75
- placement="bottomLeft"
76
- getPopupContainer={(node) => node.closest('.send-test-section') || document.body}
58
+ {CHANNELS_WITH_DELIVERY_SETTINGS.includes(channel) && (
59
+ <DeliverySettings
60
+ channel={channel}
61
+ deliverySettings={deliverySettings || {}}
62
+ senderDetailsOptions={senderDetailsOptions || []}
63
+ wecrmAccounts={wecrmAccounts || []}
64
+ onSaveDeliverySettings={onSaveDeliverySettings}
65
+ isLoadingSenderDetails={isLoadingSenderDetails}
66
+ formatMessage={formatMessage}
67
+ smsTraiDltEnabled={smsTraiDltEnabled}
68
+ registeredSenderIds={registeredSenderIds}
69
+ whatsappAccountFromForm={
70
+ channel === CHANNELS.WHATSAPP && formData?.accountName
71
+ ? { accountName: formData.accountName }
72
+ : undefined
73
+ }
77
74
  />
78
- {CHANNELS_WITH_DELIVERY_SETTINGS.includes(channel) && (
79
- <DeliverySettings
80
- channel={channel}
81
- deliverySettings={deliverySettings || {}}
82
- senderDetailsByChannel={senderDetailsByChannel}
83
- wecrmAccounts={wecrmAccounts || []}
84
- onSaveDeliverySettings={onSaveDeliverySettings}
85
- isLoadingSenderDetails={isLoadingSenderDetails}
86
- formatMessage={formatMessage}
87
- smsTraiDltEnabled={smsTraiDltEnabled}
88
- registeredSenderIds={registeredSenderIds}
89
- isChannelSmsFallbackPreviewEnabled={isChannelSmsFallbackPreviewEnabled}
90
- whatsappAccountFromForm={
91
- channel === CHANNELS.WHATSAPP && formData?.accountName
92
- ? { accountName: formData.accountName }
93
- : undefined
94
- }
95
- />
96
- )}
97
- <CapButton
98
- onClick={handleSendTestMessage}
99
- disabled={isEmpty(selectedTestEntities) || isSendingTestMessage}
100
- >
101
- <FormattedMessage {...messages.sendTestButton} />
102
- </CapButton>
103
- </CapRow>
104
- ),
105
- key: 1,
106
- },
107
- ]}
108
- />
109
- );
110
- };
75
+ )}
76
+ <CapButton onClick={handleSendTestMessage} disabled={isEmpty(selectedTestEntities) || isSendingTestMessage}>
77
+ <FormattedMessage {...messages.sendTestButton} />
78
+ </CapButton>
79
+ </CapRow>),
80
+ key: 1,
81
+ },
82
+ ]}
83
+ />
84
+ );
111
85
 
112
86
  SendTestMessage.propTypes = {
113
87
  isFetchingTestCustomers: PropTypes.bool.isRequired,
@@ -120,33 +94,25 @@ SendTestMessage.propTypes = {
120
94
  channel: PropTypes.string,
121
95
  isSendingTestMessage: PropTypes.bool.isRequired,
122
96
  formatMessage: PropTypes.func.isRequired,
123
- renderAddTestCustomerButton: PropTypes.func,
124
- searchValue: PropTypes.string,
125
- setSearchValue: PropTypes.func,
126
97
  deliverySettings: PropTypes.object,
127
- senderDetailsByChannel: PropTypes.object,
98
+ senderDetailsOptions: PropTypes.array,
128
99
  wecrmAccounts: PropTypes.array,
129
100
  onSaveDeliverySettings: PropTypes.func,
130
101
  isLoadingSenderDetails: PropTypes.bool,
131
102
  smsTraiDltEnabled: PropTypes.bool,
132
103
  registeredSenderIds: PropTypes.array,
133
- isChannelSmsFallbackPreviewEnabled: PropTypes.bool,
134
104
  };
135
105
 
136
106
  SendTestMessage.defaultProps = {
137
107
  formData: undefined,
138
108
  channel: undefined,
139
- renderAddTestCustomerButton: undefined,
140
- searchValue: '',
141
- setSearchValue: () => {}, // no-op when not provided; required by TreeSelect when showSearch is true
142
109
  deliverySettings: {},
143
- senderDetailsByChannel: {},
110
+ senderDetailsOptions: [],
144
111
  wecrmAccounts: [],
145
112
  onSaveDeliverySettings: undefined,
146
113
  isLoadingSenderDetails: false,
147
114
  smsTraiDltEnabled: false,
148
115
  registeredSenderIds: [],
149
- isChannelSmsFallbackPreviewEnabled: false,
150
116
  };
151
117
 
152
118
  export default SendTestMessage;
@@ -11,6 +11,7 @@
11
11
  height: 100%;
12
12
  display: flex;
13
13
  flex-direction: column;
14
+ background: $CAP_WHITE;
14
15
  overflow: hidden;
15
16
 
16
17
  // Preview Chrome wrapper (matches old TestAndPreviewSlidebox design)
@@ -61,27 +62,7 @@
61
62
  }
62
63
  }
63
64
  }
64
-
65
- .unified-preview.unified-preview-rcs-tabs {
66
- .ant-tabs-nav {
67
- margin: 0;
68
- padding: 0 $CAP_SPACE_16;
69
- }
70
65
 
71
- // Prevent white hover/active backgrounds from default antd styles
72
- .ant-tabs-tab,
73
- .ant-tabs-tab:hover,
74
- .ant-tabs-tab-active {
75
- background: transparent;
76
- }
77
-
78
- .ant-tabs-tab-btn,
79
- .ant-tabs-tab-btn:hover,
80
- .ant-tabs-tab-btn:active {
81
- background: transparent;
82
- }
83
- }
84
-
85
66
  // Preview Content Container
86
67
  .preview-content-container {
87
68
  flex: 1;
@@ -21,21 +21,8 @@ import InAppPreviewContent from './InAppPreviewContent';
21
21
  import MobilePushPreviewContent from './MobilePushPreviewContent';
22
22
  import ViberPreviewContent from './ViberPreviewContent';
23
23
  import ZaloPreviewContent from './ZaloPreviewContent';
24
- import CapTab from '@capillarytech/cap-ui-library/CapTab';
25
- import {
26
- CHANNELS,
27
- DESKTOP,
28
- TABLET,
29
- MOBILE,
30
- ANDROID,
31
- IOS,
32
- PREVIEW_TAB_RCS,
33
- PREVIEW_TAB_SMS_FALLBACK,
34
- PREVIEW_TAB_KEYS,
35
- RCS_SMS_FALLBACK_VAR_MAPPED_PROP,
36
- } from '../constants';
24
+ import { CHANNELS, DESKTOP, TABLET, MOBILE, ANDROID, IOS } from '../constants';
37
25
  import messages from '../messages';
38
- import { getFallbackResolvedContent } from '../../../utils/templateVarUtils';
39
26
  import './_unifiedPreview.scss';
40
27
 
41
28
  const UnifiedPreview = ({
@@ -51,24 +38,7 @@ const UnifiedPreview = ({
51
38
  lastModified,
52
39
  updatedByName,
53
40
  showHeader, // Default to true for Test and Preview flow, false for channel component previews
54
- smsFallbackContent,
55
- smsFallbackResolvedText,
56
- activePreviewTab,
57
- onPreviewTabChange,
58
41
  }) => {
59
- const hasFallbackSmsTemplate = !!(smsFallbackContent?.templateContent || smsFallbackContent?.content);
60
- const showRcsSmsFallbackTabs = channel === CHANNELS.RCS && hasFallbackSmsTemplate;
61
- const rawFallbackTemplate = smsFallbackContent?.templateContent ?? smsFallbackContent?.content ?? '';
62
- const rcsFallbackVarMapped = smsFallbackContent?.[RCS_SMS_FALLBACK_VAR_MAPPED_PROP] ?? {};
63
- const hasRcsFallbackVarMapped = Object.keys(rcsFallbackVarMapped).length > 0;
64
- // When no varmap is present, show raw template so {{tags}} remain visible in the preview.
65
- // Only apply slot substitution when varmap entries exist or a resolved text is available.
66
- const smsFallbackDisplayContent =
67
- smsFallbackResolvedText != null && smsFallbackResolvedText !== ''
68
- ? smsFallbackResolvedText
69
- : hasRcsFallbackVarMapped
70
- ? getFallbackResolvedContent(rawFallbackTemplate, rcsFallbackVarMapped)
71
- : rawFallbackTemplate;
72
42
  /**
73
43
  * Render channel-specific preview content
74
44
  * For Phase 5, we'll render placeholders
@@ -154,21 +124,6 @@ const UnifiedPreview = ({
154
124
  case CHANNELS.RCS: {
155
125
  // RCS content is an object with rcsTitle, rcsDesc, rcsImageSrc, suggestions, etc.
156
126
  const rcsContent = typeof content === 'object' ? content : {};
157
-
158
- if (showRcsSmsFallbackTabs && activePreviewTab === PREVIEW_TAB_SMS_FALLBACK) {
159
- return (
160
- <SmsPreviewContent
161
- content={smsFallbackDisplayContent}
162
- device={ANDROID}
163
- isUpdating={isUpdating}
164
- error={error}
165
- formatMessage={formatMessage}
166
- senderId={smsFallbackContent?.senderId}
167
- showHeader={showHeader}
168
- />
169
- );
170
- }
171
-
172
127
  return (
173
128
  <RcsPreviewContent
174
129
  content={rcsContent}
@@ -313,79 +268,6 @@ const UnifiedPreview = ({
313
268
  * PreviewHeader is shown only when showHeader is true (for Test and Preview flow)
314
269
  * Channel-specific content will be in separate files in future phases
315
270
  */
316
- if (showRcsSmsFallbackTabs) {
317
- const renderPane = ({ paneChannel, paneDevice, paneShowDeviceToggle, paneContent }) => (
318
- <CapRow className="unified-preview-tab-pane">
319
- {showHeader && (
320
- <PreviewHeader
321
- selectedCustomer={selectedCustomer}
322
- device={paneDevice}
323
- showDeviceToggle={paneShowDeviceToggle}
324
- onDeviceChange={onDeviceChange}
325
- channel={paneChannel}
326
- />
327
- )}
328
-
329
- <CapRow className={`preview-content-container ${!showHeader ? 'preview-content-container-no-header' : ''}`}>
330
- {paneContent}
331
- </CapRow>
332
-
333
-
334
- </CapRow>
335
- );
336
-
337
- return (
338
- <CapRow className="unified-preview unified-preview-rcs-tabs">
339
- <CapTab
340
- activeKey={activePreviewTab}
341
- onChange={onPreviewTabChange}
342
- panes={[
343
- {
344
- tab: formatMessage(messages.rcsTab),
345
- key: PREVIEW_TAB_RCS,
346
- content: renderPane({
347
- paneChannel: CHANNELS.RCS,
348
- paneDevice: device,
349
- paneShowDeviceToggle: showDeviceToggle,
350
- paneContent: (
351
- <RcsPreviewContent
352
- content={typeof content === 'object' ? content : {}}
353
- device={device}
354
- isUpdating={isUpdating}
355
- error={error}
356
- formatMessage={formatMessage}
357
- senderId={content?.senderId}
358
- showHeader={showHeader}
359
- />
360
- ),
361
- }),
362
- },
363
- {
364
- tab: formatMessage(messages.smsFallbackTab),
365
- key: PREVIEW_TAB_SMS_FALLBACK,
366
- content: renderPane({
367
- paneChannel: CHANNELS.SMS,
368
- paneDevice: device,
369
- paneShowDeviceToggle: showDeviceToggle,
370
- paneContent: (
371
- <SmsPreviewContent
372
- content={smsFallbackDisplayContent}
373
- device={device}
374
- isUpdating={isUpdating}
375
- error={error}
376
- formatMessage={formatMessage}
377
- senderId={smsFallbackContent?.senderId}
378
- showHeader={showHeader}
379
- />
380
- ),
381
- }),
382
- },
383
- ]}
384
- />
385
- </CapRow>
386
- );
387
- }
388
-
389
271
  return (
390
272
  <CapRow className="unified-preview">
391
273
  {/* PreviewHeader - shown only in Test and Preview flow, hidden in channel component previews */}
@@ -423,7 +305,9 @@ const UnifiedPreview = ({
423
305
  )}
424
306
  {updatedByName && (
425
307
  <span className="metadata-item">
426
- {formatMessage(messages.byAuthor, { name: updatedByName })}
308
+ {formatMessage(messages.by)}
309
+ {' '}
310
+ {updatedByName}
427
311
  </span>
428
312
  )}
429
313
  </CapRow>
@@ -464,15 +348,6 @@ UnifiedPreview.propTypes = {
464
348
 
465
349
  // Header display
466
350
  showHeader: PropTypes.bool, // Show PreviewHeader (true for Test and Preview flow, false for channel component previews)
467
-
468
- // RCS: SMS fallback preview support (same shape as SmsFallback / RCS smsFallbackData)
469
- smsFallbackContent: PropTypes.shape({
470
- templateContent: PropTypes.string,
471
- senderId: PropTypes.string,
472
- templateName: PropTypes.string,
473
- }),
474
- activePreviewTab: PropTypes.oneOf(PREVIEW_TAB_KEYS),
475
- onPreviewTabChange: PropTypes.func,
476
351
  };
477
352
 
478
353
  UnifiedPreview.defaultProps = {
@@ -485,10 +360,6 @@ UnifiedPreview.defaultProps = {
485
360
  lastModified: null,
486
361
  updatedByName: null,
487
362
  showHeader: true, // Default to true for Test and Preview flow
488
- smsFallbackContent: null,
489
- smsFallbackResolvedText: undefined,
490
- activePreviewTab: PREVIEW_TAB_RCS,
491
- onPreviewTabChange: () => {},
492
363
  };
493
364
 
494
365
  export default UnifiedPreview;