@capillarytech/creatives-library 8.0.298 → 8.0.299-alpha.4
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.
- package/package.json +1 -1
- package/services/api.js +17 -0
- package/services/tests/api.test.js +85 -0
- package/utils/commonUtils.js +10 -0
- package/utils/tests/commonUtil.test.js +169 -0
- package/v2Components/CommonTestAndPreview/AddTestCustomer.js +42 -0
- package/v2Components/CommonTestAndPreview/CustomerCreationModal.js +284 -0
- package/v2Components/CommonTestAndPreview/ExistingCustomerModal.js +72 -0
- package/v2Components/CommonTestAndPreview/SendTestMessage.js +78 -49
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +200 -4
- package/v2Components/CommonTestAndPreview/actions.js +10 -0
- package/v2Components/CommonTestAndPreview/constants.js +18 -1
- package/v2Components/CommonTestAndPreview/index.js +274 -14
- package/v2Components/CommonTestAndPreview/messages.js +94 -0
- package/v2Components/CommonTestAndPreview/reducer.js +10 -0
- package/v2Components/CommonTestAndPreview/tests/AddTestCustomer.test.js +66 -0
- package/v2Components/CommonTestAndPreview/tests/CommonTestAndPreview.addTestCustomer.test.js +653 -0
- package/v2Components/CommonTestAndPreview/tests/CustomerCreationModal.test.js +316 -0
- package/v2Components/CommonTestAndPreview/tests/ExistingCustomerModal.test.js +114 -0
- package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +53 -0
- package/v2Components/CommonTestAndPreview/tests/constants.test.js +25 -2
- package/v2Components/CommonTestAndPreview/tests/index.test.js +7 -0
- package/v2Components/CommonTestAndPreview/tests/reducer.test.js +71 -0
- package/v2Components/CommonTestAndPreview/tests/selectors.test.js +17 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +1588 -1336
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +369 -306
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +9 -3
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +5794 -5080
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import CapModal from "@capillarytech/cap-ui-library/CapModal";
|
|
2
|
+
import { FormattedMessage, injectIntl } from "react-intl";
|
|
3
|
+
import messages from "./messages";
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
import { CapCard, CapRow, CapColumn, CapLabel } from "@capillarytech/cap-ui-library";
|
|
6
|
+
import { CHANNELS } from "./constants";
|
|
7
|
+
import CapButton from "@capillarytech/cap-ui-library/CapButton";
|
|
8
|
+
import CapIcon from "@capillarytech/cap-ui-library/CapIcon";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const ExistingCustomerModal = ({ customerModal, setCustomerModal, customerData, channel, onSave, intl }) => {
|
|
12
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
+
return (
|
|
14
|
+
<CapModal
|
|
15
|
+
visible={customerModal[0]}
|
|
16
|
+
onCancel={() => setCustomerModal([false, ""])}
|
|
17
|
+
centered={true}
|
|
18
|
+
width={500}
|
|
19
|
+
maskStyle={{ backgroundColor: 'rgba(244, 245, 247, 0.9)' }}
|
|
20
|
+
footer={
|
|
21
|
+
<CapRow justify="start">
|
|
22
|
+
<CapButton
|
|
23
|
+
type="primary"
|
|
24
|
+
onClick={() => onSave({},setIsLoading)}
|
|
25
|
+
loading={isLoading}
|
|
26
|
+
>
|
|
27
|
+
<FormattedMessage {...messages.saveButton} />
|
|
28
|
+
</CapButton>
|
|
29
|
+
<CapButton
|
|
30
|
+
type="secondary"
|
|
31
|
+
onClick={() => setCustomerModal([false, ""])}
|
|
32
|
+
disabled={isLoading}
|
|
33
|
+
>
|
|
34
|
+
<FormattedMessage {...messages.cancelButton} />
|
|
35
|
+
</CapButton>
|
|
36
|
+
</CapRow>
|
|
37
|
+
}
|
|
38
|
+
title={intl.formatMessage(messages.customerCreationModalTitle)}
|
|
39
|
+
wrapClassName="common-test-preview-modal-wrap existing-customer-modal-wrap"
|
|
40
|
+
className="common-test-preview-modal"
|
|
41
|
+
>
|
|
42
|
+
<div className="existing-customer-modal">
|
|
43
|
+
<CapRow className="existing-customer-modal-intro-row">
|
|
44
|
+
<FormattedMessage {...messages.existingCustomerModalDescription} />
|
|
45
|
+
</CapRow>
|
|
46
|
+
<CapCard className="existing-customer-modal-card">
|
|
47
|
+
<CapRow className="existing-customer-modal-card-row">
|
|
48
|
+
<CapColumn className="existing-customer-modal-avatar">
|
|
49
|
+
<CapIcon type="user-profile" className="existing-customer-modal-avatar-icon" />
|
|
50
|
+
</CapColumn>
|
|
51
|
+
<CapColumn className="existing-customer-modal-details">
|
|
52
|
+
<CapRow className="existing-customer-modal-name">
|
|
53
|
+
{customerData.name || "-"}
|
|
54
|
+
</CapRow>
|
|
55
|
+
<CapColumn className="existing-customer-modal-meta">
|
|
56
|
+
{channel === CHANNELS.EMAIL && customerData.email && (
|
|
57
|
+
<CapRow><span className="existing-customer-modal-meta-label"><FormattedMessage {...messages.customerEmail} />: </span> {customerData.email}</CapRow>
|
|
58
|
+
)}
|
|
59
|
+
{channel === CHANNELS.SMS && customerData.mobile && (
|
|
60
|
+
<CapRow><span className="existing-customer-modal-meta-label"><FormattedMessage {...messages.customerMobile} />: </span>{customerData.mobile}</CapRow>
|
|
61
|
+
)}
|
|
62
|
+
<CapRow><span className="existing-customer-modal-meta-label"><FormattedMessage {...messages.customerID} />: </span>{customerData.customerId}</CapRow>
|
|
63
|
+
</CapColumn>
|
|
64
|
+
</CapColumn>
|
|
65
|
+
</CapRow>
|
|
66
|
+
</CapCard>
|
|
67
|
+
</div>
|
|
68
|
+
</CapModal>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default injectIntl(ExistingCustomerModal);
|
|
@@ -24,6 +24,9 @@ const SendTestMessage = ({
|
|
|
24
24
|
channel,
|
|
25
25
|
isSendingTestMessage,
|
|
26
26
|
formatMessage,
|
|
27
|
+
renderAddTestCustomerButton,
|
|
28
|
+
searchValue,
|
|
29
|
+
setSearchValue,
|
|
27
30
|
deliverySettings,
|
|
28
31
|
senderDetailsOptions,
|
|
29
32
|
wecrmAccounts,
|
|
@@ -31,57 +34,77 @@ const SendTestMessage = ({
|
|
|
31
34
|
isLoadingSenderDetails,
|
|
32
35
|
smsTraiDltEnabled,
|
|
33
36
|
registeredSenderIds,
|
|
34
|
-
}) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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)}
|
|
37
|
+
}) => {
|
|
38
|
+
const addCustomerContent = renderAddTestCustomerButton ? renderAddTestCustomerButton() : null;
|
|
39
|
+
return (
|
|
40
|
+
<CapStepsAccordian
|
|
41
|
+
showNumberSteps={false}
|
|
42
|
+
isChevronIcon
|
|
43
|
+
expandIconPosition="right"
|
|
44
|
+
items={[
|
|
45
|
+
{
|
|
46
|
+
header: (
|
|
47
|
+
<CapHeader
|
|
48
|
+
size="regular"
|
|
49
|
+
description={<FormattedMessage {...messages.testMessageDescription} />}
|
|
50
|
+
title={<FormattedMessage {...messages.sendTestMessage} />}
|
|
57
51
|
/>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
52
|
+
),
|
|
53
|
+
content: (
|
|
54
|
+
<CapRow className="send-test-content">
|
|
55
|
+
<CapHeader size="label1" title={<FormattedMessage {...messages.testCustomers} />} />
|
|
56
|
+
<CapTreeSelect
|
|
57
|
+
className="test-customers-tree-select"
|
|
58
|
+
dropdownMatchSelectWidth
|
|
59
|
+
dropdownClassName="test-customers-tree-select-dropdown"
|
|
60
|
+
listHeight={280}
|
|
61
|
+
loading={isFetchingTestCustomers || isFetchingTestGroups}
|
|
62
|
+
treeData={testEntitiesTreeData}
|
|
63
|
+
onChange={handleTestEntitiesChange}
|
|
64
|
+
value={selectedTestEntities}
|
|
65
|
+
showSearch
|
|
66
|
+
searchValue={searchValue}
|
|
67
|
+
onSearch={setSearchValue}
|
|
68
|
+
treeNodeFilterProp="title"
|
|
69
|
+
{...(addCustomerContent ? { notFoundContent: addCustomerContent } : {})}
|
|
70
|
+
multiple
|
|
71
|
+
placeholder={formatMessage(messages.testCustomersPlaceholder)}
|
|
72
|
+
dropdownStyle={{ zIndex: 900, maxHeight: 320 }}
|
|
73
|
+
placement="bottomLeft"
|
|
74
|
+
getPopupContainer={(node) => node.closest('.send-test-section') || document.body}
|
|
74
75
|
/>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
{CHANNELS_WITH_DELIVERY_SETTINGS.includes(channel) && (
|
|
77
|
+
<DeliverySettings
|
|
78
|
+
channel={channel}
|
|
79
|
+
deliverySettings={deliverySettings || {}}
|
|
80
|
+
senderDetailsOptions={senderDetailsOptions || []}
|
|
81
|
+
wecrmAccounts={wecrmAccounts || []}
|
|
82
|
+
onSaveDeliverySettings={onSaveDeliverySettings}
|
|
83
|
+
isLoadingSenderDetails={isLoadingSenderDetails}
|
|
84
|
+
formatMessage={formatMessage}
|
|
85
|
+
smsTraiDltEnabled={smsTraiDltEnabled}
|
|
86
|
+
registeredSenderIds={registeredSenderIds}
|
|
87
|
+
whatsappAccountFromForm={
|
|
88
|
+
channel === CHANNELS.WHATSAPP && formData?.accountName
|
|
89
|
+
? { accountName: formData.accountName }
|
|
90
|
+
: undefined
|
|
91
|
+
}
|
|
92
|
+
/>
|
|
93
|
+
)}
|
|
94
|
+
<CapButton
|
|
95
|
+
onClick={handleSendTestMessage}
|
|
96
|
+
disabled={isEmpty(selectedTestEntities) || isSendingTestMessage}
|
|
97
|
+
>
|
|
98
|
+
<FormattedMessage {...messages.sendTestButton} />
|
|
99
|
+
</CapButton>
|
|
100
|
+
</CapRow>
|
|
101
|
+
),
|
|
102
|
+
key: 1,
|
|
103
|
+
},
|
|
104
|
+
]}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
85
108
|
|
|
86
109
|
SendTestMessage.propTypes = {
|
|
87
110
|
isFetchingTestCustomers: PropTypes.bool.isRequired,
|
|
@@ -94,6 +117,9 @@ SendTestMessage.propTypes = {
|
|
|
94
117
|
channel: PropTypes.string,
|
|
95
118
|
isSendingTestMessage: PropTypes.bool.isRequired,
|
|
96
119
|
formatMessage: PropTypes.func.isRequired,
|
|
120
|
+
renderAddTestCustomerButton: PropTypes.func,
|
|
121
|
+
searchValue: PropTypes.string,
|
|
122
|
+
setSearchValue: PropTypes.func,
|
|
97
123
|
deliverySettings: PropTypes.object,
|
|
98
124
|
senderDetailsOptions: PropTypes.array,
|
|
99
125
|
wecrmAccounts: PropTypes.array,
|
|
@@ -106,6 +132,9 @@ SendTestMessage.propTypes = {
|
|
|
106
132
|
SendTestMessage.defaultProps = {
|
|
107
133
|
formData: undefined,
|
|
108
134
|
channel: undefined,
|
|
135
|
+
renderAddTestCustomerButton: undefined,
|
|
136
|
+
searchValue: '',
|
|
137
|
+
setSearchValue: undefined,
|
|
109
138
|
deliverySettings: {},
|
|
110
139
|
senderDetailsOptions: [],
|
|
111
140
|
wecrmAccounts: [],
|
|
@@ -5,6 +5,158 @@
|
|
|
5
5
|
*/
|
|
6
6
|
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
7
7
|
|
|
8
|
+
/* All ant overrides scoped under wrapper to avoid affecting other modals. */
|
|
9
|
+
.common-test-preview-modal-wrap {
|
|
10
|
+
z-index: 10000 !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Notifications rendered inside slidebox (getContainer) so they appear in campaigns/library mode */
|
|
14
|
+
.common-test-and-preview-notification-container {
|
|
15
|
+
.ant-notification {
|
|
16
|
+
z-index: 10001;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Lookup spinner overlay above test-customers dropdown. */
|
|
21
|
+
.common-test-preview-lookup-spin {
|
|
22
|
+
position: relative;
|
|
23
|
+
z-index: 1000;
|
|
24
|
+
|
|
25
|
+
.ant-spin-container::after {
|
|
26
|
+
z-index: 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* When customer lookup is loading, dropdown renders inside .send-test-section; lower it so spinner is on top. */
|
|
31
|
+
.common-test-preview-customer-loading .test-customers-tree-select-dropdown {
|
|
32
|
+
z-index: 0 !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Customer creation modal content – avoid inline styles */
|
|
36
|
+
.common-test-preview-modal {
|
|
37
|
+
color: $CAP_G01 !important;
|
|
38
|
+
.ant-modal-content {
|
|
39
|
+
width: 28.5rem; /* 456px at 16px root */
|
|
40
|
+
}
|
|
41
|
+
.ant-modal-footer {
|
|
42
|
+
text-align: left;
|
|
43
|
+
margin-left: 0.625rem; /* 10px at 16px root */
|
|
44
|
+
margin-top: 0.9375rem; /* 15px at 16px root */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.customer-creation-modal-row {
|
|
48
|
+
margin-bottom: $CAP_SPACE_16;
|
|
49
|
+
|
|
50
|
+
&--last {
|
|
51
|
+
margin-bottom: $CAP_SPACE_24;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.customer-creation-modal-description {
|
|
56
|
+
color: $CAP_G01;
|
|
57
|
+
font-size: $FONT_SIZE_M;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.customer-creation-modal-label {
|
|
61
|
+
margin-bottom: $CAP_SPACE_04;
|
|
62
|
+
display: block;
|
|
63
|
+
font-size: $FONT_SIZE_M;
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
color: $CAP_G01;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.customer-creation-modal-optional {
|
|
69
|
+
color: $CAP_G06;
|
|
70
|
+
font-weight: normal;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.customer-creation-modal-input {
|
|
74
|
+
width: 100%;
|
|
75
|
+
color: $CAP_G01;
|
|
76
|
+
|
|
77
|
+
&.has-error {
|
|
78
|
+
color: $CAP_COLOR_03 !important;
|
|
79
|
+
.ant-input {
|
|
80
|
+
border-color: $CAP_COLOR_03 !important;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.customer-creation-modal-validation-error {
|
|
86
|
+
color: $CAP_COLOR_03;
|
|
87
|
+
font-size: $FONT_SIZE_S;
|
|
88
|
+
margin-top: $CAP_SPACE_04;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Existing customer modal content */
|
|
92
|
+
.existing-customer-modal {
|
|
93
|
+
&-intro-row {
|
|
94
|
+
margin-bottom: $CAP_SPACE_16;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ant-card-body {
|
|
98
|
+
padding: 1rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&-card {
|
|
102
|
+
border-radius: $CAP_SPACE_08;
|
|
103
|
+
border: $CAP_SPACE_01 solid $CAP_G06;
|
|
104
|
+
padding: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&-card-row {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: flex-start;
|
|
110
|
+
padding: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&-avatar {
|
|
114
|
+
width: 3rem; /* 48px at 16px root */
|
|
115
|
+
height: 3rem;
|
|
116
|
+
border-radius: 1.25rem; /* 20px at 16px root */
|
|
117
|
+
background-color: $CAP_G07;
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
margin-top: $CAP_SPACE_04;
|
|
122
|
+
margin-right: $CAP_SPACE_16;
|
|
123
|
+
flex-shrink: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&-avatar-icon {
|
|
127
|
+
font-size: $CAP_SPACE_24;
|
|
128
|
+
color: $CAP_G01;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&-details {
|
|
132
|
+
flex: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&-name {
|
|
136
|
+
font-size: $FONT_SIZE_L;
|
|
137
|
+
font-weight: 500;
|
|
138
|
+
color: $CAP_G01;
|
|
139
|
+
margin-bottom: $CAP_SPACE_04;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&-meta {
|
|
143
|
+
font-size: $FONT_SIZE_M;
|
|
144
|
+
color: $CAP_G01;
|
|
145
|
+
line-height: 1.4;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&-meta-label {
|
|
149
|
+
color: $CAP_G04;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
.add-test-customer-icon {
|
|
156
|
+
margin-top: 0.3rem;
|
|
157
|
+
margin-right: 0.5rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
8
160
|
.common-test-and-preview-slidebox {
|
|
9
161
|
.test-preview-header {
|
|
10
162
|
display: flex;
|
|
@@ -54,6 +206,7 @@
|
|
|
54
206
|
|
|
55
207
|
.left-panel {
|
|
56
208
|
width: 40%;
|
|
209
|
+
min-width: 20rem; /* Consistent width in campaigns/library mode so test customer dropdown matches creatives */
|
|
57
210
|
padding-right: 1rem;
|
|
58
211
|
border-right: $CAP_SPACE_01 solid $CAP_G12;
|
|
59
212
|
overflow-y: auto;
|
|
@@ -363,14 +516,26 @@
|
|
|
363
516
|
.ant-collapse-content-box {
|
|
364
517
|
padding-left: 0 !important;
|
|
365
518
|
}
|
|
519
|
+
.send-test-content {
|
|
520
|
+
flex-direction: column;
|
|
521
|
+
align-items: stretch;
|
|
522
|
+
gap: 0;
|
|
523
|
+
}
|
|
366
524
|
.test-customers-tree-select {
|
|
367
525
|
width: 100%;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
526
|
+
min-width: 18rem; /* Consistent dropdown width in campaigns and creatives */
|
|
527
|
+
min-height: $CAP_SPACE_40;
|
|
528
|
+
margin: $CAP_SPACE_12 0 $CAP_SPACE_08;
|
|
529
|
+
.ant-select-selection,
|
|
530
|
+
.ant-select-selector {
|
|
531
|
+
min-height: $CAP_SPACE_40;
|
|
532
|
+
height: auto !important;
|
|
372
533
|
}
|
|
373
534
|
}
|
|
535
|
+
.send-test-content .ant-btn {
|
|
536
|
+
margin-top: $CAP_SPACE_04;
|
|
537
|
+
flex-shrink: 0;
|
|
538
|
+
}
|
|
374
539
|
.ant-select-selection__choice {
|
|
375
540
|
background-color: $CAP_G08;
|
|
376
541
|
border-radius: $CAP_SPACE_04;
|
|
@@ -378,6 +543,37 @@
|
|
|
378
543
|
}
|
|
379
544
|
}
|
|
380
545
|
|
|
546
|
+
// Test customers TreeSelect dropdown: limit height and make scrollable (dropdown renders in portal)
|
|
547
|
+
// min-width so dropdown looks the same in campaigns and creatives
|
|
548
|
+
.test-customers-tree-select-dropdown {
|
|
549
|
+
min-width: 18rem !important;
|
|
550
|
+
max-height: 20rem !important; /* 320px */
|
|
551
|
+
overflow-y: auto !important;
|
|
552
|
+
.ant-select-tree-list-holder-inner {
|
|
553
|
+
overflow: visible;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.test-customer-add-btn {
|
|
558
|
+
width: 100%;
|
|
559
|
+
background-color: transparent !important;
|
|
560
|
+
color: $FONT_COLOR_05 !important;
|
|
561
|
+
white-space: normal;
|
|
562
|
+
word-break: normal;
|
|
563
|
+
overflow-wrap: break-word;
|
|
564
|
+
height: auto;
|
|
565
|
+
|
|
566
|
+
/* Truncate long email/phone in label so it doesn't break mid-string */
|
|
567
|
+
.test-customer-add-btn-value {
|
|
568
|
+
display: inline-block;
|
|
569
|
+
max-width: 12rem;
|
|
570
|
+
overflow: hidden;
|
|
571
|
+
text-overflow: ellipsis;
|
|
572
|
+
white-space: nowrap;
|
|
573
|
+
vertical-align: bottom;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
381
577
|
// Responsive design for smaller screens
|
|
382
578
|
@media (max-width: 54.857rem) {
|
|
383
579
|
.common-test-and-preview-slidebox {
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
CLEAR_PREVIEW_ERRORS,
|
|
21
21
|
GET_SENDER_DETAILS_REQUESTED,
|
|
22
22
|
GET_WECRM_ACCOUNTS_REQUESTED,
|
|
23
|
+
ADD_TEST_CUSTOMER,
|
|
23
24
|
} from './constants';
|
|
24
25
|
|
|
25
26
|
// ============================================
|
|
@@ -92,6 +93,15 @@ export const getTestGroupsRequested = () => ({
|
|
|
92
93
|
type: GET_TEST_GROUPS_REQUESTED,
|
|
93
94
|
});
|
|
94
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Add a test customer to the list (e.g. after adding existing customer so tree shows name)
|
|
98
|
+
* @param {Object} customer - { userId, customerId, name, email, mobile }
|
|
99
|
+
*/
|
|
100
|
+
export const addTestCustomer = (customer) => ({
|
|
101
|
+
type: ADD_TEST_CUSTOMER,
|
|
102
|
+
payload: { customer },
|
|
103
|
+
});
|
|
104
|
+
|
|
95
105
|
/**
|
|
96
106
|
* Create or update message meta configuration
|
|
97
107
|
* @param {Object} payload - Message meta payload
|
|
@@ -33,6 +33,7 @@ export const SEND_TEST_MESSAGE_FAILURE = 'app/CommonTestAndPreview/SEND_TEST_MES
|
|
|
33
33
|
export const GET_TEST_CUSTOMERS_REQUESTED = 'app/CommonTestAndPreview/GET_TEST_CUSTOMERS_REQUESTED';
|
|
34
34
|
export const GET_TEST_CUSTOMERS_SUCCESS = 'app/CommonTestAndPreview/GET_TEST_CUSTOMERS_SUCCESS';
|
|
35
35
|
export const GET_TEST_CUSTOMERS_FAILURE = 'app/CommonTestAndPreview/GET_TEST_CUSTOMERS_FAILURE';
|
|
36
|
+
export const ADD_TEST_CUSTOMER = 'app/CommonTestAndPreview/ADD_TEST_CUSTOMER';
|
|
36
37
|
|
|
37
38
|
// Test Groups
|
|
38
39
|
export const GET_TEST_GROUPS_REQUESTED = 'app/CommonTestAndPreview/GET_TEST_GROUPS_REQUESTED';
|
|
@@ -65,6 +66,12 @@ export const GET_WECRM_ACCOUNTS_REQUESTED = 'app/CommonTestAndPreview/GET_WECRM_
|
|
|
65
66
|
export const GET_WECRM_ACCOUNTS_SUCCESS = 'app/CommonTestAndPreview/GET_WECRM_ACCOUNTS_SUCCESS';
|
|
66
67
|
export const GET_WECRM_ACCOUNTS_FAILURE = 'app/CommonTestAndPreview/GET_WECRM_ACCOUNTS_FAILURE';
|
|
67
68
|
|
|
69
|
+
// ============================================
|
|
70
|
+
// CUSTOMER MODAL TYPE (test customer addition)
|
|
71
|
+
// ============================================
|
|
72
|
+
export const CUSTOMER_MODAL_NEW = 'new';
|
|
73
|
+
export const CUSTOMER_MODAL_EXISTING = 'existing';
|
|
74
|
+
|
|
68
75
|
// ============================================
|
|
69
76
|
// CHANNEL CONSTANTS
|
|
70
77
|
// ============================================
|
|
@@ -100,11 +107,21 @@ export const CLIENT_NAME_CREATIVES = 'CREATIVES';
|
|
|
100
107
|
// Note: API uses "PUSH" instead of "MOBILEPUSH" for MobilePush channel
|
|
101
108
|
export const API_CHANNEL_PUSH = 'PUSH';
|
|
102
109
|
|
|
110
|
+
// ============================================
|
|
111
|
+
// VALIDATION REGEX (shared with commonUtils for email/mobile validation)
|
|
112
|
+
// ============================================
|
|
113
|
+
export const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
114
|
+
export const PHONE_REGEX = /^[1-9]\d{7,14}$/;
|
|
115
|
+
|
|
103
116
|
// ============================================
|
|
104
117
|
// IDENTIFIER TYPE CONSTANTS
|
|
105
118
|
// ============================================
|
|
106
|
-
export const IDENTIFIER_TYPE_MOBILE = 'mobile';
|
|
107
119
|
export const IDENTIFIER_TYPE_EMAIL = 'email';
|
|
120
|
+
export const IDENTIFIER_TYPE_MOBILE = 'mobile';
|
|
121
|
+
export const IDENTIFIER_TYPE_PHONE = 'phone';
|
|
122
|
+
|
|
123
|
+
// Customer creation modal – input error state class suffix (used with customer-creation-modal-input)
|
|
124
|
+
export const INPUT_HAS_ERROR_CLASS = ' has-error';
|
|
108
125
|
|
|
109
126
|
// ============================================
|
|
110
127
|
// CHANNEL NAME CONSTANTS (for CDN and other utilities)
|