@capillarytech/creatives-library 3.1.16 → 3.1.18

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.18",
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
  });
@@ -439,7 +439,6 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
439
439
  url: this.state.formData['is-internal-url'] ? this.maskTemplateUrl(this.state.formData['template-link']) : this.state.formData['template-link'],
440
440
  TopColor: "#000000",
441
441
  data: {},
442
- previewContent: stateFormData['sms-preview'],
443
442
  BrandId: (selectedWeChatAccount.configs.brand_id ? selectedWeChatAccount.configs.brand_id : ''),
444
443
  OriginalId: selectedWeChatAccount.sourceAccountIdentifier,
445
444
  content: encodeURIComponent(editTemplateData.versions.base.content),
@@ -1209,9 +1208,17 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
1209
1208
  </CapSpin>
1210
1209
  );
1211
1210
  }
1211
+ isLoading = () => {
1212
+ const isLoading = this.state.isLoading || this.props.fetchingSchema || this.props.WeChat.getTemplateDetailsInProgress;
1213
+ if (!isLoading && this.props.setIsLoadingContent) {
1214
+ this.props.setIsLoadingContent(isLoading);
1215
+ }
1216
+ return isLoading;
1217
+ }
1212
1218
 
1213
1219
  render() {
1214
1220
  const { activeMode, weChatData, isEdit } = this.state;
1221
+ const spinning = this.isLoading();
1215
1222
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
1216
1223
  if (this.props.supportedTags) {
1217
1224
  tags = this.props.supportedTags;
@@ -1223,7 +1230,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
1223
1230
  this.renderSelectTemplate() :
1224
1231
  <CapSpin
1225
1232
  tip={this.props.intl.formatMessage(messages.gettingTemplateData)}
1226
- spinning={this.state.isLoading || this.props.fetchingSchema || (this.props.WeChat.getTemplateDetailsInProgress ? true : false)}>
1233
+ spinning={spinning}>
1227
1234
  <div>
1228
1235
  <Helmet
1229
1236
  title="WeChat"
@@ -1284,6 +1291,7 @@ MapTemplates.propTypes = {
1284
1291
  isFullMode: PropTypes.bool,
1285
1292
  getFormData: PropTypes.func,
1286
1293
  weChatMaptemplateStep: PropTypes.bool,
1294
+ setIsLoadingContent: PropTypes.func,
1287
1295
  };
1288
1296
 
1289
1297
  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 {
@@ -243,7 +243,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
243
243
  TopColor: "#000000",
244
244
  touser: "{{wechat_open_id}}",
245
245
  creative_template_id: templateIdFromProp || templateId,
246
- previewContent: message.mediaList,
247
246
  };
248
247
  const response = {
249
248
  action: "getFormData",
@@ -898,6 +897,13 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
898
897
  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
898
  return formData;
900
899
  }
900
+ isLoading = () => {
901
+ const isLoading = this.state.loading;
902
+ if (!isLoading && this.props.setIsLoadingContent) {
903
+ this.props.setIsLoadingContent(isLoading);
904
+ }
905
+ return isLoading;
906
+ }
901
907
  render() {
902
908
  const cardLayout = this.returnCardLayout();
903
909
  const contentMenu = this.returnContentMenu();
@@ -910,7 +916,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
910
916
  }
911
917
  return (
912
918
  <div className="richmedia-container">
913
- <CapSpin spinning={this.state.loading}>
919
+ <CapSpin spinning={this.isLoading()}>
914
920
  {this.state.showPreview && <WechatRichmediaTemplatePreview
915
921
  show={this.state.showPreview}
916
922
  closeSlideBox={this.closeSlideBox}
@@ -921,10 +927,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
921
927
  content={this.prepareMediaList()}
922
928
  />}
923
929
  <div>
924
- <Helmet
925
- title="Wechat Richmedia"
926
- />
927
- <div className="wechat-container">
930
+ <div className={`wechat-container ${isIframe && "embedded-mode"}`}>
928
931
  <CapRow className="wechat-form-container">
929
932
  <CapColumn span={9}>
930
933
  {cardLayout}
@@ -987,6 +990,7 @@ Create.propTypes = {
987
990
  isGetFormData: PropTypes.bool,
988
991
  getFormData: PropTypes.func,
989
992
  onValidationFail: PropTypes.func,
993
+ setIsLoadingContent: PropTypes.func,
990
994
  };
991
995
 
992
996
  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
  }