@capillarytech/creatives-library 7.5.0 → 7.5.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.
@@ -91,7 +91,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
91
91
  if (!this.props.Gallery.fetchingAllAssets && !_.isEmpty(this.props.Gallery.assetList) && this.props.Gallery.assetList[0] && this.props.Gallery.assetList[0].totalCount && this.state.totalCount === 0) {
92
92
  this.setState({totalCount: this.props.Gallery.assetList[0].totalCount});
93
93
  }
94
- if ( !_.isEqual(nextProps.Gallery.uploadAssetSuccess, this.props.Gallery.uploadAssetSuccess) && !nextProps.Gallery.uploadAssetSuccess && !nextProps.Gallery.assetUploading) {
94
+ if ( !_.isEqual(nextProps.Gallery.assetUploading, this.props.Gallery.assetUploading) && !nextProps.Gallery.uploadAssetSuccess && !nextProps.Gallery.assetUploading) {
95
95
  const message = getMessageObject('error', this.props.intl.formatMessage(messages.assetUploadFailed), true);
96
96
  this.props.globalActions.addMessageToQueue(message);
97
97
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.5.0",
4
+ "version": "7.5.1",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -2712,6 +2712,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2712
2712
  );
2713
2713
  }
2714
2714
 
2715
+ checkBeeEditorAllowedForLibrary = () => {
2716
+ const { isFullMode = false, editor } = this.props || {};
2717
+ if ((editor === "BEE" && !isFullMode) || isFullMode) {
2718
+ return true;
2719
+ }
2720
+ return false;
2721
+ }
2722
+
2715
2723
  renderMultiColSection(section, childIndex) {
2716
2724
  const fields = [];
2717
2725
  let contentSections = [];
@@ -2956,7 +2964,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2956
2964
  }
2957
2965
  const langIndex = 0;
2958
2966
  const currentLang = (!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage;
2959
- if (!(_.get(this.state, `formData[${this.state.currentTab - 1}][${currentLang}].is_drag_drop`, false)) || channel !== 'EMAIL') {
2967
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
2968
+
2969
+ if (!(_.get(this.state, `formData[${this.state.currentTab - 1}][${currentLang}].is_drag_drop`, false)) || isBEEAppEnable === false || channel !== 'EMAIL') {
2960
2970
  columns.push(
2961
2971
  <CapColumn key={`input-${val.id}`} offset={val.offset} span={val.width ? val.width : ''} style={val.style ? val.style : {marginBottom: '16px'}}>
2962
2972
  <TagList
@@ -86,7 +86,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
86
86
  if (!this.props.Gallery.fetchingAllAssets && !_.isEmpty(this.props.Gallery.assetList) && this.props.Gallery.assetList[0] && this.props.Gallery.assetList[0].totalCount && this.state.totalCount === 0) {
87
87
  this.setState({totalCount: this.props.Gallery.assetList[0].totalCount});
88
88
  }
89
- if ( !_.isEqual(nextProps.Gallery.uploadAssetSuccess, this.props.Gallery.uploadAssetSuccess) && !nextProps.Gallery.uploadAssetSuccess && !nextProps.Gallery.assetUploading) {
89
+ if ( !_.isEqual(nextProps.Gallery.assetUploading, this.props.Gallery.assetUploading) && !nextProps.Gallery.uploadAssetSuccess && !nextProps.Gallery.assetUploading) {
90
90
  const message = getMessageObject('error', this.props.intl.formatMessage(messages.assetUploadFailed), true);
91
91
  this.props.globalActions.addMessageToQueue(message);
92
92
  }
@@ -2689,6 +2689,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2689
2689
  <Col>
2690
2690
  { !_.isEmpty(schema) && (this.state.formData[0] || this.state.formData["0"]) ?
2691
2691
  <FormBuilder
2692
+ editor={this.props.editor}
2692
2693
  isFullMode={this.props.isFullMode}
2693
2694
  schema={schema}
2694
2695
  onSubmit={this.saveFormData}
@@ -360,7 +360,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
360
360
 
361
361
  if (nextProps.Create && this.props.Create && nextProps.Create.createTemplateError && !isEqual(nextProps.Create.createTemplateError, this.props.Create.createTemplateError)) {
362
362
  const message = this.props.intl.formatMessage(messages.somethingWentWrong);
363
- CapNotification.error({key: 'somethingWrong', message});
363
+ if ((this.state.channel || '').toLowerCase() !== "sms") {
364
+ CapNotification.error({key: 'somethingWrong', message});
365
+ }
364
366
  if ( this.state.channel) {
365
367
  if (this.state.channel.toLowerCase() === "sms") {
366
368
  this.props.smsActions.clearCreateResponse();