diff --git a/client/app/assets/less/redash/ant.less b/client/app/assets/less/redash/ant.less index 0bfc892d50..5fa5a49bf8 100644 --- a/client/app/assets/less/redash/ant.less +++ b/client/app/assets/less/redash/ant.less @@ -6,6 +6,8 @@ @import '~antd/lib/tooltip/style/index.less'; @import '~antd/lib/select/style/index.less'; @import '~antd/lib/button/style/index.less'; +@import '~antd/lib/radio/style/index.less'; +@import '~antd/lib/time-picker/style/index.less'; // Overwritting Ant Design defaults to fit into Redash current style @font-family-no-number : @redash-font; diff --git a/client/app/components/queries/ScheduleDialog.css b/client/app/components/queries/ScheduleDialog.css index fbc8981fec..e7dca1567c 100644 --- a/client/app/components/queries/ScheduleDialog.css +++ b/client/app/components/queries/ScheduleDialog.css @@ -1,5 +1,5 @@ .schedule { - width: 300px !important; + width: 449px !important; margin: 0 auto; } @@ -7,7 +7,20 @@ padding: 5px 0px; } -.schedule-component > div { - padding-right: 5px; - float: left; -} \ No newline at end of file +.schedule-component > * { + display: inline-block; +} + +.schedule-component h5 { + margin-right: 10px; + width: 87px; + text-align: right; +} + +.schedule-component > div > *:not(:last-child) { + margin-right: 3px; +} + +.schedule-component datepicker { + display: block; +} diff --git a/client/app/components/queries/ScheduleDialog.jsx b/client/app/components/queries/ScheduleDialog.jsx index b22e70d003..b6d28b2bbc 100644 --- a/client/app/components/queries/ScheduleDialog.jsx +++ b/client/app/components/queries/ScheduleDialog.jsx @@ -3,7 +3,10 @@ import React from 'react'; import PropTypes from 'prop-types'; import Modal from 'antd/lib/modal'; import DatePicker from 'antd/lib/date-picker'; -import { range, padStart, clone, isEqual } from 'lodash'; +import TimePicker from 'antd/lib/time-picker'; +import Select from 'antd/lib/select'; +import Radio from 'antd/lib/radio'; +import { range, clone, isEqual } from 'lodash'; import moment from 'moment'; import { secondsToInterval, intervalToSeconds, IntervalEnum } from '@/filters'; @@ -19,10 +22,9 @@ const INTERVAL_OPTIONS_MAP = { [IntervalEnum.WEEKS]: 5, }; -const HOUR_OPTIONS = range(0, 24).map(x => padStart(x, 2, '0')); // [00, 01, 02, ..] -const MINUTE_OPTIONS = range(0, 60, 5).map(x => padStart(x, 2, '0')); // [00, 05, 10, ..] const DATE_FORMAT = 'YYYY-MM-DD'; const HOUR_FORMAT = 'HH:mm'; +const Option = Select.Option; function localizeTime(time) { const [hrs, mins] = time.split(':'); @@ -47,6 +49,7 @@ class ScheduleDialog extends React.Component { constructor(props) { super(props); this.state = this.initState; + this.modalRef = React.createRef(); // used by - {this.counts.map(cnt => ( - +
+
Refresh every
+
+ {interval !== IntervalEnum.NEVER ? ( + + ) : null} + - ) : null} - + +
{[IntervalEnum.DAYS, IntervalEnum.WEEKS].indexOf(interval) !== -1 ? (
-
At the following time
- - +
On time
+
+ +
) : null} {IntervalEnum.WEEKS === interval ? ( -
-
+
+
On day
+ {WEEKDAYS_SHORT.map(day => ( - + + {day[0]} + ))} -
+
) : null} - {interval ? ( + {interval !== IntervalEnum.NEVER ? (
-
Stop refresh on:
- +
Ends
+
+ + Never + On + + {until ? ( + + ) : null} +
) : null}