Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split EuiUpdateButton from EuiSuperDatePicker so it can be used on its own #1470

Merged
merged 8 commits into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Added a new app icon for Code ([#1467](https://github.com/elastic/eui/pull/1467))
No public interface changes since `6.6.0`.
- Re-added EuiI18n, EuiI18nNumber, and EuiContext for localization ([#1466](https://github.com/elastic/eui/pull/1466))
- Expose `EuiSuperUpdateButton` componenent from `EuiSuperDatePicker` ([#1470](https://github.com/elastic/eui/pull/1470))
cchaos marked this conversation as resolved.
Show resolved Hide resolved
- Set `type="button"` on accordion buttons ([#1468](https://github.com/elastic/eui/pull/1468))

**Bug fixes**
Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/date_picker/date_picker_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EuiDatePicker,
EuiDatePickerRange,
EuiSuperDatePicker,
EuiSuperUpdateButton,
} from '../../../../src/components';

import DatePicker from './date_picker';
Expand Down Expand Up @@ -305,6 +306,6 @@ export const DatePickerExample = {
</div>
),
demo: <SuperDatePicker />,
props: { EuiSuperDatePicker },
props: { EuiSuperDatePicker, EuiSuperUpdateButton },
}],
};
1 change: 1 addition & 0 deletions src/components/date_picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export {

export {
EuiSuperDatePicker,
EuiSuperUpdateButton,
} from './super_date_picker';
Original file line number Diff line number Diff line change
Expand Up @@ -106,163 +106,13 @@ exports[`EuiSuperDatePicker is rendered 1`] = `
component="div"
grow={false}
>
<EuiToolTip
delay="regular"
position="bottom"
>
<EuiButton
className="euiSuperDatePicker__updateButton"
color="primary"
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
fill={true}
iconSide="left"
iconType="refresh"
onClick={[Function]}
textProps={
Object {
"className": "euiSuperDatePicker__updateButtonText",
}
}
type="button"
>
Refresh
</EuiButton>
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
`;

exports[`EuiSuperDatePicker isLoading 1`] = `
<EuiFlexGroup
alignItems="stretch"
component="div"
direction="row"
gutterSize="s"
justifyContent="flexStart"
responsive={false}
wrap={false}
>
<EuiFlexItem
component="div"
grow={true}
style={
Object {
"maxWidth": 480,
}
}
>
<EuiFormControlLayout
className="euiSuperDatePicker"
compressed={false}
<EuiSuperUpdateButton
data-test-subj="superDatePickerApplyTimeButton"
hasChanged={false}
isInvalid={false}
isLoading={false}
prepend={
<EuiQuickSelectPopover
applyTime={[Function]}
commonlyUsedRanges={
Array [
Object {
"end": "now/d",
"label": "Today",
"start": "now/d",
},
Object {
"end": "now-1d/d",
"label": "Yesterday",
"start": "now-1d/d",
},
Object {
"end": "now/w",
"label": "This week",
"start": "now/w",
},
Object {
"end": "now",
"label": "Week to date",
"start": "now/w",
},
Object {
"end": "now/M",
"label": "This month",
"start": "now/M",
},
Object {
"end": "now",
"label": "Month to date",
"start": "now/M",
},
Object {
"end": "now/y",
"label": "This year",
"start": "now/y",
},
Object {
"end": "now",
"label": "Year to date",
"start": "now/y",
},
]
}
dateFormat="MMM D, YYYY @ HH:mm:ss.SSS"
end="now"
isAutoRefreshOnly={false}
isPaused={true}
recentlyUsedRanges={Array []}
refreshInterval={0}
start="now-15m"
/>
}
>
<EuiDatePickerRange
className="euiDatePickerRange--inGroup"
endDateControl={<div />}
iconType={false}
isCustom={true}
startDateControl={<div />}
>
<button
className="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
onClick={[Function]}
>
Last 15 minutes
<span
className="euiSuperDatePicker__prettyFormatLink"
>
Show dates
</span>
</button>
</EuiDatePickerRange>
</EuiFormControlLayout>
</EuiFlexItem>
<EuiFlexItem
component="div"
grow={false}
>
<EuiToolTip
delay="regular"
position="bottom"
>
<EuiButton
className="euiSuperDatePicker__updateButton"
color="secondary"
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
fill={true}
iconSide="left"
iconType="kqlFunction"
isLoading={true}
onClick={[Function]}
textProps={
Object {
"className": "euiSuperDatePicker__updateButtonText",
}
}
type="button"
>
Updating
</EuiButton>
</EuiToolTip>
onApply={[Function]}
/>
</EuiFlexItem>
</EuiFlexGroup>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`EuiSuperUpdateButton hasChanged 1`] = `
<EuiToolTip
content="Click to apply"
delay="regular"
position="bottom"
>
<EuiButton
className="euiSuperDatePicker__updateButton"
color="secondary"
disabled={false}
fill={true}
iconSide="left"
iconType="kqlFunction"
isLoading={false}
onClick={[Function]}
textProps={
Object {
"className": "euiSuperDatePicker__updateButtonText",
}
}
type="button"
>
Update
</EuiButton>
</EuiToolTip>
`;

exports[`EuiSuperUpdateButton is rendered 1`] = `
<EuiToolTip
delay="regular"
position="bottom"
>
<EuiButton
className="euiSuperDatePicker__updateButton"
color="primary"
disabled={false}
fill={true}
iconSide="left"
iconType="refresh"
isLoading={false}
onClick={[Function]}
textProps={
Object {
"className": "euiSuperDatePicker__updateButtonText",
}
}
type="button"
>
Refresh
</EuiButton>
</EuiToolTip>
`;

exports[`EuiSuperUpdateButton isInvalid 1`] = `
<EuiToolTip
content="Can't update, values are invalid"
delay="regular"
position="bottom"
>
<EuiButton
className="euiSuperDatePicker__updateButton"
color="primary"
disabled={true}
fill={true}
iconSide="left"
iconType="refresh"
isLoading={false}
onClick={[Function]}
textProps={
Object {
"className": "euiSuperDatePicker__updateButtonText",
}
}
type="button"
>
Refresh
</EuiButton>
</EuiToolTip>
`;

exports[`EuiSuperUpdateButton isLoading 1`] = `
<EuiToolTip
delay="regular"
position="bottom"
>
<EuiButton
className="euiSuperDatePicker__updateButton"
color="secondary"
disabled={false}
fill={true}
iconSide="left"
iconType="kqlFunction"
isLoading={true}
onClick={[Function]}
textProps={
Object {
"className": "euiSuperDatePicker__updateButtonText",
}
}
type="button"
>
Updating
</EuiButton>
</EuiToolTip>
`;
4 changes: 4 additions & 0 deletions src/components/date_picker/super_date_picker/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export {
EuiSuperDatePicker,
} from './super_date_picker';

export {
EuiSuperUpdateButton,
} from './update_button';
Loading