@capillarytech/creatives-library 2.0.61 → 2.0.62

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.
Files changed (37) hide show
  1. package/app.js +1 -1
  2. package/components/FormBuilder/_formBuilder.scss +1 -2
  3. package/components/FormBuilder/index.js +1 -2
  4. package/components/PreviewSideBar/_previewsidebar.scss +1 -1
  5. package/components/TemplatePreview/_templatePreview.scss +1 -1
  6. package/components/TemplatePreview/index.js +1 -1
  7. package/containers/CreativesContainer/SlideBoxContent.js +5 -28
  8. package/containers/CreativesContainer/SlideBoxFooter.js +3 -3
  9. package/containers/CreativesContainer/index.js +25 -72
  10. package/containers/MobilePush/Create/index.js +2 -4
  11. package/containers/Sms/Create/_smsCreate.scss +1 -1
  12. package/containers/TemplatesV2/index.js +7 -8
  13. package/global-styles.js +1 -0
  14. package/index.html +2 -0
  15. package/index.js +1 -1
  16. package/package.json +1 -1
  17. package/components/EmailPreview/assets/images/iPad.svg +0 -10
  18. package/components/EmailPreview/assets/images/mobile.png +0 -0
  19. package/components/MobilePushPreviewV2/index.js +0 -120
  20. package/components/MobilePushPreviewV2/messages.js +0 -13
  21. package/components/MobilePushPreviewV2/tests/index.test.js +0 -10
  22. package/containers/MobilepushWrapper/index.js +0 -92
  23. package/containers/MobilepushWrapper/messages.js +0 -25
  24. package/containers/MobilepushWrapper/tests/index.test.js +0 -10
  25. package/containers/WeChat/_wechat.scss +0 -8
  26. package/containers/WeChat/actions.js +0 -52
  27. package/containers/WeChat/constants.js +0 -28
  28. package/containers/WeChat/index.js +0 -1635
  29. package/containers/WeChat/messages.js +0 -73
  30. package/containers/WeChat/reducer.js +0 -74
  31. package/containers/WeChat/sagas.js +0 -86
  32. package/containers/WeChat/selectors.js +0 -25
  33. package/containers/WeChat/tests/actions.test.js +0 -18
  34. package/containers/WeChat/tests/index.test.js +0 -10
  35. package/containers/WeChat/tests/reducer.test.js +0 -9
  36. package/containers/WeChat/tests/sagas.test.js +0 -15
  37. package/containers/WeChat/tests/selectors.test.js +0 -10
@@ -1,120 +0,0 @@
1
- /**
2
- *
3
- * PreviewSideBar
4
- *
5
- */
6
-
7
- import PropTypes from 'prop-types';
8
-
9
- import React from 'react';
10
- import { CapButton } from '@capillarytech/cap-ui-library';
11
- // import styled from 'styled-components';
12
-
13
- import { FormattedMessage } from 'react-intl';
14
- import { Button } from 'antd';
15
- import { get, map, isEmpty} from 'lodash';
16
- import TemplatePreview from '../TemplatePreview';
17
- import '../PreviewSideBar/_previewsidebar.scss';
18
- import messages from './messages';
19
- const ButtonGroup = Button.Group;
20
-
21
- class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
22
- constructor(props) {
23
- super(props);
24
- this.goToEdit = this.goToEdit.bind(this);
25
- this.goToDuplicate = this.goToDuplicate.bind(this);
26
- this.changeDevice = this.changeDevice.bind(this);
27
- const hasAndroid = get(props, 'templateData.versions.base.ANDROID') || get(props, 'templateData.androidContent');
28
- const hasIos = get(props, 'templateData.versions.base.IOS') || get(props, 'templateData.iosContent');
29
- let device = "android";
30
- if (hasAndroid) {
31
- device = 'android';
32
- } else if (hasIos) {
33
- device = 'ios';
34
- }
35
- this.state = {
36
- device,
37
- content: this.setContent(props.templateData, device),
38
- };
39
- }
40
-
41
- setContent = (templateData, device) => {
42
- const androidContent = get(templateData, 'versions.base.ANDROID') || get(templateData, 'androidContent');
43
- const iosContent = get(templateData, 'versions.base.IOS') || get(templateData, 'iosContent');
44
-
45
- const data = device === "android" ? androidContent : iosContent;
46
- const content = {
47
- header: data.title,
48
- bodyText: data.message,
49
- bodyImage: data.expandableDetails && data.expandableDetails.image,
50
- actions: [],
51
- appName: templateData.appName,
52
- };
53
- if (data.expandableDetails && data.expandableDetails.ctas && data.expandableDetails.ctas.length) {
54
- if (device === "android" ) {
55
- content.actions = map(data.expandableDetails.ctas, (cta) => ({label: cta.actionText}));
56
- } else {
57
- content.actions = [{label: data.expandableDetails.ctas[0].actionLabel}, {label: data.expandableDetails.ctas[0].actionLabel2}];
58
- }
59
- }
60
- return content;
61
- }
62
- goToDuplicate() {
63
- this.props.onDuplicateClick(this.props.templateData);
64
- this.props.handleClose();
65
- }
66
- changeDevice(ev) {
67
- const device = ev.target.value;
68
- const content = this.setContent(this.props.templateData, device);
69
- this.setState({device, content });
70
- }
71
- goToEdit(e, path) {
72
- this.props.onEditClick(e, this.props.templateData._id, this.props.templateData.modeType, path);
73
- }
74
- render() {
75
- const {templateData, channel} = this.props;
76
-
77
- const hasAndroid = get(templateData, 'versions.base.ANDROID') || get(templateData, 'androidContent');
78
- const hasIos = get(templateData, 'versions.base.IOS') || get(templateData, 'iosContent');
79
-
80
- const {device, content} = this.state;
81
-
82
- return (
83
-
84
- <div>
85
- <div className="devices">
86
- {!isEmpty(templateData) && hasAndroid && hasIos &&
87
- <ButtonGroup onClick={this.changeDevice}>
88
- <CapButton type={device === "android" ? "primary" : "secondary"} value={"android"}>Android</CapButton>
89
- <CapButton type={device === "iphone" ? "primary" : "secondary"} value={"iphone"}>IOS</CapButton>
90
- </ButtonGroup>}
91
- </div>
92
- <TemplatePreview
93
- device={device === "android" ? "android" : "iphone"}
94
- channel={channel}
95
- content={content || ''}
96
- templateData={templateData}
97
- >
98
- </TemplatePreview>
99
-
100
-
101
- </div>
102
-
103
-
104
- );
105
- }
106
-
107
- }
108
-
109
- MobilePushPreviewV2.propTypes = {
110
- templateData: PropTypes.object.isRequired,
111
- channel: PropTypes.string.isRequired,
112
- showPreview: PropTypes.bool,
113
- handleClose: PropTypes.func,
114
- onEditClick: PropTypes.func,
115
- onDuplicateClick: PropTypes.func,
116
- location: PropTypes.object,
117
- embedded: PropTypes.bool,
118
- };
119
-
120
- export default MobilePushPreviewV2;
@@ -1,13 +0,0 @@
1
- /*
2
- * MobilePushPreviewV2 Messages
3
- *
4
- * This contains all the text for the MobilePushPreviewV2 component.
5
- */
6
- import { defineMessages } from 'react-intl';
7
-
8
- export default defineMessages({
9
- header: {
10
- id: 'app.components.MobilePushPreviewV2.header',
11
- defaultMessage: 'This is the MobilePushPreviewV2 component !',
12
- },
13
- });
@@ -1,10 +0,0 @@
1
- // import React from 'react';
2
- // import { shallow } from 'enzyme';
3
-
4
- // import MobilePushPreviewV2 from '../index';
5
-
6
- describe('<MobilePushPreviewV2 />', () => {
7
- it('Expect to have unit tests specified', () => {
8
- expect(true).toEqual(false);
9
- });
10
- });
@@ -1,92 +0,0 @@
1
- /*
2
- *
3
- * MobilepushWrapper
4
- *
5
- */
6
- import PropTypes from 'prop-types';
7
- import React from 'react';
8
- import { connect } from 'react-redux';
9
- import { FormattedMessage } from 'react-intl';
10
- import {CapRadioCard, CapHeader} from '@capillarytech/cap-ui-library';
11
- import {isEmpty} from 'lodash';
12
- import MobilepushCreate from '../MobilePush/Create';
13
- import messages from './messages';
14
-
15
- export class MobilepushWrapper extends React.Component { // eslint-disable-line react/prefer-stateless-function
16
- constructor(props) {
17
- super(props);
18
- this.modes = [
19
- {
20
- title: <FormattedMessage {...messages.text}/>,
21
- content: <FormattedMessage {...messages.text}/>,
22
- value: 'text',
23
- // onClick: () => {
24
- // this.emailUploader.current.click();
25
- // },
26
- },
27
- {
28
- title: <FormattedMessage {...messages.image}/>,
29
- content: <FormattedMessage {...messages.image}/>,
30
- value: 'image',
31
- },
32
- ];
33
- }
34
- onChange = (e) => {
35
- this.props.onMobilepushModeChange( e.target.value );
36
- };
37
- render() {
38
- const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query} = this.props;
39
- const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
40
- return (
41
- <div>
42
- {step === "modeSelection" ?
43
- <div>
44
- <CapHeader size="small" title={<FormattedMessage {...messages.createMode}/>}/>
45
- <CapRadioCard
46
- panes={this.modes}
47
- onChange={this.onChange}
48
- selected={mobilePushCreateMode}
49
- />
50
- </div>
51
- :
52
- <div>
53
- {isShowMobilepushCreate && <MobilepushCreate
54
- getFormLibraryData={getFormData}
55
- setIsLoadingContent={setIsLoadingContent}
56
- location={{
57
- pathname: `/mobilepush/create/${mobilePushCreateMode}`,
58
- query,
59
- }}
60
- params={{mode: mobilePushCreateMode}}
61
- isFullMode={false}
62
- isGetFormData={isGetFormData}
63
- route={{ name: 'mobilepush' }}
64
- />
65
-
66
-
67
- }
68
- </div>
69
- }
70
- </div>
71
- );
72
- }
73
- }
74
-
75
- MobilepushWrapper.propTypes = {
76
- onMobilepushModeChange: PropTypes.func,
77
- mobilePushCreateMode: PropTypes.string,
78
- step: PropTypes.string,
79
- getFormData: PropTypes.string,
80
- setIsLoadingContent: PropTypes.func,
81
- isGetFormData: PropTypes.bool,
82
- query: PropTypes.object,
83
- };
84
-
85
-
86
- function mapDispatchToProps(dispatch) {
87
- return {
88
- dispatch,
89
- };
90
- }
91
-
92
- export default connect(null, mapDispatchToProps)(MobilepushWrapper);
@@ -1,25 +0,0 @@
1
- /*
2
- * MobilepushWrapper Messages
3
- *
4
- * This contains all the text for the MobilepushWrapper component.
5
- */
6
- import { defineMessages } from 'react-intl';
7
-
8
- export default defineMessages({
9
- header: {
10
- id: 'app.containers.MobilepushWrapper.header',
11
- defaultMessage: 'This is MobilepushWrapper container !',
12
- },
13
- image: {
14
- id: 'app.containers.MobilepushWrapper.image',
15
- defaultMessage: 'Image content',
16
- },
17
- text: {
18
- id: 'app.containers.MobilepushWrapper.text',
19
- defaultMessage: 'Text content',
20
- },
21
- createMode: {
22
- id: 'app.containers.MobilepushWrapper.createMode',
23
- defaultMessage: 'Which type of content you want to create?',
24
- },
25
- });
@@ -1,10 +0,0 @@
1
- // import React from 'react';
2
- // import { shallow } from 'enzyme';
3
-
4
- // import { MobilepushWrapper } from '../index';
5
-
6
- describe('<MobilepushWrapper />', () => {
7
- it('Expect to have unit tests specified', () => {
8
- expect(true).toEqual(false);
9
- });
10
- });
@@ -1,8 +0,0 @@
1
- .wechat-container {
2
- .cap-checkbox {
3
- margin-bottom: 24px;
4
- .ant-checkbox-wrapper{
5
- padding-left: 0;
6
- }
7
- }
8
- }
@@ -1,52 +0,0 @@
1
- /*
2
- *
3
- * WeChat actions
4
- *
5
- */
6
-
7
- import * as types from './constants';
8
-
9
- export function getDefaultWeChatTemplates(channel, queryParams) {
10
- return {
11
- type: types.GET_WECHAT_DEFAULT_TEMPLATES_REQUEST,
12
- channel,
13
- queryParams,
14
- };
15
- }
16
- export function createTemplate(template) {
17
- return {
18
- type: types.CREATE_TEMPLATE_REQUEST, template,
19
- };
20
- }
21
-
22
- export function clearCreateResponse() {
23
- return {
24
- type: types.CLEAR_CREATE_RESPONSE_REQUEST,
25
- };
26
- }
27
-
28
- export function getWeCrmAccounts() {
29
- return {
30
- type: types.GET_WECRM_ACCOUNTS_REQUEST,
31
- };
32
- }
33
-
34
- export function setWeChatAccount(weChatAccount) {
35
- return {
36
- type: types.SET_WECHAT_ACCOUNT,
37
- weChatAccount,
38
- };
39
- }
40
-
41
- export function getTemplateDetails(id) {
42
- console.log('getting template', id);
43
- return {
44
- type: types.GET_TEMPLATE_DETAILS_REQUEST, id,
45
- };
46
- }
47
- export function setTemplateDetails(templateDetails) {
48
- return {
49
- type: types.GET_TEMPLATE_DETAILS_SUCCESS,
50
- data: templateDetails,
51
- };
52
- }
@@ -1,28 +0,0 @@
1
- /*
2
- *
3
- * WeChat constants
4
- *
5
- */
6
-
7
- export const GET_WECHAT_DEFAULT_TEMPLATES_REQUEST = 'app/containers/WeChat/GET_WECHAT_DEFAULT_TEMPLATES_REQUEST';
8
- export const GET_WECHAT_DEFAULT_TEMPLATES_SUCCESS = 'app/containers/WeChat/GET_WECHAT_DEFAULT_TEMPLATES_SUCCESS';
9
- export const GET_WECHAT_DEFAULT_TEMPLATES_FAILURE = 'app/containers/WeChat/GET_WECHAT_DEFAULT_TEMPLATES_FAILURE';
10
-
11
- export const CREATE_TEMPLATE_REQUEST = 'app/containers/WeChat/CREATE_TEMPLATE_REQUEST';
12
- export const CREATE_TEMPLATE_SUCCESS = 'app/containers/WeChat/CREATE_TEMPLATE_SUCCESS';
13
- export const CREATE_TEMPLATE_FAILURE = 'app/containers/WeChat/CREATE_TEMPLATE_FAILURE';
14
-
15
- export const CLEAR_CREATE_RESPONSE_REQUEST = 'app/containers/WeChat/CLEAR_CREATE_RESPONSE_REQUEST';
16
- export const CLEAR_CREATE_RESPONSE_SUCCESS = 'app/containers/WeChat/CLEAR_CREATE_RESPONSE_SUCCESS';
17
- export const CLEAR_CREATE_RESPONSE_FAILURE = 'app/containers/WeChat/CLEAR_CREATE_RESPONSE_FAILURE';
18
-
19
- export const GET_WECRM_ACCOUNTS_REQUEST = "app/containers/WeChat/GET_WECRM_ACCOUNTS_REQUEST";
20
- export const GET_WECRM_ACCOUNTS_SUCCESS = "app/containers/WeChat/GET_WECRM_ACCOUNTS_SUCCESS";
21
- export const GET_WECRM_ACCOUNTS_FAILURE = "app/containers/WeChat/GET_WECRM_ACCOUNTS_FAILURE";
22
-
23
- export const GET_TEMPLATE_DETAILS_REQUEST = 'app/containers/WeChat/GET_TEMPLATE_DETAILS_REQUEST';
24
- export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/containers/WeChat/GET_TEMPLATE_DETAILS_SUCCESS';
25
- export const GET_TEMPLATE_DETAILS_FAILURE = 'app/containers/WeChat/GET_TEMPLATE_DETAILS_FAILURE';
26
-
27
-
28
- export const SET_WECHAT_ACCOUNT = "app/containers/WeChat/SET_WECHAT_ACCOUNT";