@capillarytech/creatives-library 3.0.35 → 3.1.0
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/noImage.png +0 -0
- package/components/BreadCrumbs/messages.js +1 -1
- package/components/CapTagList/index.js +3 -3
- package/components/CapTagList/messages.js +4 -16
- package/components/Ckeditor/messages.js +1 -1
- package/components/CustomPopOver/index.js +4 -3
- package/components/CustomPopOver/messages.js +1 -5
- package/components/DateFilter/index.js +12 -12
- package/components/DateFilter/messages.js +0 -40
- package/components/DateRange/index.js +4 -5
- package/components/DateRange/messages.js +1 -13
- package/components/Edmeditor/messages.js +1 -1
- package/components/EmailPreview/index.js +4 -4
- package/components/EmailPreview/messages.js +2 -18
- package/components/Footer/messages.js +1 -1
- package/components/FormBuilder/index.js +19 -15
- package/components/FormBuilder/messages.js +1 -33
- package/components/Header/messages.js +4 -4
- package/components/ImagePreview/index.js +1 -1
- package/components/ImagePreview/messages.js +1 -5
- package/components/PageHeader/messages.js +1 -1
- package/components/PreviewSideBar/index.js +2 -2
- package/components/PreviewSideBar/messages.js +6 -14
- package/components/Sidebar/messages.js +3 -3
- package/components/SmsTest/index.js +4 -6
- package/components/SmsTest/messages.js +1 -9
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +3 -3
- package/components/TemplatePreview/index.js +10 -11
- package/components/TemplatePreview/messages.js +7 -23
- package/components/Toastr/messages.js +1 -1
- package/components/ToastrMessage/index.js +1 -4
- package/components/ToastrMessage/messages.js +1 -5
- package/components/TopBar/messages.js +1 -1
- package/config/app.js +0 -2
- package/containers/Assets/Gallery/messages.js +20 -20
- package/containers/Cap/index.js +5 -5
- package/containers/Dashboard/index.js +2 -2
- package/containers/Dashboard/messages.js +1 -1
- package/containers/Ebill/index.js +1 -1
- package/containers/Ebill/messages.js +16 -20
- package/containers/Email/index.js +24 -24
- package/containers/Email/messages.js +59 -107
- package/containers/Line/Create/index.js +7 -7
- package/containers/Line/Create/messages.js +42 -58
- package/containers/Line/Edit/index.js +14 -14
- package/containers/Line/Edit/messages.js +38 -58
- package/containers/Login/components/LoginForm/index.js +7 -10
- package/containers/Login/components/LoginForm/messages.js +3 -15
- package/containers/Login/index.js +1 -1
- package/containers/Login/messages.js +3 -7
- package/containers/MobilePush/Create/index.js +45 -45
- package/containers/MobilePush/Create/messages.js +75 -111
- package/containers/MobilePush/Edit/index.js +45 -45
- package/containers/MobilePush/Edit/messages.js +83 -100
- package/containers/NotFoundPage/messages.js +1 -1
- package/containers/Sms/Create/index.js +8 -7
- package/containers/Sms/Create/messages.js +19 -43
- package/containers/Sms/Edit/index.js +4 -4
- package/containers/Sms/Edit/messages.js +20 -36
- package/containers/TagList/messages.js +1 -1
- package/containers/Templates/index.js +19 -20
- package/containers/Templates/messages.js +64 -136
- package/containers/TestPage/messages.js +1 -1
- package/containers/Testv2/index.js +2 -2
- package/containers/Testv2/messages.js +1 -9
- package/containers/WeChat/MapTemplates/index.js +10 -10
- package/containers/WeChat/MapTemplates/messages.js +17 -49
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +33 -33
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +1 -1
- package/containers/WeChat/RichmediaTemplates/View/index.js +2 -2
- package/containers/WeChat/RichmediaTemplates/View/messages.js +1 -9
- package/index.js +20 -8
- package/package.json +4 -1
- package/routes.js +16 -2
- package/services/api.js +2 -17
- package/services/getSchema.js +4 -1
- package/translations/en.json +360 -1396
- package/translations/zh.json +381 -1417
- package/utils/smsCharCountV2.js +10 -26
- package/v2Components/BreadCrumbs/messages.js +1 -1
- package/v2Components/CallTaskPreview/messages.js +1 -1
- package/v2Components/CapTagList/index.js +5 -6
- package/v2Components/CapTagList/messages.js +4 -24
- package/v2Components/Ckeditor/index.js +0 -1
- package/v2Components/Ckeditor/messages.js +1 -1
- package/v2Components/CmsTemplatesComponent/messages.js +2 -2
- package/v2Components/CustomPopOver/index.js +2 -4
- package/v2Components/CustomPopOver/messages.js +1 -5
- package/v2Components/DateFilter/index.js +349 -0
- package/v2Components/DateFilter/messages.js +17 -0
- package/v2Components/DateFilter/tests/index.test.js +15 -0
- package/v2Components/DateRange/index.js +113 -0
- package/v2Components/DateRange/messages.js +13 -0
- package/v2Components/DateRange/tests/index.test.js +10 -0
- package/v2Components/Edmeditor/messages.js +1 -1
- package/v2Components/EmailPreview/index.js +2 -2
- package/v2Components/EmailPreview/messages.js +3 -11
- package/v2Components/EmailPreviewV2/index.js +1 -1
- package/v2Components/EmailPreviewV2/messages.js +9 -13
- package/v2Components/Footer/messages.js +1 -1
- package/v2Components/FormBuilder/_formBuilder.scss +19 -0
- package/v2Components/FormBuilder/index.js +58 -27
- package/v2Components/FormBuilder/messages.js +1 -49
- package/v2Components/Header/index.js +2 -2
- package/v2Components/Header/messages.js +4 -4
- package/v2Components/ImagePreview/index.js +2 -3
- package/v2Components/ImagePreview/messages.js +1 -5
- package/v2Components/MobilePushPreviewV2/index.js +5 -2
- package/v2Components/MobilePushPreviewV2/messages.js +1 -9
- package/v2Components/NavigationBar/messages.js +1 -1
- package/v2Components/NewCallTask/messages.js +5 -5
- package/v2Components/PageHeader/_pageHeader.scss +22 -0
- package/v2Components/PageHeader/index.js +37 -0
- package/v2Components/PageHeader/messages.js +13 -0
- package/v2Components/PageHeader/tests/index.test.js +10 -0
- package/v2Components/PreviewSideBar/messages.js +6 -6
- package/v2Components/Sidebar/_sidebar.scss +115 -0
- package/v2Components/Sidebar/index.js +208 -0
- package/v2Components/Sidebar/messages.js +21 -0
- package/v2Components/Sidebar/tests/index.test.js +10 -0
- package/v2Components/SmsEditor/index.js +55 -0
- package/v2Components/SmsEditor/tests/index.test.js +10 -0
- package/v2Components/SmsTest/index.js +4 -6
- package/v2Components/SmsTest/messages.js +1 -9
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +2 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +18 -28
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +3 -3
- package/v2Components/TemplatePreview/_templatePreview.scss +0 -9
- package/v2Components/TemplatePreview/index.js +16 -35
- package/v2Components/TemplatePreview/messages.js +7 -23
- package/v2Components/Toastr/messages.js +1 -1
- package/v2Components/ToastrMessage/index.js +2 -3
- package/v2Components/ToastrMessage/messages.js +1 -5
- package/v2Components/TopBar/_topbar.scss +46 -0
- package/v2Components/TopBar/messages.js +7 -7
- package/v2Containers/App/constants.js +0 -11
- package/v2Containers/Assets/Gallery/messages.js +24 -24
- package/v2Containers/CallTask/messages.js +6 -6
- package/v2Containers/Cap/actions.js +0 -1
- package/v2Containers/Cap/index.js +9 -6
- package/v2Containers/Cap/messsages.js +15 -19
- package/v2Containers/Cap/sagas.js +8 -1
- package/v2Containers/ChannelTemplates/messages.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +39 -1
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +7 -1
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +21 -3
- package/v2Containers/CreativesContainer/index.js +95 -50
- package/v2Containers/CreativesContainer/index.scss +15 -0
- package/v2Containers/CreativesContainer/messages.js +12 -16
- package/v2Containers/Dashboard/index.js +1 -2
- package/v2Containers/Dashboard/messages.js +1 -1
- package/v2Containers/Ebill/index.js +1 -1
- package/v2Containers/Ebill/messages.js +16 -20
- package/v2Containers/Email/index.js +20 -20
- package/v2Containers/Email/messages.js +61 -101
- package/v2Containers/EmailWrapper/index.js +44 -64
- package/v2Containers/EmailWrapper/messages.js +12 -12
- package/v2Containers/Line/Create/index.js +3 -3
- package/v2Containers/Line/Create/messages.js +41 -53
- package/v2Containers/Line/Edit/index.js +10 -10
- package/v2Containers/Line/Edit/messages.js +39 -55
- package/v2Containers/Login/components/LoginForm/index.js +6 -9
- package/v2Containers/Login/components/LoginForm/messages.js +3 -15
- package/v2Containers/Login/index.js +1 -1
- package/v2Containers/Login/messages.js +3 -7
- package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +3 -0
- package/v2Containers/MobilePush/Create/index.js +33 -33
- package/v2Containers/MobilePush/Create/messages.js +81 -109
- package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +3 -0
- package/v2Containers/MobilePush/Edit/index.js +22 -22
- package/v2Containers/MobilePush/Edit/messages.js +79 -95
- package/v2Containers/MobilePush/initialSchema.js +1 -2
- package/v2Containers/MobilepushWrapper/messages.js +5 -5
- package/v2Containers/NotFoundPage/messages.js +1 -1
- package/v2Containers/Sms/Create/index.js +6 -6
- package/v2Containers/Sms/Create/messages.js +21 -41
- package/v2Containers/Sms/Edit/index.js +6 -6
- package/v2Containers/Sms/Edit/messages.js +20 -36
- package/v2Containers/TagList/messages.js +1 -1
- package/v2Containers/Templates/_templates.scss +31 -5
- package/v2Containers/Templates/index.js +243 -248
- package/v2Containers/Templates/messages.js +7 -15
- package/v2Containers/Templates/sagas.js +0 -1
- package/v2Containers/TemplatesV2/_templatesV2.scss +5 -0
- package/v2Containers/TemplatesV2/index.js +4 -1
- package/v2Containers/TemplatesV2/messages.js +5 -29
- package/v2Containers/TestPage/messages.js +1 -1
- package/v2Containers/Testv2/index.js +2 -2
- package/v2Containers/Testv2/messages.js +1 -9
- package/v2Containers/WeChat/MapTemplates/_mapTemplates.scss +16 -0
- package/v2Containers/WeChat/MapTemplates/actions.js +4 -2
- package/v2Containers/WeChat/MapTemplates/index.js +800 -872
- package/v2Containers/WeChat/MapTemplates/initialSchema.js +184 -0
- package/v2Containers/WeChat/MapTemplates/messages.js +19 -43
- package/v2Containers/WeChat/MapTemplates/sagas.js +6 -2
- package/v2Containers/WeChat/MapTemplates/selectors.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +118 -28
- package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +3 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +262 -306
- package/v2Containers/WeChat/RichmediaTemplates/Create/messages.js +43 -95
- package/v2Containers/WeChat/RichmediaTemplates/Create/reducer.js +2 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +113 -246
- package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +5 -2
- package/v2Containers/WeChat/RichmediaTemplates/Create/selectors.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +2 -2
- package/v2Containers/WeChat/RichmediaTemplates/Edit/index.js +11 -10
- package/v2Containers/WeChat/RichmediaTemplates/Edit/messages.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/reducer.js +1 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +4 -2
- package/v2Containers/WeChat/RichmediaTemplates/Edit/selectors.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/View/messages.js +1 -9
- package/v2Containers/WeChat/Wrapper/_wrapper.scss +0 -0
- package/v2Containers/WeChat/Wrapper/constants.js +5 -0
- package/v2Containers/WeChat/Wrapper/index.js +194 -0
- package/v2Containers/WeChat/Wrapper/messages.js +21 -0
- package/v2Containers/WeChat/helper.js +12 -0
- package/containers/Cap/messages.js +0 -75
- package/v2Containers/Cap/messages.js +0 -75
package/utils/smsCharCountV2.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import * as Api from './../services/api';
|
|
3
|
-
let optoutUrl;
|
|
4
|
-
let showOptoutCount = true;
|
|
5
|
-
let responseState = "REQUEST";
|
|
6
|
-
|
|
7
2
|
function getURLParameter(name) {
|
|
8
3
|
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null
|
|
9
4
|
}
|
|
@@ -54,26 +49,13 @@ export function checkUnicode(content) {
|
|
|
54
49
|
return false;
|
|
55
50
|
}
|
|
56
51
|
export function updateCharCount(content, isUnicodeEnabled) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
responseState = "SUCCESS";
|
|
61
|
-
}).catch((err) => {
|
|
62
|
-
showOptoutCount = false;
|
|
63
|
-
responseState = "FAIL";
|
|
64
|
-
optoutUrl = undefined;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
const optoutTag = /{{optout}}/g;
|
|
68
|
-
const optoutTagLength = 14;
|
|
69
|
-
const contentOriginal = content;
|
|
70
|
-
const noOfOptout = (content.match(optoutTag) || []).length;
|
|
71
|
-
content = showOptoutCount ? content.replace(optoutTag, "") : content;
|
|
72
|
-
var chars_arr = contentOriginal.split("");
|
|
52
|
+
console.log(content);
|
|
53
|
+
var chars_arr = content.split("");
|
|
54
|
+
console.log(chars_arr);
|
|
73
55
|
var coding = '7bit';
|
|
74
56
|
var parts = 1;
|
|
75
57
|
var part = 1;
|
|
76
|
-
var chars_used =
|
|
58
|
+
var chars_used = 0;
|
|
77
59
|
var chars_sms = 160;
|
|
78
60
|
var sms_parts_container = [];
|
|
79
61
|
var partc = [];
|
|
@@ -145,15 +127,17 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
145
127
|
}
|
|
146
128
|
}
|
|
147
129
|
|
|
148
|
-
|
|
130
|
+
console.log('Type:', (coding == '7bit' ? '7bit' : 'Unicode'));
|
|
131
|
+
console.log('Parts:', parts);
|
|
132
|
+
console.log('SMS Chars:', chars_sms);
|
|
133
|
+
console.log('SMS Char total:', chars_used);
|
|
134
|
+
|
|
149
135
|
return {
|
|
150
136
|
unicode: (coding === '7bit' ? false : true),
|
|
151
137
|
parts,
|
|
152
138
|
chars_sms,
|
|
153
139
|
chars_used,
|
|
154
140
|
char_list: partc,
|
|
155
|
-
optouturlLength: (optoutUrl && optoutUrl.length) || 0,
|
|
156
|
-
optoutUrlPresent: noOfOptout > 0,
|
|
157
|
-
responseState,
|
|
158
141
|
};
|
|
159
142
|
}
|
|
143
|
+
|
|
@@ -7,7 +7,7 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'app.components.CallTaskPreview.header',
|
|
11
11
|
defaultMessage: 'This is the CallTaskPreview component !',
|
|
12
12
|
},
|
|
13
13
|
});
|
|
@@ -139,7 +139,6 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
139
139
|
supportedTagsString += `${supportedTag} ,`;
|
|
140
140
|
});
|
|
141
141
|
supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
|
|
142
|
-
console.log(supportedTagsString);
|
|
143
142
|
if (_.has(val, 'subtags')) {
|
|
144
143
|
const temp = this.renderTags(val.subtags);
|
|
145
144
|
list.push((
|
|
@@ -160,17 +159,17 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
160
159
|
const options = [
|
|
161
160
|
{
|
|
162
161
|
value: "All",
|
|
163
|
-
label:
|
|
162
|
+
label: "All",
|
|
164
163
|
key: 'all',
|
|
165
164
|
},
|
|
166
165
|
{
|
|
167
166
|
value: "Outbound",
|
|
168
|
-
label:
|
|
167
|
+
label: "Outbound",
|
|
169
168
|
key: 'outbound',
|
|
170
169
|
},
|
|
171
170
|
{
|
|
172
171
|
value: "Loyalty",
|
|
173
|
-
label:
|
|
172
|
+
label: "Loyalty",
|
|
174
173
|
key: 'loyalty',
|
|
175
174
|
},
|
|
176
175
|
];
|
|
@@ -180,8 +179,8 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
180
179
|
visible={this.state.visible}
|
|
181
180
|
onVisibleChange={this.togglePopoverVisibility}
|
|
182
181
|
content={<div>
|
|
183
|
-
<CapSpin tip=
|
|
184
|
-
<Search style={{ marginBottom: 8, width: '250px'}} placeholder=
|
|
182
|
+
<CapSpin tip="Getting tags..." spinning={this.props.loading}>
|
|
183
|
+
<Search style={{ marginBottom: 8, width: '250px'}} placeholder="Search" onChange={this.onChange} />
|
|
185
184
|
{this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue="All" options={options}>
|
|
186
185
|
</CapSelect> : ''}
|
|
187
186
|
<CapTree
|
|
@@ -7,39 +7,19 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
"Ok": {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'app.components.CapTagList.Ok',
|
|
11
11
|
defaultMessage: 'Ok',
|
|
12
12
|
},
|
|
13
13
|
"numberOfDaysBeforeExpiry": {
|
|
14
|
-
id: '
|
|
14
|
+
id: 'app.components.CapTagList.numberOfDaysBeforeExpiry',
|
|
15
15
|
defaultMessage: 'Number of days before expiry',
|
|
16
16
|
},
|
|
17
17
|
"Cancel": {
|
|
18
|
-
id: '
|
|
18
|
+
id: 'app.components.CapTagList.Cancel',
|
|
19
19
|
defaultMessage: 'Cancel',
|
|
20
20
|
},
|
|
21
21
|
"Dynamic Days before Expiry": {
|
|
22
|
-
id: '
|
|
22
|
+
id: 'app.components.CapTagList.dynamic_days_before_expiry',
|
|
23
23
|
defaultMessage: 'Dynamic days before expiry',
|
|
24
24
|
},
|
|
25
|
-
"all": {
|
|
26
|
-
id: 'creatives.componentsV2.CapTagList.all',
|
|
27
|
-
defaultMessage: 'Dynamic days before expiry',
|
|
28
|
-
},
|
|
29
|
-
"outbound": {
|
|
30
|
-
id: 'creatives.componentsV2.CapTagList.outbound',
|
|
31
|
-
defaultMessage: 'Outbound',
|
|
32
|
-
},
|
|
33
|
-
"loyalty": {
|
|
34
|
-
id: 'creatives.componentsV2.CapTagList.loyalty',
|
|
35
|
-
defaultMessage: 'Loyalty',
|
|
36
|
-
},
|
|
37
|
-
"gettingTags": {
|
|
38
|
-
id: 'creatives.componentsV2.CapTagList.gettingTags',
|
|
39
|
-
defaultMessage: 'Getting tags...',
|
|
40
|
-
},
|
|
41
|
-
"search": {
|
|
42
|
-
id: 'creatives.componentsV2.CapTagList.search',
|
|
43
|
-
defaultMessage: 'Search',
|
|
44
|
-
},
|
|
45
25
|
});
|
|
@@ -74,7 +74,6 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
74
74
|
if (this.props.channel && this.props.channel.toLowerCase() === 'wechat') {
|
|
75
75
|
config.startupFocus = false;
|
|
76
76
|
config.toolbar[6].items = ['Table', 'HorizontalRule', 'Smiley'];
|
|
77
|
-
config.width = 'calc(100% - 70px)';
|
|
78
77
|
config.height = 'calc(100vh - 450px)';
|
|
79
78
|
}
|
|
80
79
|
//State initialization
|
|
@@ -7,11 +7,11 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'app.components.CmsTemplatesComponent.header',
|
|
11
11
|
defaultMessage: 'This is the CmsTemplatesComponent component !',
|
|
12
12
|
},
|
|
13
13
|
select: {
|
|
14
|
-
id: '
|
|
14
|
+
id: 'app.components.CmsTemplatesComponent.select',
|
|
15
15
|
defaultMessage: 'Select',
|
|
16
16
|
},
|
|
17
17
|
});
|
|
@@ -9,12 +9,10 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
// import styled from 'styled-components';
|
|
11
11
|
import {CapPopover} from '@capillarytech/cap-ui-library';
|
|
12
|
-
import { FormattedMessage } from 'react-intl';
|
|
12
|
+
// import { FormattedMessage } from 'react-intl';
|
|
13
13
|
// import messages from './messages';
|
|
14
14
|
import _ from "lodash";
|
|
15
15
|
|
|
16
|
-
import messages from './messages';
|
|
17
|
-
|
|
18
16
|
class CustomPopOver extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
19
17
|
componentWillMount() {
|
|
20
18
|
console.log('popOver List ', this.props.popOverList, this.props.excludeList);
|
|
@@ -53,7 +51,7 @@ class CustomPopOver extends React.Component { // eslint-disable-line react/prefe
|
|
|
53
51
|
this.renderPopoverContent()
|
|
54
52
|
}
|
|
55
53
|
>
|
|
56
|
-
<p style={{fontFamily: "open-sans", fontWeight: '600', display: `${this.props.popOverList.length === this.props.excludeList.length ? 'none' : ''}`}}
|
|
54
|
+
<p style={{fontFamily: "open-sans", fontWeight: '600', display: `${this.props.popOverList.length === this.props.excludeList.length ? 'none' : ''}`}}>+ Languages</p>
|
|
57
55
|
</CapPopover>
|
|
58
56
|
</div>
|
|
59
57
|
);
|
|
@@ -7,11 +7,7 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'app.components.CustomPopOver.header',
|
|
11
11
|
defaultMessage: 'This is the CustomPopOver component !',
|
|
12
12
|
},
|
|
13
|
-
languages: {
|
|
14
|
-
id: 'creatives.componentsV2.CustomPopOver.languages',
|
|
15
|
-
defaultMessage: '+ Languages',
|
|
16
|
-
},
|
|
17
13
|
});
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* DateFilter
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
// import styled from 'styled-components';
|
|
11
|
+
|
|
12
|
+
import { FormattedMessage } from 'react-intl';
|
|
13
|
+
import { Popup, Input, Button, Grid, Checkbox, Dimmer, Loader } from 'semantic-ui-react';
|
|
14
|
+
import DateRange from 'components/DateRange';
|
|
15
|
+
import moment from 'moment';
|
|
16
|
+
import _ from 'lodash';
|
|
17
|
+
import messages from './messages';
|
|
18
|
+
|
|
19
|
+
class DateFilter extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
this.state = {
|
|
23
|
+
selectedDateRange: this.props.selectedDateRange,
|
|
24
|
+
showChartCompareOptions: this.props.isCompareSelected,
|
|
25
|
+
compareDateRange: this.props.compareDateRange,
|
|
26
|
+
selectedDateText: '',
|
|
27
|
+
isDateSelectorOpen: false,
|
|
28
|
+
loading: this.props.loading,
|
|
29
|
+
openCustomDatePicker: false,
|
|
30
|
+
compareCustomDateSelected: false,
|
|
31
|
+
customDateSelected: false,
|
|
32
|
+
pastStateData: {},
|
|
33
|
+
componentWidth: 270,
|
|
34
|
+
};
|
|
35
|
+
this.handleToggleDateSelector = this.handleToggleDateSelector.bind(this);
|
|
36
|
+
this.renderDateSelector = this.renderDateSelector.bind(this);
|
|
37
|
+
this.handleDateTypeClick = this.handleDateTypeClick.bind(this);
|
|
38
|
+
this.printSelectedDate = this.printSelectedDate.bind(this);
|
|
39
|
+
this.handleCancel = this.handleCancel.bind(this);
|
|
40
|
+
this.handleChartCompareToggle = this.handleChartCompareToggle.bind(this);
|
|
41
|
+
this.handleCompareDateChange = this.handleCompareDateChange.bind(this);
|
|
42
|
+
this.handleCustomDatePickerCancel = this.handleCustomDatePickerCancel.bind(this);
|
|
43
|
+
this.handleDatePickerApply = this.handleDatePickerApply.bind(this);
|
|
44
|
+
this.compareDateValueSetting = this.compareDateValueSetting.bind(this);
|
|
45
|
+
this.handleApply = this.handleApply.bind(this);
|
|
46
|
+
this.restoreInitialState = this.restoreInitialState.bind(this);
|
|
47
|
+
this.storeInitialState = this.storeInitialState.bind(this);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
componentWillMount() {
|
|
51
|
+
const dateText = this.printSelectedDate(this.state.selectedDateRange.startDate, this.state.selectedDateRange.endDate, this.state.selectedDateRange.dateType);
|
|
52
|
+
this.setState({ selectedDateText: dateText });
|
|
53
|
+
this.setState({ loading: false });
|
|
54
|
+
this.storeInitialState();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
componentDidMount() {
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
componentWillReceiveProps(nextProp) {
|
|
61
|
+
this.setState({ selectedDateRange: nextProp.selectedDateRange, showChartCompareOptions: nextProp.isCompareSelected }, () => {
|
|
62
|
+
let dateText = this.printSelectedDate(this.state.selectedDateRange.startDate, this.state.selectedDateRange.endDate, this.state.selectedDateRange.dateType);
|
|
63
|
+
if (this.state.showChartCompareOptions) {
|
|
64
|
+
this.setState({ componentWidth: 450 });
|
|
65
|
+
dateText = `${dateText} vs ${this.printSelectedDate(this.state.compareDateRange.startDate, this.state.compareDateRange.endDate, this.state.compareDateRange.dateType, true)}`;
|
|
66
|
+
} else {
|
|
67
|
+
this.setState({ componentWidth: 270 });
|
|
68
|
+
}
|
|
69
|
+
this.setState({ selectedDateText: dateText });
|
|
70
|
+
});
|
|
71
|
+
this.storeInitialState();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
storeInitialState() {
|
|
75
|
+
const stateData = _.cloneDeep(this.state);
|
|
76
|
+
const tmpState = {
|
|
77
|
+
selectedDateRange: stateData.selectedDateRange,
|
|
78
|
+
showChartCompareOptions: stateData.showChartCompareOptions,
|
|
79
|
+
compareDateRange: stateData.compareDateRange,
|
|
80
|
+
};
|
|
81
|
+
this.setState({ pastStateData: tmpState });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
handleToggleDateSelector() {
|
|
85
|
+
this.setState({ isDateSelectorOpen: !this.state.isDateSelectorOpen });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
handleDateTypeClick(specifier) {
|
|
89
|
+
const date = this.state.selectedDateRange;
|
|
90
|
+
if (specifier !== 'custom') {
|
|
91
|
+
date.dateType = specifier;
|
|
92
|
+
if (specifier === 'week') {
|
|
93
|
+
date.startDate = moment().isoWeekday(1);
|
|
94
|
+
} else {
|
|
95
|
+
date.startDate = moment().startOf(specifier);
|
|
96
|
+
}
|
|
97
|
+
date.endDate = moment();
|
|
98
|
+
this.setState({ selectedDateRange: date }, () => {
|
|
99
|
+
if (this.state.showChartCompareOptions) {
|
|
100
|
+
this.compareDateValueSetting(specifier);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
this.setState({ customDateSelected: true, openCustomDatePicker: true });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
printSelectedDate(startDate, endDate, specifier, isCompare) {
|
|
109
|
+
let specifierType = '';
|
|
110
|
+
if (isCompare) {
|
|
111
|
+
if (specifier === 'week') {
|
|
112
|
+
specifierType = 'Previous Week';
|
|
113
|
+
} else if (specifier === 'month') {
|
|
114
|
+
specifierType = 'Previous Month';
|
|
115
|
+
} else if (specifier === 'year') {
|
|
116
|
+
specifierType = 'Previous Year';
|
|
117
|
+
} else {
|
|
118
|
+
specifierType = 'Custom';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (!isCompare) {
|
|
122
|
+
if (specifier === 'week') {
|
|
123
|
+
specifierType = 'WTD';
|
|
124
|
+
} else if (specifier === 'month') {
|
|
125
|
+
specifierType = 'MTD';
|
|
126
|
+
} else if (specifier === 'year') {
|
|
127
|
+
specifierType = 'YTD';
|
|
128
|
+
} else {
|
|
129
|
+
specifierType = 'Custom';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let tmpDateString = '';
|
|
134
|
+
if (moment(startDate).year() === moment(endDate).year()) {
|
|
135
|
+
tmpDateString = `${specifierType} ( ${moment(startDate).format('MMM D').toString()} - ${moment(endDate).format('MMM D YYYY').toString()} )`;
|
|
136
|
+
} else {
|
|
137
|
+
tmpDateString = `${specifierType} ( ${moment(startDate).format('MMM D YYYY').toString()} - ${moment(endDate).format('MMM D YYYY').toString()} )`;
|
|
138
|
+
}
|
|
139
|
+
return tmpDateString;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
handleCancel() {
|
|
143
|
+
this.setState({ isDateSelectorOpen: false });
|
|
144
|
+
if (this.props.handleCancel !== undefined) {
|
|
145
|
+
this.props.handleCancel();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Need to improve this function
|
|
149
|
+
this.restoreInitialState();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
compareDateValueSetting(specifier) {
|
|
153
|
+
const dateRange = (this.state.compareDateRange) ? this.state.compareDateRange : _.cloneDeep(this.state.selectedDateRange);
|
|
154
|
+
if (specifier === 'week') {
|
|
155
|
+
dateRange.startDate = moment(this.state.selectedDateRange.startDate).subtract(7, 'days');
|
|
156
|
+
dateRange.endDate = moment(this.state.selectedDateRange.endDate).subtract(7, 'days');
|
|
157
|
+
dateRange.dateType = specifier;
|
|
158
|
+
} else if (specifier === 'month') {
|
|
159
|
+
dateRange.startDate = moment(this.state.selectedDateRange.startDate).subtract(1, 'months');
|
|
160
|
+
dateRange.endDate = moment(this.state.selectedDateRange.endDate).subtract(1, 'months');
|
|
161
|
+
dateRange.dateType = specifier;
|
|
162
|
+
} else if (specifier === 'year' || specifier === 'custom') {
|
|
163
|
+
dateRange.startDate = moment(this.state.selectedDateRange.startDate).subtract(1, 'years');
|
|
164
|
+
dateRange.endDate = moment(this.state.selectedDateRange.endDate).subtract(1, 'years');
|
|
165
|
+
dateRange.dateType = specifier;
|
|
166
|
+
}
|
|
167
|
+
this.setState({ compareDateRange: dateRange });
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
handleChartCompareToggle() {
|
|
171
|
+
this.setState({ showChartCompareOptions: !this.state.showChartCompareOptions });
|
|
172
|
+
const compareDateType = (this.state.compareDateRange) ? this.state.compareDateRange.dateType : this.state.selectedDateRange.dateType;
|
|
173
|
+
this.compareDateValueSetting(compareDateType);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
handleCompareDateChange(specifier) {
|
|
177
|
+
if (specifier === 'custom') {
|
|
178
|
+
this.setState({ compareCustomDateSelected: true, openCustomDatePicker: true });
|
|
179
|
+
} else {
|
|
180
|
+
this.compareDateValueSetting(specifier);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
handleCustomDatePickerCancel(e) {
|
|
185
|
+
if (e) {
|
|
186
|
+
e.preventDefault();
|
|
187
|
+
}
|
|
188
|
+
this.setState({ customDateSelected: false });
|
|
189
|
+
this.setState({ compareCustomDateSelected: false });
|
|
190
|
+
this.setState({ openCustomDatePicker: false });
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
handleDatePickerApply(startDate, endDate, dateType) {
|
|
194
|
+
if (this.state.customDateSelected) {
|
|
195
|
+
const dateRange = _.cloneDeep(this.state.selectedDateRange);
|
|
196
|
+
dateRange.startDate = startDate;
|
|
197
|
+
dateRange.endDate = endDate;
|
|
198
|
+
dateRange.dateType = dateType;
|
|
199
|
+
this.setState({ selectedDateRange: dateRange });
|
|
200
|
+
this.setState({ customDateSelected: false });
|
|
201
|
+
} else {
|
|
202
|
+
const dateRange = _.cloneDeep(this.state.compareDateRange);
|
|
203
|
+
dateRange.startDate = startDate;
|
|
204
|
+
dateRange.endDate = endDate;
|
|
205
|
+
dateRange.dateType = dateType;
|
|
206
|
+
this.setState({ compareDateRange: dateRange });
|
|
207
|
+
this.setState({ compareCustomDateSelected: false });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
handleApply() {
|
|
212
|
+
let dateText = this.printSelectedDate(this.state.selectedDateRange.startDate, this.state.selectedDateRange.endDate, this.state.selectedDateRange.dateType);
|
|
213
|
+
if (this.state.showChartCompareOptions) {
|
|
214
|
+
this.setState({ componentWidth: 450 });
|
|
215
|
+
dateText = `${dateText} vs ${this.printSelectedDate(this.state.compareDateRange.startDate, this.state.compareDateRange.endDate, this.state.compareDateRange.dateType, true)}`;
|
|
216
|
+
} else {
|
|
217
|
+
this.setState({ componentWidth: 270 });
|
|
218
|
+
}
|
|
219
|
+
this.setState({ selectedDateText: dateText });
|
|
220
|
+
this.setState({ isDateSelectorOpen: false });
|
|
221
|
+
this.props.handleApply(this.state.selectedDateRange, this.state.showChartCompareOptions, this.state.compareDateRange);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
restoreInitialState() {
|
|
225
|
+
this.setState({ selectedDateRange: this.state.pastStateData.selectedDateRange });
|
|
226
|
+
this.setState({ compareDateRange: this.state.pastStateData.compareDateRange, showChartCompareOptions: this.state.pastStateData.showChartCompareOptions });
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
renderDateSelector() {
|
|
230
|
+
const dateType = this.state.selectedDateRange.dateType;
|
|
231
|
+
return (
|
|
232
|
+
<div className="date-filter-wrapper">
|
|
233
|
+
{ this.state.loading ? <Dimmer active inverted className={'hide'}><Loader inverted><FormattedMessage {...messages.loaderMessage} /> </Loader></Dimmer> :
|
|
234
|
+
<Grid>
|
|
235
|
+
<Grid.Row className={this.state.openCustomDatePicker ? 'hide' : ''}>
|
|
236
|
+
<Grid.Column width={16}>
|
|
237
|
+
<Button.Group fluid className="btn-group till-date">
|
|
238
|
+
<Button className={dateType === 'week' ? 'active' : ''} onClick={() => this.handleDateTypeClick('week')}>WTD</Button>
|
|
239
|
+
<Button className={dateType === 'month' ? 'active' : ''} onClick={() => this.handleDateTypeClick('month')}>MTD</Button>
|
|
240
|
+
<Button className={dateType === 'year' ? 'active' : ''} onClick={() => this.handleDateTypeClick('year')}>YTD</Button>
|
|
241
|
+
<Button className={dateType === 'custom' ? 'active' : ''} onClick={() => this.handleDateTypeClick('custom')}>Custom</Button>
|
|
242
|
+
</Button.Group>
|
|
243
|
+
</Grid.Column>
|
|
244
|
+
<Grid.Column width={16} className="selectedDateText">
|
|
245
|
+
{this.printSelectedDate(this.state.selectedDateRange.startDate, this.state.selectedDateRange.endDate, this.state.selectedDateRange.dateType)}
|
|
246
|
+
{dateType === 'custom' ? <span className="editSelectedDate" onClick={() => this.handleDateTypeClick('custom')}><FormattedMessage {...messages.editText} /></span> : ''}
|
|
247
|
+
</Grid.Column>
|
|
248
|
+
</Grid.Row>
|
|
249
|
+
<Grid.Row className={this.state.openCustomDatePicker ? 'hide' : 'compareDateToggle'}>
|
|
250
|
+
<Grid.Column width={16}>
|
|
251
|
+
<Checkbox className={!this.props.compareMode ? 'hide' : 'dateCompareCheckbox'} checked={this.state.showChartCompareOptions} label="Compare" onClick={this.handleChartCompareToggle} />
|
|
252
|
+
</Grid.Column>
|
|
253
|
+
</Grid.Row>
|
|
254
|
+
{ this.state.showChartCompareOptions ?
|
|
255
|
+
<Grid.Row className={!this.state.openCustomDatePicker ? '' : 'hide'}>
|
|
256
|
+
<Grid.Column width={16}>
|
|
257
|
+
<Button.Group fluid className="btn-group till-date">
|
|
258
|
+
{dateType !== 'week' ? '' :
|
|
259
|
+
<Button className={this.state.compareDateRange.dateType !== 'week' ? '' : 'active'} onClick={() => this.handleCompareDateChange('week')}>Previous Week</Button> }
|
|
260
|
+
{dateType !== 'month' ? '' :
|
|
261
|
+
<Button className={this.state.compareDateRange.dateType !== 'month' ? '' : 'active'} onClick={() => this.handleCompareDateChange('month')}>Previous Month</Button>}
|
|
262
|
+
<Button className={this.state.compareDateRange.dateType === 'year' ? 'active' : ''} onClick={() => this.handleCompareDateChange('year')}>Previous Year</Button>
|
|
263
|
+
<Button className={this.state.compareDateRange.dateType === 'custom' ? 'active' : ''} onClick={() => this.handleCompareDateChange('custom')}>Custom</Button>
|
|
264
|
+
</Button.Group>
|
|
265
|
+
</Grid.Column>
|
|
266
|
+
<Grid.Column width={16} className="selectedDateText">
|
|
267
|
+
{this.printSelectedDate(this.state.compareDateRange.startDate, this.state.compareDateRange.endDate, this.state.compareDateRange.dateType, true)}
|
|
268
|
+
{this.state.compareDateRange.dateType === 'custom' ? <span className="editSelectedDate" onClick={() => this.handleCompareDateChange('custom')}><FormattedMessage {...messages.editText} /></span> : ''}
|
|
269
|
+
</Grid.Column>
|
|
270
|
+
</Grid.Row>
|
|
271
|
+
: ''
|
|
272
|
+
}
|
|
273
|
+
<Grid.Row className={this.state.openCustomDatePicker ? 'hide' : ''}>
|
|
274
|
+
<Grid.Column width={16}>
|
|
275
|
+
<Button primary onClick={this.handleApply}>Apply</Button>
|
|
276
|
+
<Button basic onClick={this.handleCancel}>Cancel</Button>
|
|
277
|
+
</Grid.Column>
|
|
278
|
+
</Grid.Row>
|
|
279
|
+
|
|
280
|
+
{ this.state.customDateSelected ?
|
|
281
|
+
<Grid.Row className={!this.state.openCustomDatePicker ? 'hide' : ''}>
|
|
282
|
+
<Grid.Column className="selectDateRangeTitle" width={16}>
|
|
283
|
+
<a href="" className="backButton" onClick={this.handleCustomDatePickerCancel}><i className="material-icons">keyboard_backspace</i></a>
|
|
284
|
+
<span className="dateRangeTitle">Select Date Range</span>
|
|
285
|
+
</Grid.Column>
|
|
286
|
+
<Grid.Column width={16} className="dateRangeWrapper">
|
|
287
|
+
<DateRange prevSelectedDate={this.state.selectedDateRange} handleDatePickerApply={this.handleDatePickerApply} handleDatePickerCancel={this.handleCustomDatePickerCancel} />
|
|
288
|
+
</Grid.Column>
|
|
289
|
+
{/* { this.state.showChartCompareOptions ? <Grid.Column width={16}>
|
|
290
|
+
{this.printSelectedDate(this.props.selectedDateRange.startDate, this.props.selectedDateRange.endDate, this.state.selectedDateRange.dateType)} vs
|
|
291
|
+
</Grid.Column> : '' } */}
|
|
292
|
+
</Grid.Row> : ''
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
{ this.state.compareCustomDateSelected ?
|
|
296
|
+
<Grid.Row className={!this.state.openCustomDatePicker ? 'hide' : ''}>
|
|
297
|
+
<Grid.Column width={16}>
|
|
298
|
+
<a href="" className="backButton" onClick={this.handleCustomDatePickerCancel}><i className="material-icons">keyboard_backspace</i></a>
|
|
299
|
+
<span className="dateRangeTitle">Select Date Range</span>
|
|
300
|
+
</Grid.Column>
|
|
301
|
+
<Grid.Column width={16}>
|
|
302
|
+
{this.printSelectedDate(this.state.selectedDateRange.startDate, this.state.selectedDateRange.endDate, this.state.selectedDateRange.dateType)} vs
|
|
303
|
+
</Grid.Column>
|
|
304
|
+
<Grid.Column width={16} className="dateRangeWrapper">
|
|
305
|
+
<DateRange prevSelectedDate={this.state.compareDateRange} handleDatePickerApply={this.handleDatePickerApply} handleDatePickerCancel={this.handleCustomDatePickerCancel} />
|
|
306
|
+
</Grid.Column>
|
|
307
|
+
</Grid.Row> : ''
|
|
308
|
+
}
|
|
309
|
+
</Grid>}
|
|
310
|
+
</div>
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
render() {
|
|
315
|
+
const { isDateSelectorOpen } = this.state;
|
|
316
|
+
// const loading = this.state.loading;
|
|
317
|
+
return (
|
|
318
|
+
<span>
|
|
319
|
+
<Popup
|
|
320
|
+
trigger={
|
|
321
|
+
<Input
|
|
322
|
+
id="compareDate"
|
|
323
|
+
style={{ width: `${this.state.componentWidth}px` }}
|
|
324
|
+
readOnly
|
|
325
|
+
icon="caret down"
|
|
326
|
+
value={this.state.selectedDateText}
|
|
327
|
+
/>
|
|
328
|
+
}
|
|
329
|
+
content={this.renderDateSelector()}
|
|
330
|
+
on="click"
|
|
331
|
+
open={isDateSelectorOpen}
|
|
332
|
+
onOpen={this.handleToggleDateSelector}
|
|
333
|
+
/>
|
|
334
|
+
</span>
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
DateFilter.propTypes = {
|
|
340
|
+
selectedDateRange: PropTypes.object.isRequired,
|
|
341
|
+
compareMode: PropTypes.bool,
|
|
342
|
+
compareDateRange: PropTypes.object,
|
|
343
|
+
isCompareSelected: PropTypes.bool,
|
|
344
|
+
handleApply: PropTypes.func.isRequired,
|
|
345
|
+
handleCancel: PropTypes.func,
|
|
346
|
+
loading: PropTypes.bool,
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export default DateFilter;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* DateFilter Messages
|
|
3
|
+
*
|
|
4
|
+
* This contains all the text for the DateFilter component.
|
|
5
|
+
*/
|
|
6
|
+
import { defineMessages } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
export default defineMessages({
|
|
9
|
+
loaderMessage: {
|
|
10
|
+
id: 'reon.components.DateFilter.loaderMessage',
|
|
11
|
+
defaultMessage: 'Fetching Data',
|
|
12
|
+
},
|
|
13
|
+
editText: {
|
|
14
|
+
id: 'reon.components.DateFilter.editText',
|
|
15
|
+
defaultMessage: 'Edit',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { shallow } from 'enzyme';
|
|
3
|
+
//
|
|
4
|
+
// import moment from 'moment';
|
|
5
|
+
// import DateFilter from '../index';
|
|
6
|
+
|
|
7
|
+
// describe('<DateFilter />', () => {
|
|
8
|
+
// it('Expect to have unit tests specified', () => {
|
|
9
|
+
// expect(true).toEqual(false);
|
|
10
|
+
// });
|
|
11
|
+
// it('Expect to have selectDateRange Prop', () => {
|
|
12
|
+
// const wrapper = shallow(<DateFilter selectedDateRange={moment()} />);
|
|
13
|
+
// expect(wrapper.props().selectedDateRange).toEqual(moment());
|
|
14
|
+
// });
|
|
15
|
+
// });
|