@capillarytech/creatives-library 8.0.158 → 8.0.159-alpha.1
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/config/app.js +1 -1
- package/package.json +1 -1
- package/v2Components/CustomerSearchSection/index.js +83 -79
- package/v2Components/EmailPreview/_emailPreview.scss +1 -0
- package/v2Components/EmailPreviewV2/_emailPreviewV2.scss +1 -0
- package/v2Components/FormBuilder/index.js +78 -53
- package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +1 -1
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +2 -1
- package/v2Components/TestAndPreviewSlidebox/index.js +187 -14
- package/v2Components/TestAndPreviewSlidebox/tests/PreviewSection.test.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +11 -3
- package/v2Containers/CreativesContainer/index.js +30 -15
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
- package/v2Containers/Email/index.js +150 -28
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +3 -0
- package/v2Containers/EmailWrapper/index.js +6 -0
- package/assets/loading_img.gif +0 -0
- package/utils/whatsappMediaUtils.js +0 -44
- package/v2Containers/Email/tests/index.test.js +0 -35
package/config/app.js
CHANGED
|
@@ -20,7 +20,7 @@ const config = {
|
|
|
20
20
|
accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
|
|
21
21
|
},
|
|
22
22
|
development: {
|
|
23
|
-
api_endpoint: '
|
|
23
|
+
api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
|
|
24
24
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
25
25
|
campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
|
|
26
26
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
package/package.json
CHANGED
|
@@ -69,7 +69,9 @@ const CustomerSearchSection = ({
|
|
|
69
69
|
if (value?.trim()) {
|
|
70
70
|
debouncedSearch(value.trim());
|
|
71
71
|
} else {
|
|
72
|
-
onClearSearch
|
|
72
|
+
if (onClearSearch && typeof onClearSearch === 'function') {
|
|
73
|
+
onClearSearch();
|
|
74
|
+
}
|
|
73
75
|
setShowDropdown(false);
|
|
74
76
|
}
|
|
75
77
|
},
|
|
@@ -182,86 +184,88 @@ const CustomerSearchSection = ({
|
|
|
182
184
|
|
|
183
185
|
return (
|
|
184
186
|
<CapRow className="customer-search-section">
|
|
185
|
-
<
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<CapRow
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
<
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
</CapCard>
|
|
218
|
-
)}
|
|
219
|
-
</CapRow>
|
|
220
|
-
<CapRow type="flex" justify="center" align="middle">
|
|
221
|
-
{processedSearchData?.length > 0 && (
|
|
222
|
-
<CapCard className="search-result-card scroll-bar">
|
|
223
|
-
{
|
|
224
|
-
<CapRow className="identifier-row">
|
|
225
|
-
{processedSearchData?.map((d) => (
|
|
226
|
-
<>
|
|
227
|
-
<CapLink
|
|
228
|
-
key={d?.customerId}
|
|
229
|
-
className="search-results-height link-result"
|
|
230
|
-
title={(
|
|
231
|
-
<>
|
|
232
|
-
<CapRow type="flex" align="middle" gutter={16}>
|
|
233
|
-
<CapColumn data-testid="namingIcon">
|
|
234
|
-
<CapRow className="customer-common-profile">{getNamingIcon(d?.name)}</CapRow>
|
|
235
|
-
</CapColumn>
|
|
236
|
-
<CapColumn>
|
|
237
|
-
<CapRow type="flex" gutter={12}>
|
|
238
|
-
<CapColumn data-testid="searchResultName">
|
|
239
|
-
<CapHeading className="search-text" type="h4">
|
|
240
|
-
{d?.name}
|
|
241
|
-
</CapHeading>
|
|
242
|
-
</CapColumn>
|
|
243
|
-
</CapRow>
|
|
244
|
-
{(
|
|
245
|
-
<CapRow type="flex">
|
|
246
|
-
{showIdentifiers(d?.identifiers)}
|
|
247
|
-
</CapRow>
|
|
248
|
-
)}
|
|
249
|
-
</CapColumn>
|
|
250
|
-
</CapRow>
|
|
251
|
-
</>
|
|
252
|
-
)}
|
|
253
|
-
onClick={() => handleCustomerSelectItem(d)}
|
|
254
|
-
/>
|
|
255
|
-
</>
|
|
256
|
-
))}
|
|
187
|
+
<div ref={searchContainerRef}>
|
|
188
|
+
<CapRow className="search-container">
|
|
189
|
+
{selectedCustomer ? (
|
|
190
|
+
<SelectedCustomerView
|
|
191
|
+
customer={selectedCustomer}
|
|
192
|
+
onClear={onClear}
|
|
193
|
+
showIdentifiers={showIdentifiers}
|
|
194
|
+
/>
|
|
195
|
+
) : (
|
|
196
|
+
<SearchInput
|
|
197
|
+
value={customerSearchValue}
|
|
198
|
+
onChange={handleSearchChange}
|
|
199
|
+
isLoading={isSearchingCustomer}
|
|
200
|
+
error={searchError}
|
|
201
|
+
disabled={disabled}
|
|
202
|
+
placeholder={formatMessage(messages.searchPlaceholder)}
|
|
203
|
+
/>
|
|
204
|
+
)}
|
|
205
|
+
{showDropdown && !selectedCustomer && (
|
|
206
|
+
<CapRow className="search-dropdown-container">
|
|
207
|
+
<CapRow type="flex" justify="center" align="middle">
|
|
208
|
+
{(processedSearchData?.length === 0 && customerSearchValue != null && !isSearchingCustomer) && (
|
|
209
|
+
<CapCard className="validation-card">
|
|
210
|
+
<CapHeading type="h6">
|
|
211
|
+
{formatMessage(messages.noCustomersFound)}
|
|
212
|
+
</CapHeading>
|
|
213
|
+
</CapCard>
|
|
214
|
+
)}
|
|
215
|
+
{(isSearchingCustomer) && (
|
|
216
|
+
<CapCard className="validation-card">
|
|
217
|
+
<CapRow className="spin-card-align">
|
|
218
|
+
<CapSpin />
|
|
257
219
|
</CapRow>
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
220
|
+
</CapCard>
|
|
221
|
+
)}
|
|
222
|
+
</CapRow>
|
|
223
|
+
<CapRow type="flex" justify="center" align="middle">
|
|
224
|
+
{processedSearchData?.length > 0 && (
|
|
225
|
+
<CapCard className="search-result-card scroll-bar">
|
|
226
|
+
{
|
|
227
|
+
<CapRow className="identifier-row">
|
|
228
|
+
{processedSearchData?.map((d) => (
|
|
229
|
+
<>
|
|
230
|
+
<CapLink
|
|
231
|
+
key={d?.customerId}
|
|
232
|
+
className="search-results-height link-result"
|
|
233
|
+
title={(
|
|
234
|
+
<>
|
|
235
|
+
<CapRow type="flex" align="middle" gutter={16}>
|
|
236
|
+
<CapColumn data-testid="namingIcon">
|
|
237
|
+
<CapRow className="customer-common-profile">{getNamingIcon(d?.name)}</CapRow>
|
|
238
|
+
</CapColumn>
|
|
239
|
+
<CapColumn>
|
|
240
|
+
<CapRow type="flex" gutter={12}>
|
|
241
|
+
<CapColumn data-testid="searchResultName">
|
|
242
|
+
<CapHeading className="search-text" type="h4">
|
|
243
|
+
{d?.name}
|
|
244
|
+
</CapHeading>
|
|
245
|
+
</CapColumn>
|
|
246
|
+
</CapRow>
|
|
247
|
+
{(
|
|
248
|
+
<CapRow type="flex">
|
|
249
|
+
{showIdentifiers(d?.identifiers)}
|
|
250
|
+
</CapRow>
|
|
251
|
+
)}
|
|
252
|
+
</CapColumn>
|
|
253
|
+
</CapRow>
|
|
254
|
+
</>
|
|
255
|
+
)}
|
|
256
|
+
onClick={() => handleCustomerSelectItem(d)}
|
|
257
|
+
/>
|
|
258
|
+
</>
|
|
259
|
+
))}
|
|
260
|
+
</CapRow>
|
|
261
|
+
}
|
|
262
|
+
</CapCard>
|
|
263
|
+
)}
|
|
264
|
+
</CapRow>
|
|
261
265
|
</CapRow>
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
</
|
|
266
|
+
)}
|
|
267
|
+
</CapRow>
|
|
268
|
+
</div>
|
|
265
269
|
</CapRow>
|
|
266
270
|
);
|
|
267
271
|
};
|
|
@@ -235,9 +235,15 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
235
235
|
( !this.state.usingTabContainer || (this.state.usingTabContainer && nextProps.tabKey !== ''))
|
|
236
236
|
&& !_.isEqual(nextProps.formData, this.state.formData) &&
|
|
237
237
|
!_.isEqual(nextProps.formData, this.props.formData)) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
// Don't run validation if we're in Test & Preview mode
|
|
239
|
+
if (!nextProps.isTestAndPreviewMode) {
|
|
240
|
+
this.setState({formData: nextProps.formData, tabKey: nextProps.tabKey}, () => {
|
|
241
|
+
this.validateForm();
|
|
242
|
+
});
|
|
243
|
+
} else {
|
|
244
|
+
// Just update formData without validation
|
|
245
|
+
this.setState({formData: nextProps.formData, tabKey: nextProps.tabKey});
|
|
246
|
+
}
|
|
241
247
|
//this.resetTabKeys(nextProps.formData, nextProps.tabCount);
|
|
242
248
|
} else if ((_.isEmpty(this.props.formData) || !this.props.formData) && _.isEmpty(this.state.formData)) {
|
|
243
249
|
this.initialiseForm(nextProps.schema, true);
|
|
@@ -265,10 +271,16 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
265
271
|
this.resetTabKeys(nextProps.formData, nextProps.tabCount, false, true);
|
|
266
272
|
}
|
|
267
273
|
if (type === 'embedded' || ( this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'EMAIL')) {
|
|
268
|
-
|
|
274
|
+
// Don't run validation if we're in Test & Preview mode
|
|
275
|
+
if (!nextProps.isTestAndPreviewMode) {
|
|
276
|
+
this.validateForm();
|
|
277
|
+
}
|
|
269
278
|
}
|
|
270
279
|
if ((this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'MOBILEPUSH')) {
|
|
271
|
-
|
|
280
|
+
// Don't run validation if we're in Test & Preview mode
|
|
281
|
+
if (!nextProps.isTestAndPreviewMode) {
|
|
282
|
+
this.validateForm();
|
|
283
|
+
}
|
|
272
284
|
}
|
|
273
285
|
});
|
|
274
286
|
}
|
|
@@ -286,7 +298,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
286
298
|
}
|
|
287
299
|
|
|
288
300
|
this.initialiseForm(nextProps.schema, false, resetTabKeys);
|
|
289
|
-
|
|
301
|
+
// Don't run validation if we're in Test & Preview mode
|
|
302
|
+
if (!nextProps.isTestAndPreviewMode) {
|
|
303
|
+
this.validateForm();
|
|
304
|
+
}
|
|
290
305
|
}
|
|
291
306
|
});
|
|
292
307
|
}
|
|
@@ -299,10 +314,16 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
299
314
|
}
|
|
300
315
|
|
|
301
316
|
if (!_.isEmpty(nextProps.injectedTags) && !_.isEqual(nextProps.injectedTags, this.props.injectedTags)) {
|
|
302
|
-
|
|
317
|
+
// Don't run validation if we're in Test & Preview mode
|
|
318
|
+
if (!nextProps.isTestAndPreviewMode) {
|
|
319
|
+
this.validateForm(nextProps.tags, nextProps.injectedTags);
|
|
320
|
+
}
|
|
303
321
|
}
|
|
304
322
|
if (!_.isEmpty(nextProps.tags) && !_.isEqual(nextProps.tags, this.props.tags)) {
|
|
305
|
-
|
|
323
|
+
// Don't run validation if we're in Test & Preview mode
|
|
324
|
+
if (!nextProps.isTestAndPreviewMode) {
|
|
325
|
+
this.validateForm(nextProps.tags, nextProps.injectedTags);
|
|
326
|
+
}
|
|
306
327
|
}
|
|
307
328
|
if (!_.isEqual(nextProps.showModal, this.props.showModal)) {
|
|
308
329
|
this.setState({showModal: nextProps.showModal});
|
|
@@ -3917,55 +3938,59 @@ FormBuilder.defaultProps = {
|
|
|
3917
3938
|
userLocale: localStorage.getItem('jlocale') || 'en',
|
|
3918
3939
|
showLiquidErrorInFooter: () => {},
|
|
3919
3940
|
metaDataStatus: "",
|
|
3941
|
+
isTestAndPreviewMode: false, // Default to false to maintain existing behavior
|
|
3920
3942
|
};
|
|
3921
3943
|
|
|
3922
3944
|
FormBuilder.propTypes = {
|
|
3923
3945
|
schema: PropTypes.object.isRequired,
|
|
3924
|
-
onSubmit: PropTypes.func,
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
injectedTags: PropTypes.object,
|
|
3934
|
-
onFormValidityChange: PropTypes.func,
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
isNewVersionFlow: PropTypes.bool,
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
startValidation: PropTypes.bool,
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
showLiquidErrorInFooter: PropTypes.
|
|
3968
|
-
|
|
3946
|
+
onSubmit: PropTypes.func.isRequired,
|
|
3947
|
+
onChange: PropTypes.func.isRequired,
|
|
3948
|
+
currentTab: PropTypes.number.isRequired,
|
|
3949
|
+
parent: PropTypes.object.isRequired,
|
|
3950
|
+
formData: PropTypes.object.isRequired,
|
|
3951
|
+
location: PropTypes.object.isRequired,
|
|
3952
|
+
tabKey: PropTypes.string.isRequired,
|
|
3953
|
+
tags: PropTypes.array.isRequired,
|
|
3954
|
+
tagModule: PropTypes.string.isRequired,
|
|
3955
|
+
injectedTags: PropTypes.object.isRequired,
|
|
3956
|
+
onFormValidityChange: PropTypes.func.isRequired,
|
|
3957
|
+
handleCancelModal: PropTypes.func.isRequired,
|
|
3958
|
+
usingTabContainer: PropTypes.bool.isRequired,
|
|
3959
|
+
checkValidation: PropTypes.bool.isRequired,
|
|
3960
|
+
onContextChange: PropTypes.func.isRequired,
|
|
3961
|
+
tabCount: PropTypes.number.isRequired,
|
|
3962
|
+
isNewVersionFlow: PropTypes.bool.isRequired,
|
|
3963
|
+
modal: PropTypes.object.isRequired,
|
|
3964
|
+
showModal: PropTypes.bool.isRequired,
|
|
3965
|
+
isEdit: PropTypes.bool.isRequired,
|
|
3966
|
+
iframeParent: PropTypes.object.isRequired,
|
|
3967
|
+
router: PropTypes.object.isRequired,
|
|
3968
|
+
baseLanguage: PropTypes.string.isRequired,
|
|
3969
|
+
supportedLanguages: PropTypes.array.isRequired,
|
|
3970
|
+
isSchemaChanged: PropTypes.bool.isRequired,
|
|
3971
|
+
cmsTemplates: PropTypes.array.isRequired,
|
|
3972
|
+
getCmsTemplatesInProgress: PropTypes.bool.isRequired,
|
|
3973
|
+
showEdmEmailTemplates: PropTypes.bool.isRequired,
|
|
3974
|
+
toggleEdmEmailTemplateSelection: PropTypes.func.isRequired,
|
|
3975
|
+
handleEdmDefaultTemplateSelection: PropTypes.func.isRequired,
|
|
3976
|
+
setModalContent: PropTypes.func.isRequired,
|
|
3977
|
+
addLanguageType: PropTypes.string.isRequired,
|
|
3978
|
+
startValidation: PropTypes.bool.isRequired,
|
|
3979
|
+
getValidationData: PropTypes.func.isRequired,
|
|
3980
|
+
saveForm: PropTypes.bool.isRequired,
|
|
3981
|
+
stopValidation: PropTypes.func.isRequired,
|
|
3982
|
+
selectedOfferDetails: PropTypes.object.isRequired,
|
|
3983
|
+
saveBeeInstance: PropTypes.func.isRequired,
|
|
3984
|
+
saveBeeData: PropTypes.func.isRequired,
|
|
3985
|
+
uuid: PropTypes.string.isRequired,
|
|
3986
|
+
type: PropTypes.string.isRequired,
|
|
3987
|
+
isEmailLoading: PropTypes.bool.isRequired,
|
|
3988
|
+
moduleType: PropTypes.string.isRequired,
|
|
3989
|
+
showLiquidErrorInFooter: PropTypes.bool.isRequired,
|
|
3990
|
+
eventContextTags: PropTypes.array.isRequired,
|
|
3991
|
+
forwardedTags: PropTypes.object.isRequired,
|
|
3992
|
+
isLoyaltyModule: PropTypes.bool.isRequired,
|
|
3993
|
+
isTestAndPreviewMode: PropTypes.bool, // Add new prop type
|
|
3969
3994
|
};
|
|
3970
3995
|
|
|
3971
3996
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -15,7 +15,7 @@ const PreviewSection = ({
|
|
|
15
15
|
formatMessage,
|
|
16
16
|
PreviewChrome,
|
|
17
17
|
}) => (
|
|
18
|
-
<CapRow className="preview-section panel-section">
|
|
18
|
+
<CapRow className="test-and-preview-section panel-section">
|
|
19
19
|
<PreviewChrome
|
|
20
20
|
device={previewDevice}
|
|
21
21
|
onDeviceChange={setPreviewDevice}
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.test-preview-container {
|
|
31
|
+
margin-left: 2%;
|
|
31
32
|
height: 100%;
|
|
32
33
|
display: flex;
|
|
33
34
|
flex-direction: column;
|
|
@@ -329,7 +330,7 @@
|
|
|
329
330
|
}
|
|
330
331
|
}
|
|
331
332
|
|
|
332
|
-
.preview-section {
|
|
333
|
+
.test-and-preview-section {
|
|
333
334
|
.section-title {
|
|
334
335
|
margin-bottom: $CAP_SPACE_16;
|
|
335
336
|
color: #333;
|