@capillarytech/creatives-library 6.14.0 → 6.14.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.
@@ -23,6 +23,7 @@ import Templates from '../Templates';
23
23
  import CallTask from '../CallTask';
24
24
  import Facebook from '../Facebook';
25
25
  import Line from '../Line/Container';
26
+ import FTP from '../FTP';
26
27
  import Gallery from '../Assets/Gallery';
27
28
  import withStyles from '../../hoc/withStyles';
28
29
  import styles, { CapTabStyle } from './TemplatesV2.style';
@@ -52,6 +53,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
52
53
  //'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
53
54
  mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
54
55
  line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
56
+
55
57
  };
56
58
  let filteredPanes = Object.keys(defaultPanes)
57
59
  .filter((key) => !channelsToHide.includes(key)).reduce((obj = [], key) => {
@@ -68,6 +70,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
68
70
  if (!channelsToHide.includes('facebook')) {
69
71
  filteredPanes.push({content: <div></div>, tab: intl.formatMessage(messages.facebook), key: 'facebook'});
70
72
  }
73
+ if (!channelsToHide.includes('FTP')) {
74
+ filteredPanes.push({content: <></>, tab: intl.formatMessage(messages.FTP), key: 'ftp'});
75
+ defaultChannel = 'FTP';
76
+ }
71
77
  }
72
78
 
73
79
  filteredPanes = filteredPanes.map( (pane) => {
@@ -152,14 +158,16 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
152
158
  );
153
159
  }
154
160
 
155
- getLineComponent = () => {
156
- return (
157
- <Line
158
- {...this.props}
159
- isCreateFlow
161
+ getLineComponent = () => (
162
+ <Line
163
+ {...this.props}
164
+ isCreateFlow
160
165
  />
161
166
  )
162
- }
167
+
168
+ getFTPComponent = () => (
169
+ <FTP mode={this.props.FTPMode} {...this.props} />
170
+ );
163
171
 
164
172
  getTemplatesComponent(channel) {
165
173
  // const templates = this.props.Templates[`${channel}Templates`];
@@ -169,6 +177,9 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
169
177
  if (channel === 'line') {
170
178
  return this.getLineComponent();
171
179
  }
180
+ if (channel === 'ftp') {
181
+ return this.getFTPComponent();
182
+ }
172
183
  }
173
184
  const location = {pathname: `/${channel}`, search: '', query};
174
185
  switch (channel) {
@@ -267,6 +278,7 @@ TemplatesV2.propTypes = {
267
278
  messageDetails: PropTypes.object,
268
279
  cap: PropTypes.object,
269
280
  authData: PropTypes.object,
281
+ FTPMode: PropTypes.string,
270
282
  };
271
283
 
272
284
  TemplatesV2.defaultProps = {
@@ -34,6 +34,10 @@ export default defineMessages({
34
34
  id: 'creatives.containersV2.TemplatesV2.email',
35
35
  defaultMessage: 'Email',
36
36
  },
37
+ FTP: {
38
+ id: 'creatives.containersV2.TemplatesV2.FTP',
39
+ defaultMessage: 'FTP',
40
+ },
37
41
  pushNotification: {
38
42
  id: 'creatives.containersV2.TemplatesV2.pushNotification',
39
43
  defaultMessage: 'Push notification',