forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a Table view for index mappings (elastic#178360)
Index mappings should be viewable in a human-readable format that is not JSON. We could probably leverage the existing mappings editor UI that we use when composing index and component templates to do this. In this PR, we addressed the following items: - [x] Show a read-only mapping view - [x] Add a search bar to search for specific fields https://github.com/elastic/kibana/assets/132922331/7211e778-b33b-4b2c-93d8-6b9b7d65956e --------- Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
- Loading branch information
1 parent
ad299de
commit 3a5136a
Showing
9 changed files
with
397 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...lication/components/mappings_editor/components/document_fields/document_fields_search.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiFieldSearch, EuiFlexItem } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
interface Props { | ||
searchValue: string; | ||
onSearchChange(value: string): void; | ||
disabled?: boolean; | ||
} | ||
|
||
export const DocumentFieldsSearch = React.memo( | ||
({ searchValue, onSearchChange, disabled = false }: Props) => { | ||
return ( | ||
<EuiFlexItem grow={false}> | ||
<EuiFieldSearch | ||
disabled={disabled} | ||
style={{ minWidth: '350px' }} | ||
placeholder={i18n.translate( | ||
'xpack.idxMgmt.mappingsEditor.documentFields.searchFieldsPlaceholder', | ||
{ | ||
defaultMessage: 'Search fields', | ||
} | ||
)} | ||
value={searchValue} | ||
onChange={(e) => { | ||
// Temporary fix until EUI fixes the contract | ||
// See my comment https://github.com/elastic/eui/pull/2723/files#r366725059 | ||
if (typeof e === 'string') { | ||
onSearchChange(e); | ||
} else { | ||
onSearchChange(e.target.value); | ||
} | ||
}} | ||
aria-label={i18n.translate( | ||
'xpack.idxMgmt.mappingsEditor.documentFields.searchFieldsAriaLabel', | ||
{ | ||
defaultMessage: 'Search mapped fields', | ||
} | ||
)} | ||
data-test-subj="DocumentFieldsSearch" | ||
/> | ||
</EuiFlexItem> | ||
); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.