@capillarytech/creatives-library 7.7.12 → 7.7.13

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.
@@ -10,7 +10,7 @@ import { connect } from 'react-redux';
10
10
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
11
11
  import { createStructuredSelector } from 'reselect';
12
12
  import { bindActionCreators } from 'redux';
13
- import { CapTab, CapCustomCard, CapButton, CapHeader, CapSpin, CapIcon } from '@capillarytech/cap-ui-library';
13
+ import { CapTab, CapCustomCard, CapButton, CapHeader, CapSpin, CapIcon, CapTooltip } from '@capillarytech/cap-ui-library';
14
14
  import { find, get } from 'lodash';
15
15
  import isEmpty from 'lodash/isEmpty';
16
16
  import Helmet from 'react-helmet';
@@ -45,6 +45,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
45
45
  channelsToDisable = [],
46
46
  isFullMode,
47
47
  onChannelChange,
48
+ showDisabledFBInfo,
48
49
  } = props;
49
50
 
50
51
  const defaultPanes = {
@@ -80,6 +81,15 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
80
81
  if (channelsToDisable.includes(pane.key)) {
81
82
  // eslint-disable-next-line no-param-reassign
82
83
  pane.disabled = true;
84
+ if (pane.key === 'facebook' && showDisabledFBInfo) {
85
+ pane.tab = (<CapTooltip
86
+ title={
87
+ intl.formatMessage(messages.facebookDisableinfo)
88
+ }
89
+ >
90
+ {intl.formatMessage(messages.facebook)}
91
+ </CapTooltip>);
92
+ }
83
93
  }
84
94
  return pane;
85
95
  });
@@ -148,13 +158,16 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
148
158
  );
149
159
 
150
160
  getFacebookComponent = () => {
151
- const { messageDetails, cap, onFacebookSubmit, isFullMode } = this.props;
161
+ const { messageDetails, cap, onFacebookSubmit, messageStrategy, showDisabledFBInfo, orgUnitId } = this.props;
152
162
  return (
153
163
  <Facebook
154
164
  {...this.props}
155
165
  messageDetails={messageDetails}
156
166
  cap={cap}
157
167
  onFacebookSubmit={onFacebookSubmit}
168
+ messageStrategy={messageStrategy}
169
+ showDisabledFBInfo={showDisabledFBInfo}
170
+ orgUnitId={orgUnitId}
158
171
  />
159
172
  );
160
173
  }
@@ -178,19 +191,21 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
178
191
  getTemplatesComponent(channel) {
179
192
  // const templates = this.props.Templates[`${channel}Templates`];
180
193
  let query = {};
181
- if (!this.props.isFullMode) {
194
+ const {isFullMode, messageStrategy} = this.props;
195
+ if (!isFullMode) {
182
196
  query = {type: 'embedded', module: 'library'};
183
197
  switch (channel) {
184
198
  case 'line':
185
199
  return this.getLineComponent();
186
200
  case 'ftp':
187
201
  return this.getFTPComponent();
188
- case 'facebook':
189
- return this.getFacebookComponent();
190
202
  default:
191
203
  break;
192
204
  }
193
205
  }
206
+ if (messageStrategy !== "X_ENGAGE" && channel === 'facebook' && !isFullMode) {
207
+ return this.getFacebookComponent();
208
+ }
194
209
  const location = {pathname: `/${channel}`, search: '', query};
195
210
  switch (channel) {
196
211
  case 'call_task':
@@ -205,9 +220,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
205
220
  router={this.props.router}
206
221
  isFullMode={this.props.isFullMode}
207
222
  createNew={this.props.createNew}
208
- onSelectTemplate={(id) => this.props.onSelectTemplate(this.selectTemplate(id))}
223
+ onSelectTemplate={this.props.onSelectTemplate}
209
224
  renderNewCardGrid={this.getTemplateDataForGrid}
210
225
  handlePeviewTemplate={this.props.handlePeviewTemplate}
226
+ messageStrategy={this.props.messageStrategy}
211
227
  />);
212
228
  }
213
229
  }
@@ -287,6 +303,7 @@ TemplatesV2.propTypes = {
287
303
  cap: PropTypes.object,
288
304
  authData: PropTypes.object,
289
305
  FTPMode: PropTypes.string,
306
+ messageStrategy: PropTypes.string,
290
307
  };
291
308
 
292
309
  TemplatesV2.defaultProps = {
@@ -66,4 +66,8 @@ export default defineMessages({
66
66
  id: 'creatives.containersV2.TemplatesV2.line',
67
67
  defaultMessage: 'Line',
68
68
  },
69
+ facebookDisableinfo: {
70
+ id: `creatives.containersV2.TemplatesV2.facebookDisableinfo`,
71
+ defaultMessage: 'Please integrate Facebook page ID & page name to enable this option.',
72
+ },
69
73
  });