@capillarytech/creatives-library 3.1.16 → 3.1.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.1.16",
4
+ "version": "3.1.17",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -159,6 +159,7 @@ function SlideBoxContent(props) {
159
159
  onWeChatMaptemplateStepChange={onWeChatMaptemplateStepChange}
160
160
  weChatMaptemplateStep={weChatMaptemplateStep}
161
161
  forwardedTags={forwardedTags}
162
+ setIsLoadingContent={setIsLoadingContent}
162
163
  />
163
164
  }
164
165
  {isEditSms && (
@@ -325,5 +326,7 @@ SlideBoxContent.propTypes = {
325
326
  weChatTemplateType: PropTypes.string,
326
327
  onWechatTemplateChange: PropTypes.func,
327
328
  selectedWeChatAccount: PropTypes.object,
329
+ onWeChatMaptemplateStepChange: PropTypes.func,
330
+ weChatMaptemplateStep: PropTypes.string,
328
331
  };
329
332
  export default SlideBoxContent;
@@ -376,9 +376,9 @@ class Creatives extends React.Component {
376
376
 
377
377
 
378
378
  if (showFooter) {
379
- if (slidBoxContent === "createTemplate" && ((channel === constants.EMAIL && currentStep === 'createTemplateContent') || (channel === constants.SMS && currentStep === 'modeSelection'))) {
379
+ if (slidBoxContent === "createTemplate" && ((channel === constants.EMAIL && currentStep === 'createTemplateContent') || (channel === constants.SMS && currentStep === 'modeSelection') || (channel === constants.WECHAT && currentStep === 'modeSelection'))) {
380
380
  showFooter = showFooter && !this.state.isLoadingContent;
381
- } else if (slidBoxContent === "editTemplate" && ((channel === constants.EMAIL && currentStep === 'modeSelection') || (channel === constants.SMS && currentStep === 'modeSelection'))) {
381
+ } else if (slidBoxContent === "editTemplate" && ((channel === constants.EMAIL && currentStep === 'modeSelection') || (channel === constants.SMS && currentStep === 'modeSelection') || (channel === constants.WECHAT && currentStep === 'modeSelection'))) {
382
382
  showFooter = showFooter && !this.state.isLoadingContent;
383
383
  }
384
384
  }
@@ -274,4 +274,8 @@ export default defineMessages({
274
274
  id: 'creatives.containersV2.Email.goBackTemporaryChangesLost',
275
275
  defaultMessage: "Do you really want to go back? All your temporary changes will be lost!",
276
276
  },
277
+ "alertMessage": {
278
+ id: 'creatives.containersV2.Email.alertMessage',
279
+ defaultMessage: 'Alert',
280
+ },
277
281
  });
@@ -1209,9 +1209,17 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
1209
1209
  </CapSpin>
1210
1210
  );
1211
1211
  }
1212
+ isLoading = () => {
1213
+ const isLoading = this.state.isLoading || this.props.fetchingSchema || this.props.WeChat.getTemplateDetailsInProgress;
1214
+ if (!isLoading && this.props.setIsLoadingContent) {
1215
+ this.props.setIsLoadingContent(isLoading);
1216
+ }
1217
+ return isLoading;
1218
+ }
1212
1219
 
1213
1220
  render() {
1214
1221
  const { activeMode, weChatData, isEdit } = this.state;
1222
+ const spinning = this.isLoading();
1215
1223
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
1216
1224
  if (this.props.supportedTags) {
1217
1225
  tags = this.props.supportedTags;
@@ -1223,7 +1231,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
1223
1231
  this.renderSelectTemplate() :
1224
1232
  <CapSpin
1225
1233
  tip={this.props.intl.formatMessage(messages.gettingTemplateData)}
1226
- spinning={this.state.isLoading || this.props.fetchingSchema || (this.props.WeChat.getTemplateDetailsInProgress ? true : false)}>
1234
+ spinning={spinning}>
1227
1235
  <div>
1228
1236
  <Helmet
1229
1237
  title="WeChat"
@@ -1284,6 +1292,7 @@ MapTemplates.propTypes = {
1284
1292
  isFullMode: PropTypes.bool,
1285
1293
  getFormData: PropTypes.func,
1286
1294
  weChatMaptemplateStep: PropTypes.bool,
1295
+ setIsLoadingContent: PropTypes.func,
1287
1296
  };
1288
1297
 
1289
1298
  const mapStateToProps = createStructuredSelector({
@@ -114,6 +114,9 @@
114
114
  height: 56px;
115
115
  width: 20px;
116
116
  background: white;
117
+ ::-webkit-scrollbar {
118
+ display: none;
119
+ }
117
120
  .cap-icon-v2 {
118
121
  color: #091e42;
119
122
  }
@@ -126,8 +129,15 @@
126
129
  }
127
130
  .cap-link-v2 {
128
131
  max-height: 100%;
132
+ ::-webkit-scrollbar {
133
+ display: none;
134
+ }
135
+ }
136
+ }
137
+ .embedded-mode {
138
+ .cover-image-row {
139
+ display: none;
129
140
  }
130
-
131
141
  }
132
142
  }
133
143
  .template-form-header {
@@ -898,6 +898,13 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
898
898
  const formData = this.state.templateData && !isEmpty(this.state.templateData[this.state.currentContentId]) && this.state.templateData[this.state.currentContentId].formData ? cloneDeep(this.state.templateData[this.state.currentContentId].formData) : {};
899
899
  return formData;
900
900
  }
901
+ isLoading = () => {
902
+ const isLoading = this.state.loading;
903
+ if (!isLoading && this.props.setIsLoadingContent) {
904
+ this.props.setIsLoadingContent(isLoading);
905
+ }
906
+ return isLoading;
907
+ }
901
908
  render() {
902
909
  const cardLayout = this.returnCardLayout();
903
910
  const contentMenu = this.returnContentMenu();
@@ -910,7 +917,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
910
917
  }
911
918
  return (
912
919
  <div className="richmedia-container">
913
- <CapSpin spinning={this.state.loading}>
920
+ <CapSpin spinning={this.isLoading()}>
914
921
  {this.state.showPreview && <WechatRichmediaTemplatePreview
915
922
  show={this.state.showPreview}
916
923
  closeSlideBox={this.closeSlideBox}
@@ -921,10 +928,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
921
928
  content={this.prepareMediaList()}
922
929
  />}
923
930
  <div>
924
- <Helmet
925
- title="Wechat Richmedia"
926
- />
927
- <div className="wechat-container">
931
+ <div className={`wechat-container ${isIframe && "embedded-mode"}`}>
928
932
  <CapRow className="wechat-form-container">
929
933
  <CapColumn span={9}>
930
934
  {cardLayout}
@@ -987,6 +991,7 @@ Create.propTypes = {
987
991
  isGetFormData: PropTypes.bool,
988
992
  getFormData: PropTypes.func,
989
993
  onValidationFail: PropTypes.func,
994
+ setIsLoadingContent: PropTypes.func,
990
995
  };
991
996
 
992
997
  const mapStateToProps = createStructuredSelector({
@@ -57,6 +57,7 @@ export default {
57
57
  }],
58
58
  },
59
59
  {
60
+ rowClassName: "cover-image-row",
60
61
  cols: [
61
62
  {
62
63
  id: "upload-image-label",
@@ -91,6 +92,7 @@ export default {
91
92
  }],
92
93
  },
93
94
  {
95
+ rowClassName: "cover-image-row",
94
96
  cols: [
95
97
  {
96
98
  id: "upload-image-inductive-text",
@@ -110,7 +112,7 @@ export default {
110
112
  }],
111
113
  },
112
114
  {
113
- rowClassName: "wechat-richmedia-row",
115
+ rowClassName: "wechat-richmedia-row cover-image-row",
114
116
  cols: [
115
117
  {
116
118
  id: "image-value",
@@ -96,6 +96,7 @@ export class Wrapper extends React.Component { // eslint-disable-line react/pref
96
96
  {...getCommonProps(this.props)}
97
97
  />);
98
98
  default:
99
+ this.props.setIsLoadingContent(false);
99
100
  return (<CardContainer>
100
101
  <CapRadioCardWithLabel
101
102
  label={<FormattedMessage {...messages.templateType}/>}
@@ -183,6 +184,7 @@ Wrapper.propTypes = {
183
184
  onWechatTemplateChange: PropTypes.func,
184
185
  query: PropTypes.object,
185
186
  selectedWeChatAccount: PropTypes.object,
187
+ setIsLoadingContent: PropTypes.func,
186
188
  };
187
189
 
188
190
  function mapDispatchToProps(dispatch) {
@@ -8,5 +8,6 @@ export function getCommonProps(props) {
8
8
  'onValidationFail',
9
9
  'weChatMaptemplateStep',
10
10
  'onWeChatMaptemplateStepChange',
11
+ 'setIsLoadingContent',
11
12
  ]);
12
13
  }