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

Add Suggest component #2270

Merged
merged 73 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
64b2e95
basic version works
andreadelrio Jun 21, 2019
1e5d2c9
props descriptions
andreadelrio Jun 24, 2019
259573e
added first basic version
andreadelrio Jun 26, 2019
6f9bad3
added expandLongLabel
andreadelrio Jun 27, 2019
fe5f173
removed some quotes
andreadelrio Jul 2, 2019
fa19024
added some basic docs
andreadelrio Jul 2, 2019
3185d9b
added layout to replace expandLongLabel
andreadelrio Jul 2, 2019
e23f429
tests passing
thompsongl Jul 3, 2019
147487e
Merge pull request #1 from thompsongl/suggest-item
andreadelrio Jul 3, 2019
4a2860f
placed suggestItem import and export in correct order
andreadelrio Jul 3, 2019
0ab76c6
some css fixes
andreadelrio Jul 3, 2019
9b4fdfa
changed the way 'status' is handled'
andreadelrio Jul 5, 2019
1c39ecb
fixed typo and renamed variables
andreadelrio Jul 5, 2019
091a19f
considering vis colors
andreadelrio Jul 9, 2019
3e87f51
changes based on feedback
andreadelrio Jul 11, 2019
08197bd
updated colors and added minor css changes
andreadelrio Jul 13, 2019
eb8e5e8
basic version works
andreadelrio Jun 21, 2019
7ccf026
props descriptions
andreadelrio Jun 24, 2019
c21843b
added expandLongLabel
andreadelrio Jun 27, 2019
b68f805
removed some quotes
andreadelrio Jul 2, 2019
b582011
tests passing
thompsongl Jul 3, 2019
418cba6
added layout to replace expandLongLabel
andreadelrio Jul 2, 2019
ac69d10
Merge pull request #1 from thompsongl/suggest-item
andreadelrio Jul 3, 2019
7a0555b
placed suggestItem import and export in correct order
andreadelrio Jul 3, 2019
d850644
some css fixes
andreadelrio Jul 3, 2019
c0b57c7
considering vis colors
andreadelrio Jul 9, 2019
e6cabe4
changes based on feedback
andreadelrio Jul 11, 2019
93f1e9b
updated colors and added minor css changes
andreadelrio Jul 13, 2019
56e3751
Merge branch 'master' into suggest-item
andreadelrio Jul 15, 2019
0a6f7c9
Merge branch 'suggest-item' of https://github.com/andreadelrio/eui in…
andreadelrio Jul 15, 2019
4327708
added first basic version
andreadelrio Jun 26, 2019
8966a7d
added some basic docs
andreadelrio Jul 2, 2019
bcc17b2
changed the way 'status' is handled'
andreadelrio Jul 5, 2019
aabbcfd
fixed typo and renamed variables
andreadelrio Jul 5, 2019
cfb4734
Merge branch 'suggest-item' into suggest-input
andreadelrio Jul 15, 2019
065330f
might work on pattern soon
andreadelrio Jul 16, 2019
18203eb
pattern base
andreadelrio Jul 22, 2019
2994088
about to play with width
andreadelrio Jul 24, 2019
6bcf6cc
added action and resize
andreadelrio Jul 26, 2019
4de0870
added filters to pattern
andreadelrio Jul 27, 2019
b51ebd8
Merge remote-tracking branch 'upstream/master' into suggest-input
andreadelrio Jul 27, 2019
18ac80b
working on pattern, need to update tests
andreadelrio Jul 29, 2019
333affc
small update to test
andreadelrio Jul 29, 2019
e77c36a
Merge remote-tracking branch 'upstream/master' into suggest-input
andreadelrio Jul 29, 2019
ed3b256
added hashtag dropdown
andreadelrio Jul 30, 2019
7596a44
suggestInput not expanding
andreadelrio Jul 31, 2019
d9b1abd
suggestInput now expands
andreadelrio Aug 1, 2019
cb3ac18
moving suggestions to suggestInput component
andreadelrio Aug 2, 2019
81effa8
moved some things to component
andreadelrio Aug 6, 2019
4c4b068
Merge remote-tracking branch 'upstream/master' into suggest-input
andreadelrio Aug 6, 2019
e2ed869
added inputPopover
andreadelrio Aug 7, 2019
5fe49bf
removed pattern from Header
andreadelrio Aug 7, 2019
0cd6c5a
hashtag dropdown save button not working
andreadelrio Aug 8, 2019
41d453a
updated docs structure for suggest
andreadelrio Aug 8, 2019
dbeca43
Swapping for so consumer can pass down anything they want
Aug 9, 2019
435da7a
Merge pull request #2 from cchaos/suggest-input/appends
andreadelrio Aug 9, 2019
6bb901c
passing input value to Suggest
andreadelrio Aug 12, 2019
86c288a
Merge remote-tracking branch 'upstream/master' into suggest-input
andreadelrio Aug 28, 2019
1825746
using the updated version of inputPopover
andreadelrio Aug 28, 2019
f450404
updated changelog
andreadelrio Aug 28, 2019
ea566ff
fixed cl conflict
andreadelrio Aug 29, 2019
8187bbc
moved hashtagPopover to separate file
andreadelrio Aug 30, 2019
8983e09
made suggestItem clickable
andreadelrio Aug 30, 2019
9843357
updated tests
andreadelrio Sep 3, 2019
746e0e8
renamed props and added snippet
andreadelrio Sep 4, 2019
c81b702
suggest item now uses the button tag
andreadelrio Sep 5, 2019
1b5ec1b
renamed class
andreadelrio Sep 5, 2019
0c59ec3
fixed conflicts
andreadelrio Sep 5, 2019
62f6b0f
small fixes
andreadelrio Sep 6, 2019
fd7c070
fixed conflicts
andreadelrio Sep 6, 2019
de184ea
cleaned up onstructors and binding at definition
andreadelrio Sep 11, 2019
a5a5cf9
cl
andreadelrio Sep 11, 2019
e04a84d
cl
andreadelrio Sep 13, 2019
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
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Created `EuiSuggest` component ([#2270](https://github.com/elastic/eui/pull/2270))
- Added missing `compressed` styling to `EuiSwitch` ([#2327](https://github.com/elastic/eui/pull/2327))

## [`14.0.0`](https://github.com/elastic/eui/tree/v14.0.0)
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ import { StatExample } from './views/stat/stat_example';

import { StepsExample } from './views/steps/steps_example';

// import { SuggestExample } from './views/suggest/suggest_example';
import { SuggestExample } from './views/suggest/suggest_example';

import { TableExample } from './views/tables/tables_example';

Expand Down Expand Up @@ -352,7 +352,7 @@ const navigation = [
RangeControlExample,
SearchBarExample,
SelectableExample,
// SuggestExample,
SuggestExample,
].map(example => createExample(example)),
},
{
Expand Down
6 changes: 1 addition & 5 deletions src-docs/src/theme_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@

@import '../../src/theme_dark';
@import './components/guide_components';
@import './views/header/global_filter_group';

// Elastic charts
@import '~@elastic/charts/dist/theme';
@import '../../src/themes/charts/theme';
@import './views/suggest/global_filter_group';
7 changes: 1 addition & 6 deletions src-docs/src/theme_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@

@import '../../src/theme_light';
@import './components/guide_components';
@import './views/header/global_filter_group';

// Elastic charts
@import '~@elastic/charts/dist/theme';
@import '../../src/themes/charts/theme';

@import './views/suggest/global_filter_group';
Empty file.
167 changes: 0 additions & 167 deletions src-docs/src/views/header/global_query.js

This file was deleted.

45 changes: 0 additions & 45 deletions src-docs/src/views/header/header_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@ import {
EuiCode,
EuiHeaderLinks,
EuiHeaderLink,
EuiCallOut,
} from '../../../../src/components';

import { GlobalFilterBar } from './global_filter_bar';
import GlobalFilterAdd from './global_filter_add';
import GlobalFilterOptions from './global_filter_options';
import GlobalFilterForm from './global_filter_form';
import { GlobalFilterItem } from './global_filter_item';

import Header from './header';
const headerSource = require('!!raw-loader!./header');
const headerHtml = renderToHtml(Header);
Expand All @@ -31,10 +24,6 @@ import HeaderLinks from './header_links';
const headerLinksSource = require('!!raw-loader!./header_links');
const headerLinksHtml = renderToHtml(HeaderLinks);

import GlobalQuery from './global_query';
const globalQuerySource = require('!!raw-loader!./global_query');
const globalQueryHtml = renderToHtml(GlobalQuery);

const headerSnippet = `<EuiHeader>
<EuiHeaderSection grow={false}>
<EuiHeaderSectionItem border="right">
Expand Down Expand Up @@ -122,39 +111,5 @@ export const HeaderExample = {
snippet: headerLinksSnippet,
demo: <HeaderLinks />,
},
{
title: 'Global query and filters',
source: [
{
type: GuideSectionTypes.JS,
code: globalQuerySource,
},
{
type: GuideSectionTypes.HTML,
code: globalQueryHtml,
},
],
text: (
<div>
<EuiCallOut color="warning" title="Demo of visual pattern only">
<p>
This documents a <strong>visual</strong> pattern for the eventual
replacement of Kibana&apos;s global query and filter bars. The
filter bar has been broken down into multiple components. There
are still bugs and not all the logic is well-formed.
</p>
</EuiCallOut>
</div>
),
props: {
GlobalQuery,
GlobalFilterBar,
GlobalFilterOptions,
GlobalFilterAdd,
GlobalFilterForm,
GlobalFilterItem,
},
demo: <GlobalQuery />,
},
],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'global_filter_item';
@import 'global_filter_form';
@import 'saved_queries';

.globalFilterGroup__filterBar {
margin-top: $euiSizeM;
Expand All @@ -25,4 +25,4 @@

.globalFilterBar__flexItem {
max-width: calc(100% - #{$euiSizeXS}); // Width minus margin around each flex itm
}
}
31 changes: 31 additions & 0 deletions src-docs/src/views/suggest/_saved_queries.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.savedQueriesInput__hideDatepicker {
.euiSuperDatePicker__flexWrapper {
width: 100%;

> div:nth-of-type(1) {
display: none;
}
}
}

.savedQueriesInput {
padding-bottom: $euiSizeXL * 6;
}

.savedQueryManagement__text {
padding: $euiSizeM $euiSizeM ($euiSizeM / 2);
}

.savedQueryManagement__listWrapper {
// Addition height will ensure one item is "cutoff" to indicate more below the scroll
max-height: $euiFormMaxWidth + $euiSize;
overflow-y: hidden;
}

.savedQueryManagement__list {
@include euiYScrollWithShadows;
max-height: inherit; // Fixes overflow for applied max-height
// Left/Right padding is calculated to match the left alignment of the
// popover text and buttons
padding: ($euiSizeM / 2) $euiSizeXS !important; // sass-lint:disable-line no-important
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ import GlobalFilterForm from './global_filter_form';
export default class GlobalFilterAdd extends Component {
static propTypes = {};

constructor(props) {
super(props);

this.state = {
isPopoverOpen: false,
};
}
state = {
isPopoverOpen: false,
};

togglePopover = () => {
this.setState(prevState => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,22 @@ export default class GlobalFilterForm extends Component {
selectedObject: PropTypes.object,
};

constructor(props) {
super(props);

this.state = {
fieldOptions: fieldOptions,
operandOptions: operatorOptions,
valueOptions: valueOptions,
selectedField: this.props.selectedObject
? this.props.selectedObject.field
: [],
selectedOperand: this.props.selectedObject
? this.props.selectedObject.operand
: [],
selectedValues: this.props.selectedObject
? this.props.selectedObject.values
: [],
useCustomLabel: false,
customLabel: '',
};
}
state = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chandlerprall Should all the states have been pulled out of the constructor?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! This change is great to see

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL, thx

fieldOptions: fieldOptions,
operandOptions: operatorOptions,
valueOptions: valueOptions,
selectedField: this.props.selectedObject
? this.props.selectedObject.field
: [],
selectedOperand: this.props.selectedObject
? this.props.selectedObject.operand
: [],
selectedValues: this.props.selectedObject
? this.props.selectedObject.values
: [],
useCustomLabel: false,
customLabel: '',
};

onFieldChange = selectedOptions => {
// We should only get back either 0 or 1 options.
Expand Down
Loading