@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 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: 'http://localhost:2022/arya/api/v1/creatives',
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.158",
4
+ "version": "8.0.159-alpha.1",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -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
- <CapRow className="search-container" ref={searchContainerRef}>
186
- {selectedCustomer ? (
187
- <SelectedCustomerView
188
- customer={selectedCustomer}
189
- onClear={onClear}
190
- showIdentifiers={showIdentifiers}
191
- />
192
- ) : (
193
- <SearchInput
194
- value={customerSearchValue}
195
- onChange={handleSearchChange}
196
- isLoading={isSearchingCustomer}
197
- error={searchError}
198
- disabled={disabled}
199
- placeholder={formatMessage(messages.searchPlaceholder)}
200
- />
201
- )}
202
- {showDropdown && !selectedCustomer && (
203
- <CapRow className="search-dropdown-container">
204
- <CapRow type="flex" justify="center" align="middle">
205
- {(processedSearchData?.length === 0 && customerSearchValue != null && !isSearchingCustomer) && (
206
- <CapCard className="validation-card">
207
- <CapHeading type="h6">
208
- {formatMessage(messages.noCustomersFound)}
209
- </CapHeading>
210
- </CapCard>
211
- )}
212
- {(isSearchingCustomer) && (
213
- <CapCard className="validation-card">
214
- <CapRow className="spin-card-align">
215
- <CapSpin />
216
- </CapRow>
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
- </CapCard>
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
- </CapRow>
263
- )}
264
- </CapRow>
266
+ )}
267
+ </CapRow>
268
+ </div>
265
269
  </CapRow>
266
270
  );
267
271
  };
@@ -79,6 +79,7 @@
79
79
  }
80
80
  .email-subject-desktop {
81
81
  text-align: left;
82
+ margin-left: 6%;
82
83
  margin-bottom: 8px;
83
84
  }
84
85
  .tablet-message-container-v2 {
@@ -65,6 +65,7 @@ $classPrefix: email-preview-v2;
65
65
  }
66
66
  .email-subject-desktop {
67
67
  text-align: left;
68
+ margin-left: 6%;
68
69
  margin-bottom: 8px;
69
70
  }
70
71
  .tablet-message-container {
@@ -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
- this.setState({formData: nextProps.formData, tabKey: nextProps.tabKey}, () => {
239
- this.validateForm();
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
- this.validateForm();
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
- this.validateForm();
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
- this.validateForm();
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
- this.validateForm(nextProps.tags, nextProps.injectedTags);
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
- this.validateForm(nextProps.tags, nextProps.injectedTags);
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
- formData: PropTypes.object,
3926
- onChange: PropTypes.func,
3927
- isEdit: PropTypes.bool,
3928
- usingTabContainer: PropTypes.bool,
3929
- parent: PropTypes.object,
3930
- iframeParent: PropTypes.object,
3931
- location: PropTypes.object,
3932
- tags: PropTypes.array,
3933
- injectedTags: PropTypes.object,
3934
- onFormValidityChange: PropTypes.func,
3935
- checkValidation: PropTypes.bool,
3936
- onContextChange: PropTypes.func,
3937
- tabCount: PropTypes.number,
3938
- isSchemaChanged: PropTypes.bool,
3939
- modal: PropTypes.object,
3940
- isNewVersionFlow: PropTypes.bool,
3941
- baseLanguage: PropTypes.string,
3942
- supportedLanguages: PropTypes.array,
3943
- router: PropTypes.object,
3944
- currentTab: PropTypes.number,
3945
- showModal: PropTypes.bool,
3946
- handleCancelModal: PropTypes.func,
3947
- cmsTemplates: PropTypes.array,
3948
- getCmsTemplatesInProgress: PropTypes.bool,
3949
- showEdmEmailTemplates: PropTypes.bool,
3950
- toggleEdmEmailTemplateSelection: PropTypes.func,
3951
- handleEdmDefaultTemplateSelection: PropTypes.func,
3952
- userLocale: PropTypes.string,
3953
- setModalContent: PropTypes.func,
3954
- addLanguageType: PropTypes.string,
3955
- getValidationData: PropTypes.func,
3956
- startValidation: PropTypes.bool,
3957
- // saveForm: PropTypes.bool,
3958
- stopValidation: PropTypes.func,
3959
- handleDelete: PropTypes.func,
3960
- intl: intlShape.isRequired,
3961
- selectedOfferDetails: PropTypes.array,
3962
- setDrawerVisibility: PropTypes.bool,
3963
- capDrawerContent: PropTypes.array,
3964
- isFullMode: PropTypes.bool,
3965
- currentOrgDetails: PropTypes.object,
3966
- liquidExtractionInProgress: PropTypes.bool,
3967
- showLiquidErrorInFooter: PropTypes.func,
3968
- channel: PropTypes.string,
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;