@capillarytech/creatives-library 2.0.60 → 2.0.61

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 (30) hide show
  1. package/components/EmailPreview/assets/images/iPad.svg +10 -0
  2. package/components/EmailPreview/assets/images/mobile.png +0 -0
  3. package/components/FormBuilder/index.js +2 -1
  4. package/components/MobilePushPreviewV2/index.js +120 -0
  5. package/components/MobilePushPreviewV2/messages.js +13 -0
  6. package/components/MobilePushPreviewV2/tests/index.test.js +10 -0
  7. package/components/TemplatePreview/index.js +1 -1
  8. package/containers/CreativesContainer/SlideBoxContent.js +28 -5
  9. package/containers/CreativesContainer/SlideBoxFooter.js +3 -3
  10. package/containers/CreativesContainer/index.js +72 -25
  11. package/containers/MobilePush/Create/index.js +4 -2
  12. package/containers/MobilepushWrapper/index.js +92 -0
  13. package/containers/MobilepushWrapper/messages.js +25 -0
  14. package/containers/MobilepushWrapper/tests/index.test.js +10 -0
  15. package/containers/TemplatesV2/index.js +8 -7
  16. package/containers/WeChat/_wechat.scss +8 -0
  17. package/containers/WeChat/actions.js +52 -0
  18. package/containers/WeChat/constants.js +28 -0
  19. package/containers/WeChat/index.js +1635 -0
  20. package/containers/WeChat/messages.js +73 -0
  21. package/containers/WeChat/reducer.js +74 -0
  22. package/containers/WeChat/sagas.js +86 -0
  23. package/containers/WeChat/selectors.js +25 -0
  24. package/containers/WeChat/tests/actions.test.js +18 -0
  25. package/containers/WeChat/tests/index.test.js +10 -0
  26. package/containers/WeChat/tests/reducer.test.js +9 -0
  27. package/containers/WeChat/tests/sagas.test.js +15 -0
  28. package/containers/WeChat/tests/selectors.test.js +10 -0
  29. package/index.js +1 -1
  30. package/package.json +1 -1
@@ -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
+ });
@@ -50,16 +50,14 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
50
50
  constructor(props) {
51
51
  super(props);
52
52
  const defaultChannel = get(this, 'props.channel') || get(this, 'props.params.channel') || 'sms';
53
- const defaultPanes = [
53
+ const deafaultPanes = [
54
54
  {content: <div></div>, tab: 'Sms', key: 'sms'},
55
55
  {content: <div></div>, tab: 'Email', key: 'email'},
56
+ {content: <div></div>, tab: 'Call Task', key: 'calltask'},
56
57
  // {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
57
58
  {content: <div></div>, tab: 'Mpush', key: 'mobilepush'},
58
59
  ];
59
- if (!props.isFullMode) {
60
- defaultPanes.push({content: <div></div>, tab: 'Call Task', key: 'call_task'});
61
- }
62
- const panes = this.setChannelContent(defaultChannel, defaultPanes);
60
+ const panes = this.setChannelContent(defaultChannel, deafaultPanes);
63
61
  this.state = {
64
62
  selectedChannel: defaultChannel,
65
63
  panes,
@@ -107,7 +105,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
107
105
  if (!this.props.isFullMode) {
108
106
  query = {type: 'embedded', module: 'library'};
109
107
  }
110
- return (channel === 'call_task' ?
108
+ return (channel === 'calltask' ?
111
109
  this.getCallTaskComponent() :
112
110
  <Templates
113
111
  key={channel}
@@ -126,10 +124,13 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
126
124
  const panes = argsPanes.map((p) => {
127
125
  const pane = p;
128
126
  if (pane.key === selectedChannel) {
129
- let channel = selectedChannel;
127
+ let channel = pane.tab.toLowerCase();
130
128
  if (channel === "mpush") {
131
129
  channel = "mobilepush";
132
130
  }
131
+ if (channel === 'call task') {
132
+ channel = "calltask";
133
+ }
133
134
  pane.content = this.getTemplatesComponent(channel);
134
135
  return pane;
135
136
  }
@@ -0,0 +1,8 @@
1
+ .wechat-container {
2
+ .cap-checkbox {
3
+ margin-bottom: 24px;
4
+ .ant-checkbox-wrapper{
5
+ padding-left: 0;
6
+ }
7
+ }
8
+ }
@@ -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";