@capillarytech/creatives-library 3.0.4 → 3.0.6

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 (71) hide show
  1. package/components/FormBuilder/index.js +15 -15
  2. package/containers/Dashboard/index.js +5 -0
  3. package/containers/Email/index.js +5 -4
  4. package/containers/Line/Create/index.js +3 -3
  5. package/containers/MobilePush/Edit/index.js +2 -2
  6. package/containers/WeChat/MapTemplates/index.js +64 -58
  7. package/containers/WeChat/RichmediaTemplates/Create/index.js +3 -3
  8. package/index.html +3 -0
  9. package/package.json +1 -1
  10. package/routes.js +1 -3
  11. package/v2Components/FormBuilder/index.js +12 -18
  12. package/v2Components/NavigationBar/index.js +7 -4
  13. package/v2Components/NavigationBar/messages.js +6 -2
  14. package/v2Containers/Cap/index.js +2 -1
  15. package/v2Containers/CreativesContainer/SlideBoxContent.js +6 -2
  16. package/v2Containers/Email/index.js +27 -42
  17. package/v2Containers/Email/initialSchema.js +2 -58
  18. package/v2Containers/Email/messages.js +4 -0
  19. package/v2Containers/Email/sagas.js +0 -2
  20. package/v2Containers/MobilePush/Create/actions.js +2 -2
  21. package/v2Containers/MobilePush/Create/index.js +17 -16
  22. package/v2Containers/MobilePush/Create/messages.js +1 -1
  23. package/v2Containers/MobilePush/Create/sagas.js +3 -0
  24. package/v2Containers/MobilePush/Edit/index.js +13 -7
  25. package/v2Containers/MobilePush/initialSchema.js +3 -0
  26. package/v2Containers/MobilepushWrapper/index.js +3 -1
  27. package/v2Containers/Templates/index.js +14 -11
  28. package/assets/android-message-gui-2.svg +0 -55
  29. package/components/CallTaskPreview/_callTaskPreview.scss +0 -17
  30. package/components/CallTaskPreview/images/Footer.png +0 -0
  31. package/components/CallTaskPreview/images/Header.png +0 -0
  32. package/components/CallTaskPreview/index.js +0 -37
  33. package/components/CallTaskPreview/messages.js +0 -13
  34. package/components/CallTaskPreview/tests/index.test.js +0 -15
  35. package/components/CmsTemplatesComponent/index.js +0 -33
  36. package/components/CmsTemplatesComponent/messages.js +0 -17
  37. package/components/CmsTemplatesComponent/tests/index.test.js +0 -10
  38. package/components/EmailMobilePreview/index.js +0 -129
  39. package/components/EmailMobilePreview/index.scss +0 -55
  40. package/components/EmailPreviewV2/_emailPreviewV2.scss +0 -69
  41. package/components/EmailPreviewV2/index.js +0 -132
  42. package/components/EmailPreviewV2/messages.js +0 -41
  43. package/components/EmailPreviewV2/tests/index.test.js +0 -10
  44. package/components/MobilePushPreviewV2/index.js +0 -120
  45. package/components/MobilePushPreviewV2/messages.js +0 -13
  46. package/components/MobilePushPreviewV2/tests/index.test.js +0 -10
  47. package/components/NewCallTask/_newCallTask.scss +0 -9
  48. package/components/NewCallTask/index.js +0 -152
  49. package/components/NewCallTask/messages.js +0 -29
  50. package/components/NewCallTask/tests/index.test.js +0 -10
  51. package/components/SmsPreviewV2/_smsPreviewV2.scss +0 -353
  52. package/components/SmsPreviewV2/index.js +0 -69
  53. package/components/SmsPreviewV2/messages.js +0 -13
  54. package/components/SmsPreviewV2/tests/index.test.js +0 -10
  55. package/v2Components/DateFilter/index.js +0 -349
  56. package/v2Components/DateFilter/messages.js +0 -17
  57. package/v2Components/DateFilter/tests/index.test.js +0 -15
  58. package/v2Components/DateRange/index.js +0 -113
  59. package/v2Components/DateRange/messages.js +0 -13
  60. package/v2Components/DateRange/tests/index.test.js +0 -10
  61. package/v2Components/PageHeader/_pageHeader.scss +0 -22
  62. package/v2Components/PageHeader/index.js +0 -37
  63. package/v2Components/PageHeader/messages.js +0 -13
  64. package/v2Components/PageHeader/tests/index.test.js +0 -10
  65. package/v2Components/Sidebar/_sidebar.scss +0 -115
  66. package/v2Components/Sidebar/index.js +0 -208
  67. package/v2Components/Sidebar/messages.js +0 -21
  68. package/v2Components/Sidebar/tests/index.test.js +0 -10
  69. package/v2Components/SmsEditor/index.js +0 -55
  70. package/v2Components/SmsEditor/tests/index.test.js +0 -10
  71. package/v2Components/TopBar/_topbar.scss +0 -46
@@ -1,13 +0,0 @@
1
- /*
2
- * PageHeader Messages
3
- *
4
- * This contains all the text for the PageHeader component.
5
- */
6
- import { defineMessages } from 'react-intl';
7
-
8
- export default defineMessages({
9
- header: {
10
- id: 'app.components.PageHeader.header',
11
- defaultMessage: 'This is the PageHeader component !',
12
- },
13
- });
@@ -1,10 +0,0 @@
1
- // import React from 'react';
2
- // import { shallow } from 'enzyme';
3
-
4
- // import PageHeader from '../index';
5
-
6
- // describe('<PageHeader />', () => {
7
- // it('Expect to have unit tests specified', () => {
8
- // expect(true).toEqual(false);
9
- // });
10
- // });
@@ -1,115 +0,0 @@
1
- #cap-sidebar{
2
- padding: 8px 0 8px 0;
3
- max-width: 200px;
4
- min-width: 200px;
5
- width: 16%;
6
- overflow-y: hidden;
7
- // height: 100%;
8
- // display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
9
- // display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
10
- // display: -ms-flexbox; /* TWEENER - IE 10 */
11
- // display: -webkit-flex; /* NEW - Chrome */
12
- // display: flex;
13
- overflow-x: hidden;
14
- .header.item{
15
- padding-left: 8px !important;
16
- }
17
- }
18
-
19
- .sidebar-container {
20
- display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
21
- display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
22
- display: -ms-flexbox; /* TWEENER - IE 10 */
23
- display: -webkit-flex; /* NEW - Chrome */
24
- display: flex;
25
- flex: 1;
26
- -webkit-box-flex: 1;
27
- -webkit-flex: 1;
28
- -ms-flex: 1;
29
- }
30
-
31
- .sidebar-accordian .content .item.menu-item:hover{
32
- margin-left: 0 !important;
33
- text-indent: 0 !important;
34
- }
35
- .sidebar-accordian .content .item.menu-item.selected{
36
- margin-left: 0 !important;
37
- text-indent: 0 !important;
38
- }
39
- .ui.accordion.sidebar-accordian .content .item.selected{
40
- background: #F2F3F7 !important;
41
- padding-left: 40px !important;
42
- }
43
-
44
- .item.menu-item{
45
- // margin-left: 0px;
46
- padding-left: 40px !important;
47
- border-left-width: 0 !important;
48
- text-decoration: none;
49
- }
50
- .item.menu-item.selected{
51
- border-left: 4px solid #2e89df !important;
52
- }
53
-
54
- .item.menu-item.assetItem{
55
- padding-left: 28px !important;
56
- line-height: 28px;
57
- padding-top: 8px;
58
- padding-bottom: 8px;
59
- }
60
-
61
- .ui.accordion.sidebar-accordian {
62
- padding-top: 8px !important;
63
- margin-left: 0;
64
- }
65
-
66
- .ui.accordion.sidebar-accordian .title{
67
- font-size: 12px !important;
68
- line-height: 32px !important;
69
- padding-top: 0 !important;
70
- padding-bottom: 0 !important;
71
- }
72
-
73
- .sidebar-width {
74
- // width: 200px !important;
75
- max-width: 250px;
76
- min-width: 190px;
77
- width: 200px;
78
- }
79
- .module-menu-header {
80
- padding-top: 8px!important;
81
- line-height: 32px!important;
82
- font-size: 16px!important;
83
- margin-left: 0!important;
84
- padding-left: 8px;
85
- }
86
-
87
- // .searchbar {
88
- // height: 32px;
89
- // padding-left: 8px;
90
- // }
91
-
92
- .menu-header {
93
- font-size: 12px!important;
94
- line-height: 32px!important;
95
- margin: 0!important;
96
- padding: 0 0 0 8px!important;
97
- width: 100%;
98
- }
99
- .menu-title {
100
- flex: 0 0 90%!important;
101
- }
102
-
103
- .product-select-menu {
104
- width: 100%;
105
- padding-left: 2px;
106
- background: #F2F3F7;
107
- font-family: proxima-nova;
108
- font-size: 16px !important;
109
- font-weight: 600;
110
-
111
- .ant-select-selection {
112
- background: #F2F3F7;
113
- border: none !important;
114
- }
115
- }
@@ -1,208 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- // import styled from 'styled-components';
4
- import { Accordion, Icon, Input, Button } from 'semantic-ui-react';
5
- import { FormattedMessage } from 'react-intl';
6
- import _ from 'lodash';
7
- import { Link } from 'react-router';
8
- import messages from './messages';
9
- import './_sidebar.scss';
10
-
11
- class Sidebar extends React.Component { // eslint-disable-line react/prefer-stateless-function
12
- constructor(props) {
13
- super(props);
14
- this.state = {
15
- isOpen: false,
16
- activeItem: '',
17
- activeIndex: 0,
18
- menuItems: this.props.menuData,
19
- searchText: '',
20
- visible: true,
21
- };
22
- this.handleItemClick = this.handleItemClick.bind(this);
23
- this.handleTitleClick = this.handleTitleClick.bind(this);
24
- this.handleSearch = this.handleSearch.bind(this);
25
- this.toggleSideNav = this.toggleSideNav.bind(this);
26
- this.getLinkElement = this.getLinkElement.bind(this);
27
- this.selectActiveLinkFromUrl = this.selectActiveLinkFromUrl.bind(this);
28
- }
29
-
30
- componentWillMount() {
31
- this.selectActiveLinkFromUrl(this.props);
32
- }
33
-
34
- componentWillReceiveProps(nextProp) {
35
- this.selectActiveLinkFromUrl(nextProp);
36
- this.setState({ menuItems: nextProp.menuData });
37
- }
38
-
39
- getAccordian(content, keyValue) {
40
- return (<Accordion key={keyValue}>{content}</Accordion>);
41
- }
42
-
43
- getAccordionTitle(title) {
44
- return (<Accordion.Title>
45
- <div className="header item">
46
- <Icon name="dropdown" /> {title}
47
- </div>
48
- </Accordion.Title>);
49
- }
50
-
51
- getAccordionContent(links, keyValue) {
52
- return (<Accordion.Content key={keyValue}>{links}</Accordion.Content>);
53
- }
54
-
55
- getLinkElement(to, text, value, isExternal) {
56
- const selectedItem = (value && value.trim().toLowerCase() === this.state.activeItem) ? 'selected' : '';
57
- if (text.toLowerCase().includes(this.state.searchText.toLowerCase())) {
58
- if (isExternal) {
59
- return ((text.toLowerCase().includes(this.state.searchText.toLowerCase())) ? <a key={to} className={`item menu-item ${selectedItem}`} href={to}>{text}</a> : '');
60
- }
61
- return (
62
- (text.toLowerCase().includes(this.state.searchText.toLowerCase())) ?
63
- <Link to={to} className={`item menu-item ${selectedItem}`} onClick={this.handleItemClick} key={to} title={text}>{text}</Link>
64
- : ''
65
- );
66
- }
67
- return '';
68
- }
69
-
70
- selectActiveLinkFromUrl(props) {
71
- const activeRoute = props.router.routes[props.router.routes.length - 1];
72
- const activeRouteName = (activeRoute.name && activeRoute.name.trim().toLowerCase()) || '';
73
- let selectedItem = '';
74
- let selectedIndex = -1;
75
- _.forEach(props.menuData, (menuItem, menuIndex) => {
76
- if (menuItem.items && typeof menuItem.items === 'object') {
77
- _.forEach(menuItem.items, (menuData) => {
78
- // console.log('Menua Data ', menuData, activeRouteName, menuItem);
79
- if ((menuItem.id && menuData.id.toLowerCase() === activeRouteName.toLowerCase()) || (menuData.value.toLowerCase() === activeRouteName.toLowerCase())) {
80
- selectedIndex = menuIndex;
81
- selectedItem = activeRouteName.toLowerCase();
82
- } else if (activeRouteName === 'assets') {
83
- selectedIndex = menuIndex;
84
- selectedItem = 'gallery';
85
- }
86
- });
87
- } else if (menuItem.value.toLowerCase() === activeRouteName.toLowerCase()) {
88
- selectedIndex = menuIndex;
89
- selectedItem = activeRouteName.toLowerCase();
90
- }
91
- });
92
- this.setState({ activeIndex: selectedIndex, activeItem: selectedItem });
93
- }
94
-
95
- toggleSideNav(e) {
96
- e.preventDefault();
97
- this.setState({ visible: !this.state.visible }, () => {
98
- window.dispatchEvent(new Event('resize'));
99
- if (!this.state.visible) {
100
- document.getElementById('cap-sidebar').classList.add('sidebar-collapse');
101
- } else {
102
- document.getElementById('cap-sidebar').classList.remove('sidebar-collapse');
103
- }
104
- });
105
- }
106
-
107
- createAccordianElements(title, contentItems) {
108
- const accordian = [];
109
- accordian.push(this.getAccordionTitle(title));
110
- const contentLink = contentItems.map((key) =>
111
- this.getLinkElement(key.link, key.text, key.value, key.external),
112
- );
113
- accordian.push(this.getAccordionContent(contentLink));
114
- return accordian;
115
- }
116
-
117
- createNavigationElement(menuItems) {
118
- const navArray = [];
119
- _.forEach(menuItems, (key, index) => {
120
- const headerTitle = key.group;
121
- const isCategory = Object.prototype.hasOwnProperty.call(key, 'categories');
122
- if (isCategory) { // attach nested Accordion
123
- const accordian = [];
124
- const nestedAcordian = [];
125
- accordian.push(this.getAccordionTitle(headerTitle));
126
- const contentAccordian = this.getAccordian(this.createNavigationElement(key.categories), `nestedAccordian-${index}`);
127
- nestedAcordian.push(contentAccordian);
128
- const content = this.getAccordionContent(nestedAcordian, `content-${index}`);
129
- accordian.push(content);
130
- navArray.push(accordian);
131
- } else { // attach items to existing accordian
132
- const accordianElem = this.createAccordianElements(headerTitle, key.items);
133
- navArray.push(accordianElem);
134
- }
135
- });
136
- // const selectedItem = (this.state.activeItem === 'gallery') ? 'selected' : '';
137
- // navArray.push(
138
- // <Link
139
- // to={'/assets'}
140
- // className={`item menu-item ${selectedItem} assetItem`}
141
- // key={'assets'}
142
- // title={'Gallery'}
143
- // onClick={(e) => this.handleItemClick(e)}
144
- // >Gallery</Link>
145
- // );
146
- return navArray;
147
- }
148
-
149
- handleOpen() {
150
- this.setState({ isOpen: true });
151
- }
152
-
153
- handleClose() {
154
- this.setState({ isOpen: false });
155
- }
156
-
157
- handleItemClick(e) {
158
- this.setState({ activeItem: (e.target.text && e.target.text.trim().toLowerCase()) || '' });
159
- }
160
-
161
- handleTitleClick(e, i) {
162
- this.setState({ activeIndex: this.state.activeIndex === i ? -1 : i });
163
- }
164
-
165
- handleSearch(e) {
166
- this.setState({ searchText: e.target.value });
167
- }
168
-
169
-
170
- render() {
171
- const visible = this.state.visible;
172
- const push = !visible ? 'push' : '';
173
- const collapse = !visible ? 'collapse' : '';
174
- const toggle = visible ? 'hide' : '';
175
-
176
- // const types = [{ text: 'Creatives', value: 'Creatives' }];
177
- return (
178
- <div className="sidebar-container">
179
- <div className={`sidebar sidebar-width ${collapse}`}>
180
- <div className="searchbar">
181
- <FormattedMessage {...messages.inputPlaceholder}>{(message) => <Input icon="search" className="sidebar-search" placeholder={message} fluid onChange={this.handleSearch} />}</FormattedMessage>
182
- <a href="" onClick={this.toggleSideNav}><i className="material-icons control-arrow">arrow_back</i></a>
183
- </div>
184
-
185
- <div className="menu-header">
186
- <span className="menu-title"><FormattedMessage {...messages.menuTitle} /> </span>
187
- {this.props.actionComponents}
188
- </div>
189
- <Accordion className="sidebar-accordian" activeIndex={this.state.activeIndex} onTitleClick={this.handleTitleClick}>
190
- {this.props.menuData && this.createNavigationElement(this.props.menuData)}
191
- </Accordion>
192
- </div>
193
- <div className={`togglebar ${toggle} ${push}`}>
194
- <Button icon className="btn-toggle" onClick={this.toggleSideNav}>
195
- <Icon name="bars" />
196
- </Button>
197
- </div>
198
- </div>
199
- );
200
- }
201
- }
202
-
203
- Sidebar.propTypes = {
204
- menuData: PropTypes.array.isRequired,
205
- actionComponents: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
206
- };
207
-
208
- export default Sidebar;
@@ -1,21 +0,0 @@
1
- /*
2
- * Sidebar Messages
3
- *
4
- * This contains all the text for the Sidebar component.
5
- */
6
- import { defineMessages } from 'react-intl';
7
-
8
- export default defineMessages({
9
- inputPlaceholder: {
10
- id: 'app.components.Sidebar.input.placeholder',
11
- defaultMessage: 'Search...',
12
- },
13
- menuTitle: {
14
- id: 'app.components.Sidebar.menuTitle',
15
- defaultMessage: 'Menu',
16
- },
17
- creatives: {
18
- id: 'app.components.Sidebar.creatives',
19
- defaultMessage: 'Creatives',
20
- },
21
- });
@@ -1,10 +0,0 @@
1
- // import React from 'react';
2
- // import { shallow } from 'enzyme';
3
-
4
- // import Sidebar from '../index';
5
-
6
- // describe('<Sidebar />', () => {
7
- // it('Expect to have unit tests specified', () => {
8
- // expect(true).toEqual(false);
9
- // });
10
- // });
@@ -1,55 +0,0 @@
1
- /**
2
- *
3
- * SmsEditor
4
- *
5
- */
6
-
7
- import PropTypes from 'prop-types';
8
-
9
- import React from 'react';
10
- // import styled from 'styled-components';
11
- import {TextArea} from 'semantic-ui-react';
12
-
13
-
14
- class SmsEditor extends React.Component { // eslint-disable-line react/prefer-stateless-function
15
- constructor(props) {
16
- super(props);
17
- if (this.props.content) {
18
- this.state = {
19
- content: this.props.content,
20
- };
21
- } else {
22
- this.state = {
23
- content: '',
24
- };
25
- }
26
- this.onContentChange = this.onContentChange.bind(this);
27
- }
28
-
29
- onContentChange(e, data) {
30
- this.props.onDataChange(data);
31
- this.setState({
32
- content: data,
33
- });
34
- }
35
-
36
- render() {
37
- return (
38
- <div>
39
- <TextArea
40
- autoHeight
41
- style={{minHeight: 100}}
42
- value={this.props.content}
43
- onChange={(e, data) => { this.onContentChange(e, data); }}
44
- />
45
- </div>
46
- );
47
- }
48
- }
49
-
50
- SmsEditor.propTypes = {
51
- content: PropTypes.string,
52
- onDataChange: PropTypes.func,
53
- };
54
-
55
- export default SmsEditor;
@@ -1,10 +0,0 @@
1
- // import React from 'react';
2
- // import { shallow } from 'enzyme';
3
-
4
- // import SmsEditor from '../index';
5
-
6
- // describe('<SmsEditor />', () => {
7
- // it('Expect to have unit tests specified', () => {
8
- // expect(true).toEqual(false);
9
- // });
10
- // });
@@ -1,46 +0,0 @@
1
- .ui.navbar.menu {
2
- height: 40px !important;
3
- }
4
- .ui.menu.navbar .item>img.logo{
5
- height: 27px !important;
6
- padding-left: 0!important;
7
- margin: 0 auto;
8
- max-width: 200px;
9
- }
10
- .ui.menu.navbar .ui.selection.dropdown{
11
- height: 40px !important;
12
- }
13
-
14
- .ui.menu .ui.dropdown .menu>.selected.item {
15
- background: #151821;
16
- }
17
- .org-list-drp-dwn .menu > .item{
18
- height: 40px !important;
19
- }
20
- .ui.menu.navbar .ui.dropdown .menu>.item{
21
- height: 40px !important;
22
- }
23
-
24
- .ui.search.selection.dropdown>input.search{
25
- padding-left: 12px !important;
26
- padding-top: 8px !important;
27
- padding-bottom: 8px !important;
28
- }
29
-
30
- .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
31
- padding-right: 4px;
32
- }
33
-
34
- .ui.menu .item {
35
- padding-left: 12px !important;
36
- padding-right: 12px !important;
37
- }
38
-
39
- .ui.secondary.vertical.menu>.item {
40
- margin-bottom: 0 !important;
41
- padding: 8px 16px !important;
42
- }
43
-
44
- .ui.menu.navbar .item.dropdownItem {
45
- padding: 0px !important;
46
- }