@capillarytech/creatives-library 8.0.136 → 8.0.137-alpha.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/constants/unified.js +189 -0
- package/package.json +1 -1
- package/services/getSchema.js +1 -1
- package/services/localStorageApi.js +1 -0
- package/tests/i18n.test.js +1 -1
- package/utils/common.js +2 -2
- package/utils/tagValidations.js +1 -1
- package/utils/tests/checkStore.test.js +1 -1
- package/utils/tests/customAuth.test.js +1 -1
- package/utils/transformerUtils.js +1 -1
- package/v2Components/CapTagList/index.js +9 -14
- package/v2Components/Carousel/style.scss +1 -1
- package/v2Components/EmailMobilePreview/index.js +2 -2
- package/v2Components/FormBuilder/index.js +2 -2
- package/v2Components/TemplatePreview/index.js +2 -1
- package/v2Containers/Cap/tests/saga.test.js +1 -1
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/FTP/index.js +1 -1
- package/v2Containers/Line/Container/Text/index.js +1 -1
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +0 -1
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +271 -0
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +189 -0
- package/v2Containers/MobilePushNew/index.scss +0 -7
- package/v2Containers/Sms/Create/index.js +2 -2
- package/v2Containers/Sms/Edit/index.js +1 -1
- package/v2Containers/TagList/index.js +1 -1
- package/v2Containers/TagList/utils.js +1 -1
- package/v2Containers/Templates/index.js +1 -1
- package/v2Containers/Templates/sagas.js +1 -1
- package/components/BreadCrumbs/index.js +0 -65
- package/components/BreadCrumbs/messages.js +0 -13
- package/components/CapTagList/index.js +0 -235
- package/components/CapTagList/messages.js +0 -45
- package/components/Card/_customCard.scss +0 -40
- package/components/Card/index.js +0 -78
- package/components/Card/tests/__snapshots__/index.test.js.snap +0 -22
- package/components/Card/tests/index.test.js +0 -20
- package/components/CardGrid/index.js +0 -71
- package/components/Ckeditor/index.js +0 -238
- package/components/Ckeditor/messages.js +0 -13
- package/components/Ckeditor/style.scss +0 -3
- package/components/Component/index.js +0 -29
- package/components/CustomPopOver/index.js +0 -81
- package/components/CustomPopOver/messages.js +0 -17
- package/components/DateFilter/index.js +0 -349
- package/components/DateFilter/messages.js +0 -57
- package/components/DateRange/index.js +0 -114
- package/components/DateRange/messages.js +0 -25
- package/components/Edmeditor/index.js +0 -65
- package/components/Edmeditor/messages.js +0 -13
- package/components/EmailPreview/_emailPreview.scss +0 -119
- package/components/EmailPreview/assets/images/iPad.svg +0 -10
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/EmailPreview/index.js +0 -107
- package/components/EmailPreview/messages.js +0 -33
- package/components/Footer/index.js +0 -27
- package/components/Footer/messages.js +0 -13
- package/components/FormBuilder/_formBuilder.scss +0 -83
- package/components/FormBuilder/index.js +0 -3279
- package/components/FormBuilder/messages.js +0 -61
- package/components/Header/index.js +0 -44
- package/components/Header/messages.js +0 -29
- package/components/ImagePreview/_imagePreview.scss +0 -63
- package/components/ImagePreview/index.js +0 -52
- package/components/ImagePreview/messages.js +0 -17
- package/components/PageHeader/_pageHeader.scss +0 -22
- package/components/PageHeader/index.js +0 -37
- package/components/PageHeader/messages.js +0 -13
- package/components/Pagination/_pagination.scss +0 -5
- package/components/Pagination/index.js +0 -49
- package/components/PreviewSideBar/_previewsidebar.scss +0 -28
- package/components/PreviewSideBar/index.js +0 -152
- package/components/PreviewSideBar/messages.js +0 -41
- package/components/Sidebar/_sidebar.scss +0 -115
- package/components/Sidebar/index.js +0 -214
- package/components/Sidebar/messages.js +0 -21
- package/components/SlideBox/_slideBox.scss +0 -63
- package/components/SlideBox/index.js +0 -47
- package/components/SlideBox/tests/index.test.js +0 -103
- package/components/SmsEditor/index.js +0 -55
- package/components/SmsTest/index.js +0 -117
- package/components/SmsTest/messages.js +0 -21
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +0 -42
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +0 -141
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +0 -21
- package/components/TemplatePreview/_templatePreview.scss +0 -642
- package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
- package/components/TemplatePreview/assets/images/androidPushMessage.svg +0 -45
- package/components/TemplatePreview/assets/images/home-screen-android.svg +0 -21
- package/components/TemplatePreview/assets/images/home-screen-ios.svg +0 -16
- package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +0 -135
- package/components/TemplatePreview/assets/images/mobile.svg +0 -24
- package/components/TemplatePreview/assets/images/sms-body.png +0 -0
- package/components/TemplatePreview/assets/images/sms-icon.png +0 -0
- package/components/TemplatePreview/assets/images/sms_mobile.png +0 -0
- package/components/TemplatePreview/assets/images/sms_mobile_android.svg +0 -22
- package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +0 -16
- package/components/TemplatePreview/assets/images/user-icon.svg +0 -19
- package/components/TemplatePreview/assets/images/wechat-mobile.svg +0 -78
- package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +0 -20
- package/components/TemplatePreview/index.js +0 -617
- package/components/TemplatePreview/messages.js +0 -78
- package/components/Toastr/index.js +0 -60
- package/components/Toastr/messages.js +0 -13
- package/components/ToastrMessage/index.js +0 -113
- package/components/ToastrMessage/messages.js +0 -17
- package/components/TopBar/_topbar.scss +0 -46
- package/components/TopBar/assets/images/capillary_logo.png +0 -0
- package/components/TopBar/assets/images/old_capillary_logo.png +0 -0
- package/components/TopBar/index.js +0 -113
- package/components/TopBar/messages.js +0 -29
- package/containers/App/actions.js +0 -7
- package/containers/App/constants.js +0 -114
- package/containers/App/index.js +0 -52
- package/containers/App/reducer.js +0 -19
- package/containers/App/sagas.js +0 -31
- package/containers/App/selectors.js +0 -25
- package/containers/App/test/saga.test.js +0 -11
- package/containers/Assets/Gallery/_gallery.scss +0 -126
- package/containers/Assets/Gallery/actions.js +0 -37
- package/containers/Assets/Gallery/constants.js +0 -23
- package/containers/Assets/Gallery/index.js +0 -473
- package/containers/Assets/Gallery/messages.js +0 -93
- package/containers/Assets/Gallery/reducer.js +0 -81
- package/containers/Assets/Gallery/sagas.js +0 -80
- package/containers/Assets/Gallery/selectors.js +0 -25
- package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +0 -9
- package/containers/Assets/Gallery/tests/actions.test.js +0 -25
- package/containers/Assets/Gallery/tests/reducer.test.js +0 -96
- package/containers/Assets/Gallery/tests/saga.test.js +0 -157
- package/containers/Cap/actions.js +0 -66
- package/containers/Cap/constants.js +0 -25
- package/containers/Cap/index.js +0 -402
- package/containers/Cap/messages.js +0 -75
- package/containers/Cap/reducer.js +0 -113
- package/containers/Cap/sagas.js +0 -159
- package/containers/Cap/selectors.js +0 -75
- package/containers/Cap/tests/__snapshots__/index.test.js.snap +0 -2269
- package/containers/Cap/tests/index.test.js +0 -22
- package/containers/Cap/tests/saga.test.js +0 -284
- package/containers/Dashboard/actions.js +0 -15
- package/containers/Dashboard/constants.js +0 -7
- package/containers/Dashboard/index.js +0 -76
- package/containers/Dashboard/messages.js +0 -13
- package/containers/Dashboard/reducer.js +0 -21
- package/containers/Dashboard/sagas.js +0 -17
- package/containers/Dashboard/selectors.js +0 -25
- package/containers/Dashboard/test/saga.test.js +0 -9
- package/containers/Ebill/_ebill.scss +0 -5
- package/containers/Ebill/actions.js +0 -43
- package/containers/Ebill/constants.js +0 -20
- package/containers/Ebill/index.js +0 -1278
- package/containers/Ebill/messages.js +0 -77
- package/containers/Ebill/reducer.js +0 -72
- package/containers/Ebill/sagas.js +0 -74
- package/containers/Ebill/selectors.js +0 -25
- package/containers/Ebill/test/saga.test.js +0 -11
- package/containers/Email/_email.scss +0 -141
- package/containers/Email/actions.js +0 -81
- package/containers/Email/constants.js +0 -36
- package/containers/Email/index.js +0 -3325
- package/containers/Email/messages.js +0 -289
- package/containers/Email/reducer.js +0 -142
- package/containers/Email/sagas.js +0 -135
- package/containers/Email/selectors.js +0 -31
- package/containers/Email/test/saga.test.js +0 -671
- package/containers/LanguageProvider/actions.js +0 -17
- package/containers/LanguageProvider/constants.js +0 -8
- package/containers/LanguageProvider/index.js +0 -80
- package/containers/LanguageProvider/reducer.js +0 -30
- package/containers/LanguageProvider/selectors.js +0 -20
- package/containers/LanguageProvider/tests/actions.test.js +0 -19
- package/containers/LanguageProvider/tests/index.test.js +0 -78
- package/containers/LanguageProvider/tests/reducer.test.js +0 -20
- package/containers/LanguageProvider/tests/selectors.test.js +0 -15
- package/containers/Line/Create/_lineCreate.scss +0 -54
- package/containers/Line/Create/actions.js +0 -90
- package/containers/Line/Create/constants.js +0 -39
- package/containers/Line/Create/index.js +0 -836
- package/containers/Line/Create/messages.js +0 -189
- package/containers/Line/Create/reducer.js +0 -99
- package/containers/Line/Create/sagas.js +0 -121
- package/containers/Line/Create/selectors.js +0 -36
- package/containers/Line/Create/tests/saga.test.js +0 -202
- package/containers/Line/Edit/_lineEdit.scss +0 -35
- package/containers/Line/Edit/actions.js +0 -79
- package/containers/Line/Edit/constants.js +0 -27
- package/containers/Line/Edit/index.js +0 -1050
- package/containers/Line/Edit/messages.js +0 -177
- package/containers/Line/Edit/reducer.js +0 -83
- package/containers/Line/Edit/sagas.js +0 -80
- package/containers/Line/Edit/selectors.js +0 -29
- package/containers/Line/Edit/test/saga.test.js +0 -160
- package/containers/Login/assets/images/capillary_logo.png +0 -0
- package/containers/Login/components/LoginForm/index.js +0 -62
- package/containers/Login/components/LoginForm/messages.js +0 -33
- package/containers/Login/index.js +0 -130
- package/containers/Login/messages.js +0 -25
- package/containers/Login/selectors.js +0 -25
- package/containers/MobilePush/Create/_mobilePushCreate.scss +0 -39
- package/containers/MobilePush/Create/actions.js +0 -46
- package/containers/MobilePush/Create/constants.js +0 -23
- package/containers/MobilePush/Create/index.js +0 -2303
- package/containers/MobilePush/Create/messages.js +0 -269
- package/containers/MobilePush/Create/reducer.js +0 -70
- package/containers/MobilePush/Create/sagas.js +0 -74
- package/containers/MobilePush/Create/selectors.js +0 -28
- package/containers/MobilePush/Create/test/saga.test.js +0 -19
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +0 -39
- package/containers/MobilePush/Edit/actions.js +0 -91
- package/containers/MobilePush/Edit/constants.js +0 -35
- package/containers/MobilePush/Edit/index.js +0 -2601
- package/containers/MobilePush/Edit/messages.js +0 -266
- package/containers/MobilePush/Edit/reducer.js +0 -112
- package/containers/MobilePush/Edit/sagas.js +0 -126
- package/containers/MobilePush/Edit/selectors.js +0 -29
- package/containers/MobilePush/Edit/tests/saga.test.js +0 -255
- package/containers/NotFoundPage/index.js +0 -25
- package/containers/NotFoundPage/messages.js +0 -13
- package/containers/NotFoundPage/tests/index.test.js +0 -17
- package/containers/Sms/Create/_smsCreate.scss +0 -42
- package/containers/Sms/Create/actions.js +0 -27
- package/containers/Sms/Create/constants.js +0 -16
- package/containers/Sms/Create/index.js +0 -1488
- package/containers/Sms/Create/messages.js +0 -109
- package/containers/Sms/Create/reducer.js +0 -41
- package/containers/Sms/Create/sagas.js +0 -40
- package/containers/Sms/Create/selectors.js +0 -28
- package/containers/Sms/Create/test/saga.test.js +0 -11
- package/containers/Sms/Edit/actions.js +0 -40
- package/containers/Sms/Edit/constants.js +0 -17
- package/containers/Sms/Edit/index.js +0 -1472
- package/containers/Sms/Edit/messages.js +0 -105
- package/containers/Sms/Edit/reducer.js +0 -50
- package/containers/Sms/Edit/sagas.js +0 -60
- package/containers/Sms/Edit/selectors.js +0 -32
- package/containers/Sms/Edit/test/saga.test.js +0 -13
- package/containers/TagList/_tagList.scss +0 -8
- package/containers/TagList/actions.js +0 -15
- package/containers/TagList/constants.js +0 -32
- package/containers/TagList/index.js +0 -236
- package/containers/TagList/messages.js +0 -13
- package/containers/TagList/reducer.js +0 -23
- package/containers/TagList/sagas.js +0 -11
- package/containers/TagList/selectors.js +0 -25
- package/containers/Templates/_templates.scss +0 -333
- package/containers/Templates/actions.js +0 -103
- package/containers/Templates/constants.js +0 -60
- package/containers/Templates/index.js +0 -1756
- package/containers/Templates/messages.js +0 -337
- package/containers/Templates/reducer.js +0 -142
- package/containers/Templates/sagas.js +0 -163
- package/containers/Templates/selectors.js +0 -28
- package/containers/Templates/test/saga.test.js +0 -241
- package/containers/WeChat/MapTemplates/_mapTemplates.scss +0 -8
- package/containers/WeChat/MapTemplates/actions.js +0 -52
- package/containers/WeChat/MapTemplates/constants.js +0 -28
- package/containers/WeChat/MapTemplates/index.js +0 -1610
- package/containers/WeChat/MapTemplates/messages.js +0 -157
- package/containers/WeChat/MapTemplates/reducer.js +0 -74
- package/containers/WeChat/MapTemplates/sagas.js +0 -84
- package/containers/WeChat/MapTemplates/selectors.js +0 -25
- package/containers/WeChat/MapTemplates/test/saga.test.js +0 -155
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +0 -57
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +0 -36
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +0 -15
- package/containers/WeChat/RichmediaTemplates/Create/index.js +0 -1071
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +0 -165
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +0 -60
- package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +0 -497
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +0 -51
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +0 -37
- package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +0 -13
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +0 -20
- package/containers/WeChat/RichmediaTemplates/Edit/constants.js +0 -10
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +0 -136
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +0 -13
- package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +0 -28
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +0 -36
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +0 -30
- package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +0 -12
- package/containers/WeChat/RichmediaTemplates/View/actions.js +0 -15
- package/containers/WeChat/RichmediaTemplates/View/constants.js +0 -7
- package/containers/WeChat/RichmediaTemplates/View/index.js +0 -47
- package/containers/WeChat/RichmediaTemplates/View/messages.js +0 -21
- package/containers/WeChat/RichmediaTemplates/View/reducer.js +0 -23
- package/containers/WeChat/RichmediaTemplates/View/sagas.js +0 -11
- package/containers/WeChat/RichmediaTemplates/View/selectors.js +0 -25
- package/utils/asyncInjectors.js +0 -78
- package/utils/callNativeEvent.js +0 -16
- package/utils/checkStore.js +0 -21
- package/utils/customAuthWrapper.js +0 -62
- package/utils/customConnectedAuthWrapper.js +0 -26
- package/utils/jed.js +0 -1497
- package/utils/smsCharCount.js +0 -351
|
@@ -1,349 +0,0 @@
|
|
|
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')}><FormattedMessage {...messages.wtd} /></Button>
|
|
239
|
-
<Button className={dateType === 'month' ? 'active' : ''} onClick={() => this.handleDateTypeClick('month')}><FormattedMessage {...messages.mtd} /></Button>
|
|
240
|
-
<Button className={dateType === 'year' ? 'active' : ''} onClick={() => this.handleDateTypeClick('year')}><FormattedMessage {...messages.ytd} /></Button>
|
|
241
|
-
<Button className={dateType === 'custom' ? 'active' : ''} onClick={() => this.handleDateTypeClick('custom')}><FormattedMessage {...messages.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')}><FormattedMessage {...messages.previousWeek} /></Button> }
|
|
260
|
-
{dateType !== 'month' ? '' :
|
|
261
|
-
<Button className={this.state.compareDateRange.dateType !== 'month' ? '' : 'active'} onClick={() => this.handleCompareDateChange('month')}><FormattedMessage {...messages.previousMonth} /></Button>}
|
|
262
|
-
<Button className={this.state.compareDateRange.dateType === 'year' ? 'active' : ''} onClick={() => this.handleCompareDateChange('year')}><FormattedMessage {...messages.previousYear} /></Button>
|
|
263
|
-
<Button className={this.state.compareDateRange.dateType === 'custom' ? 'active' : ''} onClick={() => this.handleCompareDateChange('custom')}><FormattedMessage {...messages.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}><FormattedMessage {...messages.apply} /></Button>
|
|
276
|
-
<Button basic onClick={this.handleCancel}><FormattedMessage {...messages.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"><FormattedMessage {...messages.selectDateRange} /></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"><FormattedMessage {...messages.selectDateRange} /></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;
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
wtd: {
|
|
18
|
-
id: 'reon.components.DateFilter.wtd',
|
|
19
|
-
defaultMessage: 'WTD',
|
|
20
|
-
},
|
|
21
|
-
mtd: {
|
|
22
|
-
id: 'reon.components.DateFilter.mtd',
|
|
23
|
-
defaultMessage: 'MTD',
|
|
24
|
-
},
|
|
25
|
-
ytd: {
|
|
26
|
-
id: 'reon.components.DateFilter.ytd',
|
|
27
|
-
defaultMessage: 'YTD',
|
|
28
|
-
},
|
|
29
|
-
custom: {
|
|
30
|
-
id: 'reon.components.DateFilter.custom',
|
|
31
|
-
defaultMessage: 'Custom',
|
|
32
|
-
},
|
|
33
|
-
previousWeek: {
|
|
34
|
-
id: 'reon.components.DateFilter.previousWeek',
|
|
35
|
-
defaultMessage: 'Previous Week',
|
|
36
|
-
},
|
|
37
|
-
previousMonth: {
|
|
38
|
-
id: 'reon.components.DateFilter.previousMonth',
|
|
39
|
-
defaultMessage: 'Previous Month',
|
|
40
|
-
},
|
|
41
|
-
previousYear: {
|
|
42
|
-
id: 'reon.components.DateFilter.previousYear',
|
|
43
|
-
defaultMessage: 'Previous Year',
|
|
44
|
-
},
|
|
45
|
-
selectDateRange: {
|
|
46
|
-
id: 'reon.components.DateFilter.selectDateRange',
|
|
47
|
-
defaultMessage: 'Select Date Range',
|
|
48
|
-
},
|
|
49
|
-
apply: {
|
|
50
|
-
id: 'reon.components.DateFilter.apply',
|
|
51
|
-
defaultMessage: 'Apply',
|
|
52
|
-
},
|
|
53
|
-
cancel: {
|
|
54
|
-
id: 'reon.components.DateFilter.cancel',
|
|
55
|
-
defaultMessage: 'Cancel',
|
|
56
|
-
},
|
|
57
|
-
});
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* DateRange
|
|
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 { Grid, Button } from 'semantic-ui-react';
|
|
14
|
-
|
|
15
|
-
import DatePicker from 'react-datepicker';
|
|
16
|
-
import 'react-datepicker/dist/react-datepicker.css';
|
|
17
|
-
|
|
18
|
-
import moment from 'moment';
|
|
19
|
-
import messages from './messages';
|
|
20
|
-
|
|
21
|
-
class DateRange extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
22
|
-
constructor(props) {
|
|
23
|
-
super(props);
|
|
24
|
-
this.state = {
|
|
25
|
-
startDate: this.props.prevSelectedDate.startDate,
|
|
26
|
-
endDate: this.props.prevSelectedDate.endDate,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
this.handleChangeStart = this.handleChangeStart.bind(this);
|
|
30
|
-
this.handleChangeEnd = this.handleChangeEnd.bind(this);
|
|
31
|
-
this.closeAndUpdate = this.closeAndUpdate.bind(this);
|
|
32
|
-
this.closeAndCancel = this.closeAndCancel.bind(this);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
handleChangeStart(date) {
|
|
36
|
-
this.setState({ startDate: date });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
handleChangeEnd(date) {
|
|
40
|
-
this.setState({ endDate: date });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
closeAndUpdate() {
|
|
44
|
-
this.props.handleDatePickerApply(this.state.startDate, this.state.endDate, 'custom');
|
|
45
|
-
this.props.handleDatePickerCancel();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
closeAndCancel() {
|
|
49
|
-
this.props.handleDatePickerCancel();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
render() {
|
|
53
|
-
const { startDate, endDate } = this.state;
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<Grid className="dateRangeWrapper" columns={2}>
|
|
57
|
-
<Grid.Row className="selectedDateTitleWrapper">
|
|
58
|
-
<Grid.Column style={{ paddingLeft: 0, paddingBottom: `${8}px` }}>
|
|
59
|
-
<span className="selectedDateTitle"><FormattedMessage {...messages.from} /></span>
|
|
60
|
-
<input className="selectedDateRange" type="text" readOnly defaultValue={moment(startDate).format('MM/DD/YYYY').toString()} />
|
|
61
|
-
<i className="calenderIcon material-icons"><FormattedMessage {...messages.today} /></i>
|
|
62
|
-
</Grid.Column>
|
|
63
|
-
<Grid.Column style={{ paddingLeft: 0 }}>
|
|
64
|
-
<span className="selectedDateTitle"><FormattedMessage {...messages.to} /></span>
|
|
65
|
-
<input className="selectedDateRange" readOnly type="text" defaultValue={moment(endDate).format('MM/DD/YYYY').toString()} />
|
|
66
|
-
<i className="calenderIcon material-icons"><FormattedMessage {...messages.today} /></i>
|
|
67
|
-
</Grid.Column>
|
|
68
|
-
</Grid.Row>
|
|
69
|
-
<Grid.Row style={{ paddingTop: 0, paddingBottom: `${2}px` }}>
|
|
70
|
-
<Grid.Column style={{ paddingLeft: 0 }}>
|
|
71
|
-
<DatePicker
|
|
72
|
-
inline
|
|
73
|
-
selected={startDate}
|
|
74
|
-
startDate={startDate}
|
|
75
|
-
endDate={endDate}
|
|
76
|
-
onChange={this.handleChangeStart}
|
|
77
|
-
showMonthDropdown
|
|
78
|
-
showYearDropdown
|
|
79
|
-
dropdownMode="select"
|
|
80
|
-
/>
|
|
81
|
-
</Grid.Column>
|
|
82
|
-
<Grid.Column style={{ paddingLeft: 0 }}>
|
|
83
|
-
<DatePicker
|
|
84
|
-
inline
|
|
85
|
-
selected={endDate}
|
|
86
|
-
startDate={startDate}
|
|
87
|
-
endDate={endDate}
|
|
88
|
-
minDate={startDate}
|
|
89
|
-
maxDate={moment()}
|
|
90
|
-
onChange={this.handleChangeEnd}
|
|
91
|
-
showMonthDropdown
|
|
92
|
-
showYearDropdown
|
|
93
|
-
dropdownMode="select"
|
|
94
|
-
/>
|
|
95
|
-
</Grid.Column>
|
|
96
|
-
</Grid.Row>
|
|
97
|
-
<Grid.Row>
|
|
98
|
-
<Grid.Column width={16} style={{ paddingLeft: 0 }}>
|
|
99
|
-
<Button onClick={this.closeAndUpdate} className="btn-primary" floated="left"><FormattedMessage id="customdatepicker.done" defaultMessage="Done" /></Button>
|
|
100
|
-
<Button onClick={this.closeAndCancel} className="btn-secondary" floated="left"><FormattedMessage id="customdatepicker.cancel" defaultMessage="Cancel" /></Button>
|
|
101
|
-
</Grid.Column>
|
|
102
|
-
</Grid.Row>
|
|
103
|
-
</Grid>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
DateRange.propTypes = {
|
|
109
|
-
prevSelectedDate: PropTypes.object.isRequired,
|
|
110
|
-
handleDatePickerCancel: PropTypes.func,
|
|
111
|
-
handleDatePickerApply: PropTypes.func,
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export default DateRange;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* DateRange Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the DateRange component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
header: {
|
|
10
|
-
id: 'creatives.components.DateRange.header',
|
|
11
|
-
defaultMessage: 'This is the DateRange component !',
|
|
12
|
-
},
|
|
13
|
-
today: {
|
|
14
|
-
id: 'creatives.components.DateRange.today',
|
|
15
|
-
defaultMessage: 'Today',
|
|
16
|
-
},
|
|
17
|
-
from: {
|
|
18
|
-
id: 'creatives.components.DateRange.from',
|
|
19
|
-
defaultMessage: 'From',
|
|
20
|
-
},
|
|
21
|
-
to: {
|
|
22
|
-
id: 'creatives.components.DateRange.to',
|
|
23
|
-
defaultMessage: 'To',
|
|
24
|
-
},
|
|
25
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Edmeditor
|
|
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 messages from './messages';
|
|
14
|
-
// const loadScript = require('load-script');
|
|
15
|
-
// const defaultScriptUrl = "https://api-static.edmdesigner.com/EDMdesignerAPI.js";
|
|
16
|
-
|
|
17
|
-
class Edmeditor extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.state = {
|
|
21
|
-
editorInstance: undefined,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// this.onLoad = this.onLoad.bind(this);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
componentDidMount() {
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
componentWillReceiveProps(nextProps) {
|
|
32
|
-
|
|
33
|
-
// if (!_.isEqual(nextProps.content, this.props.content)) {
|
|
34
|
-
//
|
|
35
|
-
// this.editorInstance.content = nextProps.content;
|
|
36
|
-
// }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
componentWillUnmount() {
|
|
40
|
-
this.unmounting = true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
render() {
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
this.props.edmSrc ?
|
|
47
|
-
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{height: "calc(100vh - 180px)"}}></iframe>)
|
|
48
|
-
: 'aaasass'
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
Edmeditor.defaultProps = {
|
|
54
|
-
id: 'edmEditor',
|
|
55
|
-
activeClass: "",
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
Edmeditor.propTypes = {
|
|
59
|
-
id: PropTypes.string,
|
|
60
|
-
activeClass: PropTypes.string,
|
|
61
|
-
// getEditorInstanse: PropTypes.func,
|
|
62
|
-
edmSrc: PropTypes.string,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default Edmeditor;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Edmeditor Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the Edmeditor component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
header: {
|
|
10
|
-
id: 'creatives.components.Edmeditor.header',
|
|
11
|
-
defaultMessage: 'This is the Edmeditor component !',
|
|
12
|
-
},
|
|
13
|
-
});
|