@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.
- package/config/app.js +2 -0
- package/index.js +7 -0
- package/package.json +1 -1
- package/reducers.js +2 -1
- package/services/api.js +7 -0
- package/utils/common.js +177 -0
- package/v2Components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/v2Components/TemplatePreview/index.js +3 -7
- package/v2Containers/App/constants.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +17 -1
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -0
- package/v2Containers/CreativesContainer/constants.js +2 -0
- package/v2Containers/CreativesContainer/index.js +12 -5
- package/v2Containers/FTP/_FTP.scss +103 -0
- package/v2Containers/FTP/actions.js +7 -0
- package/v2Containers/FTP/constants.js +3 -0
- package/v2Containers/FTP/index.js +501 -0
- package/v2Containers/FTP/messages.js +60 -0
- package/v2Containers/FTP/reducer.js +32 -0
- package/v2Containers/FTP/sagas.js +26 -0
- package/v2Containers/FTP/selectors.js +20 -0
- package/v2Containers/FTP/temp.js +11838 -0
- package/v2Containers/Templates/_templates.scss +2 -2
- package/v2Containers/TemplatesV2/index.js +13 -0
- package/v2Containers/TemplatesV2/messages.js +4 -0
- package/v2Containers/Viber/index.js +2 -3
- package/v2Containers/Viber/messages.js +0 -4
|
@@ -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:
|
|
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 !== '') || (
|
|
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',
|