Setting the time to "Now" means that on every refresh
this time will be set to the time of the refresh.
@@ -76,6 +76,7 @@ export function EuiDatePopoverContent({ value, roundUp, onChange, dateFormat })
return (
+
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select.test.js.snap b/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select.test.js.snap
index 95e30574a8e..12d0b8b97f2 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select.test.js.snap
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select.test.js.snap
@@ -191,17 +191,13 @@ exports[`EuiSuperDatePicker is rendered 1`] = `
hasEmptyLabelSpace={false}
>
Apply
@@ -407,17 +403,13 @@ exports[`EuiSuperDatePicker prevQuickSelect 1`] = `
hasEmptyLabelSpace={false}
>
Apply
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/_index.scss b/src/components/date_picker/super_date_picker/quick_select_popover/_index.scss
new file mode 100644
index 00000000000..4fc081c561d
--- /dev/null
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/_index.scss
@@ -0,0 +1,3 @@
+@import 'quick_select_popover';
+@import 'quick_select';
+@import 'refresh_interval';
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select.scss b/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select.scss
new file mode 100644
index 00000000000..4a5b8ed06f6
--- /dev/null
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select.scss
@@ -0,0 +1,5 @@
+
+.euiQuickSelect__applyButton {
+ // Allow the button to shrink
+ min-width: 0;
+}
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss b/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss
new file mode 100644
index 00000000000..cbf1e8ee1ee
--- /dev/null
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss
@@ -0,0 +1,17 @@
+.euiQuickSelectPopover__content {
+ width: $euiFormMaxWidth;
+ max-width: 100%;
+}
+
+.euiQuickSelectPopover__section {
+ @include euiScrollBar;
+ max-height: $euiSizeM * 11;
+ overflow: hidden;
+ overflow-y: auto;
+}
+
+// sass-lint:disable no-important
+.euiQuickSelectPopover__buttonText {
+ // Override specificity from universal and sibiling selectors
+ margin-right: $euiSizeXS !important;
+}
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/_refresh_interval.scss b/src/components/date_picker/super_date_picker/quick_select_popover/_refresh_interval.scss
new file mode 100644
index 00000000000..e002eddc4ca
--- /dev/null
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/_refresh_interval.scss
@@ -0,0 +1,4 @@
+.euiRefreshInterval__startButton {
+ // Just enough to keep it the same size for "Start" and "Stop"
+ min-width: 90px;
+}
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js b/src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js
index a80774719e4..5cd9a1edc07 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js
@@ -31,7 +31,7 @@ export function EuiCommonlyUsedTimeRanges({ applyTime, commonlyUsedRanges }) {
Commonly used
-
+
{links}
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.js b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.js
index 3d06c1dfa9b..95462ff963e 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.js
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.js
@@ -166,9 +166,9 @@ export class EuiQuickSelect extends Component {
Apply
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js
index 889f5ba3f34..d4899d372da 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js
@@ -52,8 +52,8 @@ export class EuiQuickSelectPopover extends Component {
render() {
const quickSelectButton = (
Recently used date ranges
-
+
{links}
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.js b/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.js
index 59f741b060c..92ffa01bc8a 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.js
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.js
@@ -113,10 +113,10 @@ export class EuiRefreshInterval extends Component {
diff --git a/src/components/date_picker/super_date_picker/super_date_picker.js b/src/components/date_picker/super_date_picker/super_date_picker.js
index 97756ccd20b..641eb0d8bce 100644
--- a/src/components/date_picker/super_date_picker/super_date_picker.js
+++ b/src/components/date_picker/super_date_picker/super_date_picker.js
@@ -11,7 +11,7 @@ import { EuiDatePopoverButton } from './date_popover/date_popover_button';
import { EuiDatePickerRange } from '../date_picker_range';
import { EuiFormControlLayout } from '../../form';
-import { EuiButton, EuiButtonEmpty } from '../../button';
+import { EuiButton } from '../../button';
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
import { EuiToolTip } from '../../tool_tip';
@@ -193,22 +193,14 @@ export class EuiSuperDatePicker extends Component {
startDateControl={}
endDateControl={}
>
-
{prettyDuration(start, end, this.props.commonlyUsedRanges, this.props.dateFormat)}
-
-
- Show dates
-
+ Show dates
+
);
}
@@ -248,10 +240,18 @@ export class EuiSuperDatePicker extends Component {
if (this.state.hasChanged || this.props.isLoading) {
buttonText = this.props.isLoading ? 'Updating' : 'Update';
}
+
+ let tooltipContent;
+ if (this.state.isInvalid) {
+ tooltipContent = 'Can\'t update, dates are invalid';
+ } else if (this.state.hasChanged && !this.props.isLoading) {
+ tooltipContent = 'Click to apply';
+ }
+
return (