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

[Discover] Add field types in-product help #126657

Merged
merged 33 commits into from
Apr 11, 2022
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9098107
added base popover
andreadelrio Jan 27, 2022
1fc6acd
add field types popover
andreadelrio Mar 2, 2022
57db5f6
Merge branch 'main' into field-types-help
kibanamachine Mar 2, 2022
750d2fb
replace callout
andreadelrio Mar 2, 2022
f8c49ce
Merge branch 'field-types-help' of https://github.com/andreadelrio/ki…
andreadelrio Mar 2, 2022
bea575b
fix anchor
andreadelrio Mar 2, 2022
1038e96
use another euifilterbutton
andreadelrio Mar 3, 2022
5cf6f73
clean up table and add more field types
andreadelrio Mar 4, 2022
8e924c4
Merge branch 'main' into field-types-help
kibanamachine Mar 14, 2022
38642cd
[Discover] add pagination
dimaanj Mar 15, 2022
892702c
Merge pull request #4 from Dmitriynj/field-types-help
andreadelrio Mar 15, 2022
69541c3
[Discover] show field types which are present in current data view, s…
dimaanj Mar 16, 2022
4be422a
Merge pull request #5 from Dmitriynj/field-types-help
andreadelrio Mar 16, 2022
13f3310
renaming
andreadelrio Mar 17, 2022
dc11636
more progress
andreadelrio Mar 18, 2022
7b998ed
remove _source
andreadelrio Mar 29, 2022
6a8e518
fix mobile view
andreadelrio Mar 29, 2022
0dd77a4
update icon
andreadelrio Mar 29, 2022
ef05603
Merge branch 'main' into field-types-help
dimaanj Apr 1, 2022
71c38d8
[Discover] improve unit tests
dimaanj Apr 1, 2022
0faad6d
Merge pull request #6 from Dmitriynj/field-types-help
andreadelrio Apr 1, 2022
36a9dae
Merge branch 'main' into field-types-help
kibanamachine Apr 4, 2022
33e1507
Scrolling instead of pagination
Apr 5, 2022
66ced34
Merge pull request #7 from cchaos/field-types-help
andreadelrio Apr 5, 2022
1435c12
i18n feedback
andreadelrio Apr 6, 2022
0f97f0b
cleanup
andreadelrio Apr 6, 2022
1fb3afb
Update src/plugins/discover/public/application/main/components/sideba…
andreadelrio Apr 6, 2022
24dfdba
Merge branch 'main' into field-types-help
kibanamachine Apr 7, 2022
ea7cdd2
Update discover_field_search.tsx
kertal Apr 7, 2022
df5dfac
add missing links
andreadelrio Apr 7, 2022
e24a184
fix conflic
andreadelrio Apr 7, 2022
17b25b8
Merge branch 'main' into field-types-help
kibanamachine Apr 7, 2022
58c07f7
Merge branch 'main' into field-types-help
kibanamachine Apr 11, 2022
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
Prev Previous commit
Next Next commit
remove _source
  • Loading branch information
andreadelrio committed Mar 29, 2022
commit 7b998edcb90b4509d08ef6646b2c202e4e5a6c5f
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
discover: {
guide: `${KIBANA_DOCS}discover.html`,
fieldStatistics: `${KIBANA_DOCS}show-field-statistics.html`,
fieldTypeHelp: `${ELASTICSEARCH_DOCS}mapping-types.html`,
},
filebeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
Original file line number Diff line number Diff line change
@@ -4,4 +4,5 @@

.dscFieldTypesHelp__popover {
flex-grow: 0;
}
min-width: 0 !important; // Reduce width of icon-only button
}
Original file line number Diff line number Diff line change
@@ -30,11 +30,13 @@ import {
EuiIcon,
EuiPagination,
EuiBasicTableColumn,
EuiLink,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { FieldIcon } from '@kbn/react-field';
import { getFieldTypeDescription } from './lib/get_field_type_description';
import { usePager } from '../../../../utils/use_pager';
import { useDiscoverServices } from '../../../../utils/use_discover_services';

export interface State {
searchable: string;
@@ -105,6 +107,8 @@ export function DiscoverFieldSearch({ onChange, value, types, presentFieldTypes
missing: true,
});

const { docLinks } = useDiscoverServices();

const { curPageIndex, pageSize, totalPages, startIndex, changePageIndex } = usePager({
initialPageSize: FIELD_TYPES_PER_PAGE,
totalItems: presentFieldTypes.length,
@@ -129,7 +133,7 @@ export function DiscoverFieldSearch({ onChange, value, types, presentFieldTypes
name: 'Data type',
width: '110px',
render: (name: string) => (
<EuiFlexGroup gutterSize="xs">
<EuiFlexGroup alignItems="center" responsive={false} gutterSize="xs">
<EuiFlexItem grow={false}>
<FieldIcon type={name} />
</EuiFlexItem>
@@ -366,7 +370,7 @@ export function DiscoverFieldSearch({ onChange, value, types, presentFieldTypes
display="block"
button={helpButton}
isOpen={isHelpOpen}
panelPaddingSize="s"
panelPaddingSize="m"
className="dscFieldTypesHelp__popover"
closePopover={closeHelp}
>
@@ -377,11 +381,14 @@ export function DiscoverFieldSearch({ onChange, value, types, presentFieldTypes
</EuiPopoverTitle>
<EuiBasicTable
style={TABLE_STYLE}
tableCaption="Description of field types"
tableCaption={i18n.translate('discover.fieldTypesPopover.tableTitle', {
defaultMessage: 'Description of field types',
})}
items={items}
compressed={true}
rowHeader="firstName"
columns={columnsSidebar}
responsive={false}
/>
<EuiSpacer size="s" />
{presentFieldTypes.length > FIELD_TYPES_PER_PAGE && (
@@ -398,6 +405,15 @@ export function DiscoverFieldSearch({ onChange, value, types, presentFieldTypes
</EuiFlexItem>
</EuiFlexGroup>
)}
<EuiPopoverFooter paddingSize="s">
Learn more about&nbsp;
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n

<EuiLink href={docLinks.links.discover.fieldTypeHelp}>
<FormattedMessage
id="discover.fieldTypesPopover.learnMore"
defaultMessage="field types"
andreadelrio marked this conversation as resolved.
Show resolved Hide resolved
/>
</EuiLink>
</EuiPopoverFooter>
</EuiPopover>
</EuiFilterGroup>
</EuiFlexItem>
Original file line number Diff line number Diff line change
@@ -201,9 +201,11 @@ export function DiscoverSidebarComponent({
const dataViewFieldTypes = new Set<string>();
if (Array.isArray(fields)) {
for (const field of fields) {
dataViewFieldTypes.add(field.type);
if (result.indexOf(field.type) === -1) {
result.push(field.type);
if (field.type !== '_source') {
dataViewFieldTypes.add(field.type);
andreadelrio marked this conversation as resolved.
Show resolved Hide resolved
if (result.indexOf(field.type) === -1) {
result.push(field.type);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -42,11 +42,6 @@ export function getFieldTypeDescription(type: string) {
return i18n.translate('discover.fieldNameDescription.numberField', {
defaultMessage: 'Long, integer, short, byte, double, and float values.',
});
case 'source':
// Note that this type is currently not provided, type for _source is undefined
return i18n.translate('discover.fieldNameDescription.sourceField', {
defaultMessage: 'Original JSON body provided during indexing.',
});
case 'string':
kertal marked this conversation as resolved.
Show resolved Hide resolved
return i18n.translate('discover.fieldNameDescription.stringField', {
defaultMessage: 'Full text such as the body of an email or a product description.',