@capillarytech/creatives-library 2.0.62 → 2.0.64
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/assets/NoImage1.js +50 -0
- package/assets/WithImage1.js +57 -0
- package/components/EmailPreview/assets/images/iPad.svg +10 -0
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/FormBuilder/_formBuilder.scss +7 -1
- package/components/FormBuilder/index.js +97 -65
- package/components/MobilePushPreviewV2/index.js +120 -0
- package/components/MobilePushPreviewV2/messages.js +13 -0
- package/components/MobilePushPreviewV2/tests/index.test.js +10 -0
- package/components/TemplatePreview/index.js +1 -1
- package/containers/CreativesContainer/SlideBoxContent.js +27 -4
- package/containers/CreativesContainer/SlideBoxFooter.js +3 -3
- package/containers/CreativesContainer/index.js +71 -24
- package/containers/MobilePush/Create/_mobilePushCreate.scss +13 -0
- package/containers/MobilePush/Create/actions.js +6 -0
- package/containers/MobilePush/Create/constants.js +1 -0
- package/containers/MobilePush/Create/index.js +630 -1130
- package/containers/MobilePush/Create/messages.js +5 -1
- package/containers/MobilePush/Create/reducer.js +2 -0
- package/containers/MobilePush/Create/selectors.js +3 -3
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +10 -0
- package/containers/MobilePush/Edit/index.js +375 -1106
- package/containers/MobilePush/Edit/messages.js +4 -0
- package/containers/MobilePush/Edit/reducer.js +2 -1
- package/containers/MobilePush/Edit/selectors.js +3 -1
- package/containers/MobilePush/commonMethods.js +249 -0
- package/containers/MobilePush/eventsMap.js +127 -0
- package/containers/MobilePush/initialSchema.js +1751 -0
- package/containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
- package/containers/MobilepushWrapper/index.js +95 -0
- package/containers/MobilepushWrapper/messages.js +25 -0
- package/containers/MobilepushWrapper/tests/index.test.js +10 -0
- package/containers/WeChat/_wechat.scss +8 -0
- package/containers/WeChat/actions.js +52 -0
- package/containers/WeChat/constants.js +28 -0
- package/containers/WeChat/index.js +1635 -0
- package/containers/WeChat/messages.js +73 -0
- package/containers/WeChat/reducer.js +74 -0
- package/containers/WeChat/sagas.js +86 -0
- package/containers/WeChat/selectors.js +25 -0
- package/containers/WeChat/tests/actions.test.js +18 -0
- package/containers/WeChat/tests/index.test.js +10 -0
- package/containers/WeChat/tests/reducer.test.js +9 -0
- package/containers/WeChat/tests/sagas.test.js +15 -0
- package/containers/WeChat/tests/selectors.test.js +10 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/services/api.js +3 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.mobilepush-wrapper {
|
|
2
|
+
.ant-card-body {
|
|
3
|
+
padding: unset;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ant-radio-group.cap-radioCard-v2 {
|
|
7
|
+
.ant-radio-button-wrapper{
|
|
8
|
+
width: 258px;
|
|
9
|
+
height: 258px;
|
|
10
|
+
}
|
|
11
|
+
.radio-card-header {
|
|
12
|
+
margin-top: 8px;
|
|
13
|
+
margin-left: 16px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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 WithImage from '../../assets/WithImage1';
|
|
14
|
+
import WithNoImage from '../../assets/NoImage1';
|
|
15
|
+
import messages from './messages';
|
|
16
|
+
import './_mobilepushWrapper.scss';
|
|
17
|
+
export class MobilepushWrapper extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
this.modes = [
|
|
21
|
+
{
|
|
22
|
+
title: <FormattedMessage {...messages.text}/>,
|
|
23
|
+
content: <WithNoImage height="124px" width={"248px"}/>,
|
|
24
|
+
value: 'text',
|
|
25
|
+
// onClick: () => {
|
|
26
|
+
// this.emailUploader.current.click();
|
|
27
|
+
// },
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: <FormattedMessage {...messages.image}/>,
|
|
31
|
+
content: <WithImage height="248px" width={"248px"}/>,
|
|
32
|
+
value: 'image',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
onChange = (e) => {
|
|
37
|
+
this.props.onMobilepushModeChange( e.target.value );
|
|
38
|
+
};
|
|
39
|
+
render() {
|
|
40
|
+
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query} = this.props;
|
|
41
|
+
const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
|
|
42
|
+
return (
|
|
43
|
+
<div className="mobilepush-wrapper">
|
|
44
|
+
{step === "modeSelection" ?
|
|
45
|
+
<div>
|
|
46
|
+
<CapHeader size="small" title={<FormattedMessage {...messages.createMode}/>}/>
|
|
47
|
+
<CapRadioCard
|
|
48
|
+
panes={this.modes}
|
|
49
|
+
cardHeight={"286px"}
|
|
50
|
+
onChange={this.onChange}
|
|
51
|
+
selected={mobilePushCreateMode}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
:
|
|
55
|
+
<div>
|
|
56
|
+
{isShowMobilepushCreate && <MobilepushCreate
|
|
57
|
+
getFormLibraryData={getFormData}
|
|
58
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
59
|
+
location={{
|
|
60
|
+
pathname: `/mobilepush/create/${mobilePushCreateMode}`,
|
|
61
|
+
query,
|
|
62
|
+
}}
|
|
63
|
+
params={{mode: mobilePushCreateMode}}
|
|
64
|
+
isFullMode={false}
|
|
65
|
+
isGetFormData={isGetFormData}
|
|
66
|
+
route={{ name: 'mobilepush' }}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
</div>
|
|
72
|
+
}
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
MobilepushWrapper.propTypes = {
|
|
79
|
+
onMobilepushModeChange: PropTypes.func,
|
|
80
|
+
mobilePushCreateMode: PropTypes.string,
|
|
81
|
+
step: PropTypes.string,
|
|
82
|
+
getFormData: PropTypes.string,
|
|
83
|
+
setIsLoadingContent: PropTypes.func,
|
|
84
|
+
isGetFormData: PropTypes.bool,
|
|
85
|
+
query: PropTypes.object,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
function mapDispatchToProps(dispatch) {
|
|
90
|
+
return {
|
|
91
|
+
dispatch,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export default connect(null, mapDispatchToProps)(MobilepushWrapper);
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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";
|