@capillarytech/creatives-library 7.0.8 → 7.1.3

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.
@@ -54,9 +54,9 @@
54
54
  .button-content {
55
55
  .ant-card-meta-description {
56
56
  min-width: 108px;
57
- max-width: 215px;
57
+ max-width: 160px;
58
58
  height: 24px;
59
- padding: 2px 0px;
59
+ padding: 1px 23px 2px 22px;
60
60
  border-radius: 16px;
61
61
  font-size: 14px;
62
62
  font-weight: 500;
@@ -24,6 +24,7 @@ import CallTask from '../CallTask';
24
24
  import Facebook from '../Facebook';
25
25
  import Viber from '../Viber';
26
26
  import Line from '../Line/Container';
27
+ import FTP from '../FTP';
27
28
  import Gallery from '../Assets/Gallery';
28
29
  import withStyles from '../../hoc/withStyles';
29
30
  import styles, { CapTabStyle } from './TemplatesV2.style';
@@ -72,6 +73,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
72
73
  if (!channelsToHide.includes('facebook')) {
73
74
  filteredPanes.push({content: <div></div>, tab: intl.formatMessage(messages.facebook), key: 'facebook'});
74
75
  }
76
+ if (!channelsToHide.includes('FTP')) {
77
+ filteredPanes.push({content: <></>, tab: intl.formatMessage(messages.FTP), key: 'ftp'});
78
+ defaultChannel = 'FTP';
79
+ }
75
80
  }
76
81
 
77
82
  filteredPanes = filteredPanes.map( (pane) => {
@@ -168,6 +173,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
168
173
  />
169
174
  )
170
175
 
176
+ getFTPComponent = () => (
177
+ <FTP mode={this.props.FTPMode} {...this.props} />
178
+ );
179
+
171
180
  getTemplatesComponent(channel) {
172
181
  // const templates = this.props.Templates[`${channel}Templates`];
173
182
  let query = {};
@@ -176,6 +185,9 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
176
185
  if (channel === 'line') {
177
186
  return this.getLineComponent();
178
187
  }
188
+ if (channel === 'ftp') {
189
+ return this.getFTPComponent();
190
+ }
179
191
  }
180
192
  const location = {pathname: `/${channel}`, search: '', query};
181
193
  switch (channel) {
@@ -274,6 +286,7 @@ TemplatesV2.propTypes = {
274
286
  messageDetails: PropTypes.object,
275
287
  cap: PropTypes.object,
276
288
  authData: PropTypes.object,
289
+ FTPMode: PropTypes.string,
277
290
  };
278
291
 
279
292
  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',
@@ -516,7 +516,6 @@ const Viber = (props) => {
516
516
  defaultValue={buttonText}
517
517
  value={buttonText}
518
518
  style={{paddingBottom: '11px'}}
519
- maxLength={20}
520
519
  />
521
520
  <CapInput
522
521
  id="viber-button-url"
@@ -564,7 +563,7 @@ const Viber = (props) => {
564
563
  const createCallback = (errorMessage, isEdit) => {
565
564
  if (!errorMessage) {
566
565
  CapNotification.success({
567
- message: isEdit ? formatMessage(messages.viberEditNotification) : formatMessage(messages.viberCreateNotification),
566
+ message: formatMessage(messages.viberCreateNotification),
568
567
  });
569
568
  if (isEdit) {
570
569
  actions.clearEditResponse();
@@ -627,7 +626,7 @@ const Viber = (props) => {
627
626
  return true;
628
627
  }
629
628
  // if button is being added than button url and button Text both are mandatory
630
- if (( trimedButtonText === '' && trimedButtonUrl !== '') || ( trimedButtonText !== '' && trimedButtonUrl === '')) {
629
+ if (( trimedButtonText === '' && trimedButtonUrl !== '') || ( trimedButtonUrl !== '' && trimedButtonUrl === '')) {
631
630
  return true;
632
631
  }
633
632
  // if button url is not valid url
@@ -118,10 +118,6 @@ export default defineMessages({
118
118
  id: `${scope}.viberCreateNotification`,
119
119
  defaultMessage: 'Viber template created successfully',
120
120
  },
121
- viberEditNotification: {
122
- id: `${scope}.viberEditNotification`,
123
- defaultMessage: 'Viber template updated successfully',
124
- },
125
121
  textMessageTitlePlaceholder: {
126
122
  id: `${scope}.textMessageTitlePlaceholder`,
127
123
  defaultMessage: 'Enter template name',