-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[DataView] UX improvements for index pattern input in data view flyout #152138
Changes from 30 commits
6ab50c3
00d4afd
ae5e3d3
e865d75
467f0f9
907b6cd
c77b427
e359053
7898c9a
6033f31
d8e6e2a
b8cd0e7
189596c
9d02c5c
e116b8d
6ef4a30
872f1ad
f961abb
d65bfc5
6ceab6a
a5f7f3f
6b8505a
72eca96
5bfcf54
d36e595
7ec88e0
f681b82
c02bf10
8877942
4380abe
5614856
f6c4003
2d0cdc1
bcdb2bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
], | ||
"requiredBundles": [ | ||
"kibanaReact", | ||
"kibanaUtils", | ||
"esUiShared" | ||
] | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { findTestSubject } from '@elastic/eui/lib/test'; | ||
import { mountWithIntl } from '@kbn/test-jest-helpers'; | ||
import { TitleDocsPopover } from './title_docs_popover'; | ||
|
||
describe('DataViewEditor TitleDocsPopover', () => { | ||
it('should render normally', async () => { | ||
const component = mountWithIntl(<TitleDocsPopover />); | ||
|
||
expect(findTestSubject(component, 'indexPatternDocsButton').exists()).toBeTruthy(); | ||
expect(findTestSubject(component, 'indexPatternDocsPopoverContent').exists()).toBeFalsy(); | ||
|
||
findTestSubject(component, 'indexPatternDocsButton').simulate('click'); | ||
|
||
await component.update(); | ||
|
||
expect(findTestSubject(component, 'indexPatternDocsPopoverContent').exists()).toBeTruthy(); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React, { useState } from 'react'; | ||
import { css } from '@emotion/react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { | ||
EuiButtonIcon, | ||
EuiPanel, | ||
EuiPopover, | ||
EuiPopoverTitle, | ||
EuiText, | ||
EuiCode, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const TitleDocsPopover: React.FC = () => { | ||
const [isOpen, setIsOpen] = useState<boolean>(false); | ||
|
||
const helpButton = ( | ||
<EuiButtonIcon | ||
onClick={() => setIsOpen((prev) => !prev)} | ||
iconType="documentation" | ||
data-test-subj="indexPatternDocsButton" | ||
aria-label={i18n.translate('indexPatternEditor.titleDocsPopover.ariaLabel', { | ||
defaultMessage: 'Index pattern examples', | ||
})} | ||
/> | ||
); | ||
|
||
return ( | ||
<EuiPopover | ||
button={helpButton} | ||
isOpen={isOpen} | ||
display="inlineBlock" | ||
panelPaddingSize="none" | ||
closePopover={() => setIsOpen(false)} | ||
> | ||
<EuiPopoverTitle paddingSize="s"> | ||
{i18n.translate('indexPatternEditor.titleDocsPopover.title', { | ||
defaultMessage: 'Index pattern', | ||
})} | ||
</EuiPopoverTitle> | ||
<EuiPanel | ||
className="eui-yScroll" | ||
css={css` | ||
max-height: 40vh; | ||
max-width: 500px; | ||
`} | ||
color="transparent" | ||
paddingSize="m" | ||
> | ||
<EuiText size="s" data-test-subj="indexPatternDocsPopoverContent"> | ||
<p> | ||
<FormattedMessage | ||
id="indexPatternEditor.titleDocsPopover.indexPatternDescription" | ||
defaultMessage="An index pattern is a string that you use to match one or more data streams, indices, or aliases." | ||
/> | ||
</p> | ||
<ul> | ||
<li> | ||
<p> | ||
<FormattedMessage | ||
id="indexPatternEditor.titleDocsPopover.useWildcardDescription" | ||
defaultMessage="Match multiple sources with a wildcard (*)." | ||
/> | ||
</p> | ||
<p> | ||
<EuiCode>filebeat-*</EuiCode> | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
<FormattedMessage | ||
id="indexPatternEditor.titleDocsPopover.useCommasDescription" | ||
defaultMessage="Separate multiple single sources with a comma (,)." | ||
/> | ||
</p> | ||
<p> | ||
<EuiCode>filebeat-a,filebeat-b</EuiCode> | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
<FormattedMessage | ||
id="indexPatternEditor.titleDocsPopover.useMinusDescription" | ||
defaultMessage="Exclude a source with the minus sign (-)." | ||
/> | ||
</p> | ||
<p> | ||
<EuiCode>filebeat-*,-filebeat-c</EuiCode> | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
<FormattedMessage | ||
id="indexPatternEditor.titleDocsPopover.dontUseSpecialCharactersDescription" | ||
defaultMessage="Spaces and the characters /?”<> are not allowed." | ||
/> | ||
</p> | ||
</li> | ||
</ul> | ||
</EuiText> | ||
</EuiPanel> | ||
</EuiPopover> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm tempted to shorted the index pattern field description text now that there's a popover to just the first sentence. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with shortening the hint text under the field description. I'll work up some text. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the
|
char is missing, also the quote character changed. I'm comparing to the form schema change.