@capillarytech/creatives-library 3.3.0 → 3.3.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.3.0",
4
+ "version": "3.3.1",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -127,11 +127,18 @@
127
127
  "creatives.componentsV2.Header.save": "Save",
128
128
  "creatives.componentsV2.ImagePreview.close": "close",
129
129
  "creatives.componentsV2.ImagePreview.loadingImage": "Loading images !!!!",
130
+ "creatives.componentsV2.NavigationBar.businessProcesses": "Workbench",
131
+ "creatives.componentsV2.NavigationBar.campaign": "Campaigns",
130
132
  "creatives.componentsV2.NavigationBar.header": "This is the NavigationBar component!",
131
133
  "creatives.componentsV2.NavigationBar.insights": "Insights+",
132
134
  "creatives.componentsV2.NavigationBar.logout": "Logout",
135
+ "creatives.componentsV2.NavigationBar.loyaltyProgram": "Loyalty+",
136
+ "creatives.componentsV2.NavigationBar.memberCare": "Member Care",
133
137
  "creatives.componentsV2.NavigationBar.orgSettings": "Organisation settings",
134
138
  "creatives.componentsV2.NavigationBar.selectedProductDefault": "Engage+",
139
+ "creatives.componentsV2.NavigationBar.storeCare": "Store Care",
140
+ "creatives.componentsV2.NavigationBar.storePerformance": "Store Performance",
141
+ "creatives.componentsV2.NavigationBar.wecrm": "Wecrm",
135
142
  "creatives.componentsV2.NewCallTask.callTaskTitle": "Call Task title",
136
143
  "creatives.componentsV2.NewCallTask.description": "Description",
137
144
  "creatives.componentsV2.NewCallTask.done": "Done",
@@ -909,6 +916,7 @@
909
916
  "creatives.containersV2.Email.Save": "Save",
910
917
  "creatives.containersV2.Email.Subject": "Subject",
911
918
  "creatives.containersV2.Email.Tags": "Tags",
919
+ "creatives.containersV2.Email.addLabel": "Add label",
912
920
  "creatives.containersV2.Email.alert": "Alert",
913
921
  "creatives.containersV2.Email.alertMessage": "Alert",
914
922
  "creatives.containersV2.Email.alphabetically": "Alphabetically",
@@ -934,6 +942,7 @@
934
942
  "creatives.containersV2.Email.emailSubject": "Enter email subject",
935
943
  "creatives.containersV2.Email.emailSubjectNotEmplty": "Email subject cannot be empty.",
936
944
  "creatives.containersV2.Email.emailText": "Email",
945
+ "creatives.containersV2.Email.english": "English",
937
946
  "creatives.containersV2.Email.goBackTemporaryChangesLost": "Do you really want to go back? All your temporary changes will be lost!",
938
947
  "creatives.containersV2.Email.h3emailPreview": "Email preview",
939
948
  "creatives.containersV2.Email.h3imageSelection": "Image selection",
@@ -127,11 +127,18 @@
127
127
  "creatives.componentsV2.Header.save": "",
128
128
  "creatives.componentsV2.ImagePreview.close": "",
129
129
  "creatives.componentsV2.ImagePreview.loadingImage": "",
130
+ "creatives.componentsV2.NavigationBar.businessProcesses": "",
131
+ "creatives.componentsV2.NavigationBar.campaign": "",
130
132
  "creatives.componentsV2.NavigationBar.header": "",
131
133
  "creatives.componentsV2.NavigationBar.insights": "",
132
134
  "creatives.componentsV2.NavigationBar.logout": "",
135
+ "creatives.componentsV2.NavigationBar.loyaltyProgram": "",
136
+ "creatives.componentsV2.NavigationBar.memberCare": "",
133
137
  "creatives.componentsV2.NavigationBar.orgSettings": "",
134
138
  "creatives.componentsV2.NavigationBar.selectedProductDefault": "",
139
+ "creatives.componentsV2.NavigationBar.storeCare": "",
140
+ "creatives.componentsV2.NavigationBar.storePerformance": "",
141
+ "creatives.componentsV2.NavigationBar.wecrm": "",
135
142
  "creatives.componentsV2.NewCallTask.callTaskTitle": "",
136
143
  "creatives.componentsV2.NewCallTask.description": "",
137
144
  "creatives.componentsV2.NewCallTask.done": "",
@@ -909,6 +916,7 @@
909
916
  "creatives.containersV2.Email.Save": "",
910
917
  "creatives.containersV2.Email.Subject": "",
911
918
  "creatives.containersV2.Email.Tags": "",
919
+ "creatives.containersV2.Email.addLabel": "",
912
920
  "creatives.containersV2.Email.alert": "",
913
921
  "creatives.containersV2.Email.alertMessage": "",
914
922
  "creatives.containersV2.Email.alphabetically": "",
@@ -934,6 +942,7 @@
934
942
  "creatives.containersV2.Email.emailSubject": "",
935
943
  "creatives.containersV2.Email.emailSubjectNotEmplty": "",
936
944
  "creatives.containersV2.Email.emailText": "",
945
+ "creatives.containersV2.Email.english": "",
937
946
  "creatives.containersV2.Email.goBackTemporaryChangesLost": "",
938
947
  "creatives.containersV2.Email.h3emailPreview": "",
939
948
  "creatives.containersV2.Email.h3imageSelection": "",
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import styled from 'styled-components';
10
- import { isEmpty, forEach, find } from 'lodash';
10
+ import { isEmpty, forEach } from 'lodash';
11
11
  import { loadItem } from 'services/localStorageApi';
12
12
  import { intlShape, injectIntl } from 'react-intl';
13
13
  import TopBar from '../TopBar';
@@ -86,14 +86,16 @@ class NavigationBar extends React.Component {
86
86
 
87
87
  getProductsList = () => {
88
88
  const { formatMessage } = this.props.intl;
89
- const { campaignOrgV2Status } = this.props;
90
89
  const { currentOrgDetails } = this.props.userData;
91
90
  const productsList = [];
92
91
  if (!isEmpty(currentOrgDetails)) {
93
92
  forEach(currentOrgDetails.module_details, (module) => {
94
93
  if (module.name.toLowerCase() !== PRODUCT_MASTERS) {
94
+ const productName = module.code;
95
+ const intlProductName = messages[productName];
96
+ const moduleName = intlProductName ? formatMessage(intlProductName) : module.name.toLowerCase();
95
97
  productsList.push({
96
- value: module.name.toLowerCase(),
98
+ value: moduleName,
97
99
  url: module.url,
98
100
  key: module.code,
99
101
  });
@@ -101,12 +103,6 @@ class NavigationBar extends React.Component {
101
103
  });
102
104
  //below changes are temporary and should be fixed once we get correct modules list
103
105
  //changing campaigns module name to engage+
104
- if ( !campaignOrgV2Status ) {
105
- const campaignsModule = find(productsList, ['value', 'campaigns']);
106
- if (campaignsModule) {
107
- campaignsModule.value = 'Engage+';
108
- }
109
- }
110
106
  //adding insights+ to module list
111
107
  productsList.push({
112
108
  value: formatMessage(messages.insights),
@@ -224,7 +220,6 @@ NavigationBar.propTypes = {
224
220
  intl: intlShape.isRequired,
225
221
  location: PropTypes.object,
226
222
  type: PropTypes.string,
227
- campaignOrgV2Status: PropTypes.bool,
228
223
  };
229
224
 
230
225
  export default injectIntl(NavigationBar);
@@ -29,4 +29,32 @@ export default defineMessages({
29
29
  id: `${scope}.logout`,
30
30
  defaultMessage: 'Logout',
31
31
  },
32
+ businessProcesses: {
33
+ id: `${scope}.businessProcesses`,
34
+ defaultMessage: 'Workbench',
35
+ },
36
+ campaign: {
37
+ id: `${scope}.campaign`,
38
+ defaultMessage: 'Engage+',
39
+ },
40
+ wecrm: {
41
+ id: `${scope}.wecrm`,
42
+ defaultMessage: 'Wecrm',
43
+ },
44
+ loyaltyProgram: {
45
+ id: `${scope}.loyaltyProgram`,
46
+ defaultMessage: 'Loyalty+',
47
+ },
48
+ storePerformance: {
49
+ id: `${scope}.storePerformance`,
50
+ defaultMessage: 'Store Performance',
51
+ },
52
+ memberCare: {
53
+ id: `${scope}.memberCare`,
54
+ defaultMessage: 'Member Care',
55
+ },
56
+ storeCare: {
57
+ id: `${scope}.storeCare`,
58
+ defaultMessage: 'Store Care',
59
+ },
32
60
  });
@@ -120,15 +120,18 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
120
120
  getAllAssets = ({params, getNextPage, resetPage}, isReRender = false) => {
121
121
  let queryParams = params;
122
122
  let page = this.state.page;
123
+ let shouldFetchGalleryAssets = false;
123
124
  if (!this.props.Gallery.fetchingAllAssets && ((resetPage || (page === 1 && this.state.totalCount === 0) || page <= (this.state.totalCount / this.state.perPageLimit)) || isReRender )) {
124
125
  if (getNextPage) {
125
126
  page += 1;
127
+ shouldFetchGalleryAssets = true;
126
128
  }
127
129
 
128
130
  let totalCount = this.state.totalCount;
129
131
  if (resetPage) {
130
132
  page = 1;
131
133
  totalCount = 0;
134
+ shouldFetchGalleryAssets = true;
132
135
  }
133
136
  if ((!params || _.isEmpty(params))) {
134
137
  queryParams = {
@@ -137,12 +140,15 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
137
140
  }
138
141
  if (this.state.searchText !== "") {
139
142
  queryParams = {...queryParams, name: this.state.searchText};
143
+ shouldFetchGalleryAssets = true;
144
+ }
145
+ if (!this.props.Gallery.fetchingAllAssets && (_.isEmpty(this.props.Gallery.assetList) || shouldFetchGalleryAssets)) {
146
+ this.setState({page, totalCount}, () => {
147
+ queryParams.page = page;
148
+ queryParams.perPage = this.state.perPageLimit;
149
+ this.props.actions.getAllAssets('image', queryParams);
150
+ });
140
151
  }
141
- this.setState({page, totalCount}, () => {
142
- queryParams.page = page;
143
- queryParams.perPage = this.state.perPageLimit;
144
- this.props.actions.getAllAssets('image', queryParams);
145
- });
146
152
  }
147
153
  };
148
154
  handleGallery = (e) => {
@@ -286,4 +286,12 @@ export default defineMessages({
286
286
  id: 'creatives.containersV2.Email.h3imageSelection',
287
287
  defaultMessage: 'Image selection',
288
288
  },
289
+ "English": {
290
+ id: 'creatives.containersV2.Email.english',
291
+ defaultMessage: 'English',
292
+ },
293
+ "Add label": {
294
+ id: 'creatives.containersV2.Email.addLabel',
295
+ defaultMessage: 'Add label',
296
+ },
289
297
  });
@@ -1572,7 +1572,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1572
1572
  });
1573
1573
  }
1574
1574
  return (<CapSpin spinning={fetchingWeCrmAccounts}>
1575
- {isEmpty(weCrmAccounts) && !fetchingWeCrmAccounts ? <FormattedMessage {...messages.noAccountsPresentWeChat} /> :
1575
+ {isEmpty(weCrmAccounts) && !fetchingWeCrmAccounts ? <FormattedMessage {...(channel === WECHAT ? messages.noAccountsPresentWeChat : messages.noAccountsPresent)} /> :
1576
1576
  <div style={{ overflowX: "auto", paddingBottom: CAP_SPACE_16 }}>
1577
1577
  <CapHeader
1578
1578
  title={isMobilePushChannel ? this.props.intl.formatMessage(messages.mobilepushAccount) : this.props.intl.formatMessage(messages.wechatAccount)}