-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Enterprise Search][Search Application] Update engines to be search application #155299
Merged
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a762ba9
initial commit - rewording engines to search application
saarikabhasi 068121f
Merge branch 'main' of github.com:elastic/kibana into search-app-rename
saarikabhasi d5ce092
Fix add indices and rewording
saarikabhasi c51cf9c
Fix: test cases and remove debug log
saarikabhasi 58a14c3
Remove unused translations
saarikabhasi e726f8d
Fix: translation error and more rewording
saarikabhasi 175fc6d
Rename engines to search application - API page
saarikabhasi 62af97a
PR feedback - suggested changes and more rewording
saarikabhasi 37bf8e8
Resolve merge conflicts
saarikabhasi 0c4f318
Fix: Jest test error and translations
saarikabhasi a742248
Remove types from Create search app logic
saarikabhasi 54977aa
Rewording and delete stale file
saarikabhasi 8d9598d
Merge branch 'main' into search-app-rename
saarikabhasi 85f1603
Fix: navigate to list page after search app creations, cleanups
saarikabhasi 4cf99fb
Merge branch 'search-app-rename' of github.com:saarikabhasi/kibana in…
saarikabhasi 7292466
Merge branch 'main' into search-app-rename
saarikabhasi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 | ||||
---|---|---|---|---|---|---|
|
@@ -5,13 +5,13 @@ | |||||
* 2.0. | ||||||
*/ | ||||||
|
||||||
import React from 'react'; | ||||||
import React, { useEffect } from 'react'; | ||||||
|
||||||
import { useLocation } from 'react-router-dom'; | ||||||
|
||||||
import { useActions, useValues } from 'kea'; | ||||||
|
||||||
import { | ||||||
EuiButton, | ||||||
EuiButtonEmpty, | ||||||
EuiFlexGroup, | ||||||
EuiFlexItem, | ||||||
EuiFieldText, | ||||||
|
@@ -33,14 +33,18 @@ import { FormattedMessage } from '@kbn/i18n-react'; | |||||
|
||||||
import { Status } from '../../../../../common/types/api'; | ||||||
import { ElasticsearchIndexWithIngestion } from '../../../../../common/types/indices'; | ||||||
import { isNotNullish } from '../../../../../common/utils/is_not_nullish'; | ||||||
|
||||||
import { CANCEL_BUTTON_LABEL } from '../../../shared/constants'; | ||||||
import { CANCEL_BUTTON_LABEL, ESINDEX_QUERY_PARAMETER } from '../../../shared/constants'; | ||||||
import { docLinks } from '../../../shared/doc_links'; | ||||||
import { getErrorsFromHttpResponse } from '../../../shared/flash_messages/handle_api_errors'; | ||||||
|
||||||
import { indexToOption, IndicesSelectComboBox } from './components/indices_select_combobox'; | ||||||
import { parseQueryParams } from '../../../shared/query_params'; | ||||||
|
||||||
import { EuiButtonEmptyTo, EuiButtonTo } from '../../../shared/react_router_helpers'; | ||||||
|
||||||
import { ENGINES_PATH } from '../../routes'; | ||||||
|
||||||
import { indexToOption, IndicesSelectComboBox } from './components/indices_select_combobox'; | ||||||
import { CreateEngineLogic } from './create_engine_logic'; | ||||||
|
||||||
export interface CreateEngineFlyoutProps { | ||||||
|
@@ -60,19 +64,26 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
selectedIndices, | ||||||
} = useValues(CreateEngineLogic); | ||||||
|
||||||
const { search } = useLocation() as unknown as Location; | ||||||
const { ...params } = parseQueryParams(search); | ||||||
const indexName = params[ESINDEX_QUERY_PARAMETER]; | ||||||
|
||||||
const onIndicesChange = ( | ||||||
selectedOptions: Array<EuiComboBoxOptionOption<ElasticsearchIndexWithIngestion>> | ||||||
) => { | ||||||
setSelectedIndices(selectedOptions.map((option) => option.value).filter(isNotNullish)); | ||||||
setSelectedIndices(selectedOptions.map((option) => option.label)); | ||||||
}; | ||||||
useEffect(() => { | ||||||
if (indexName && typeof indexName === 'string') setSelectedIndices([indexName]); | ||||||
}, []); | ||||||
|
||||||
return ( | ||||||
<EuiFlyout onClose={onClose} size="m"> | ||||||
<EuiFlyoutHeader> | ||||||
<EuiTitle size="m"> | ||||||
<h3> | ||||||
{i18n.translate('xpack.enterpriseSearch.content.engines.createEngine.headerTitle', { | ||||||
defaultMessage: 'Create an engine', | ||||||
defaultMessage: 'Create an Search Application', | ||||||
})} | ||||||
</h3> | ||||||
</EuiTitle> | ||||||
|
@@ -81,7 +92,7 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
<p> | ||||||
<FormattedMessage | ||||||
id="xpack.enterpriseSearch.content.engines.createEngine.headerSubTitle" | ||||||
defaultMessage="An engine allows your users to query data in your indices. Explore our {enginesDocsLink} to learn more!" | ||||||
defaultMessage="An Search Application allows your users to query data in your indices. Explore our {enginesDocsLink} to 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.
Suggested change
|
||||||
values={{ | ||||||
enginesDocsLink: ( | ||||||
<EuiLink | ||||||
|
@@ -92,7 +103,7 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
> | ||||||
{i18n.translate( | ||||||
'xpack.enterpriseSearch.content.engines.createEngine.header.docsLink', | ||||||
{ defaultMessage: 'Engines documentation' } | ||||||
{ defaultMessage: 'Search Application documentation' } | ||||||
)} | ||||||
</EuiLink> | ||||||
), | ||||||
|
@@ -107,7 +118,7 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
color="danger" | ||||||
title={i18n.translate( | ||||||
'xpack.enterpriseSearch.content.engines.createEngine.header.createError.title', | ||||||
{ defaultMessage: 'Error creating engine' } | ||||||
{ defaultMessage: 'Error creating search application' } | ||||||
)} | ||||||
> | ||||||
{getErrorsFromHttpResponse(createEngineError).map((errMessage, i) => ( | ||||||
|
@@ -126,7 +137,7 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
fullWidth | ||||||
isDisabled={formDisabled} | ||||||
onChange={onIndicesChange} | ||||||
selectedOptions={selectedIndices.map(indexToOption)} | ||||||
selectedOptions={selectedIndices.map((index: string) => indexToOption(index))} | ||||||
/> | ||||||
), | ||||||
status: indicesStatus, | ||||||
|
@@ -142,7 +153,7 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
disabled={formDisabled} | ||||||
placeholder={i18n.translate( | ||||||
'xpack.enterpriseSearch.content.engines.createEngine.nameEngine.placeholder', | ||||||
{ defaultMessage: 'Engine name' } | ||||||
{ defaultMessage: 'Search Application name' } | ||||||
)} | ||||||
value={engineName} | ||||||
onChange={(e) => setEngineName(e.target.value)} | ||||||
|
@@ -151,7 +162,7 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
status: engineNameStatus, | ||||||
title: i18n.translate( | ||||||
'xpack.enterpriseSearch.content.engines.createEngine.nameEngine.title', | ||||||
{ defaultMessage: 'Name your engine' } | ||||||
{ defaultMessage: 'Name your Search Application' } | ||||||
), | ||||||
}, | ||||||
]} | ||||||
|
@@ -160,29 +171,31 @@ export const CreateEngineFlyout = ({ onClose }: CreateEngineFlyoutProps) => { | |||||
<EuiFlyoutFooter> | ||||||
<EuiFlexGroup> | ||||||
<EuiFlexItem grow={false}> | ||||||
<EuiButtonEmpty | ||||||
<EuiButtonEmptyTo | ||||||
disabled={formDisabled} | ||||||
data-telemetry-id="entSearchContent-engines-createEngine-cancel" | ||||||
onClick={onClose} | ||||||
to={ENGINES_PATH} | ||||||
> | ||||||
{CANCEL_BUTTON_LABEL} | ||||||
</EuiButtonEmpty> | ||||||
</EuiButtonEmptyTo> | ||||||
</EuiFlexItem> | ||||||
<EuiFlexItem /> | ||||||
<EuiFlexItem grow={false}> | ||||||
<EuiButton | ||||||
disabled={createDisabled || formDisabled} | ||||||
<EuiButtonTo | ||||||
isDisabled={createDisabled || formDisabled} | ||||||
data-telemetry-id="entSearchContent-engines-createEngine-submit" | ||||||
fill | ||||||
iconType="plusInCircle" | ||||||
onClick={() => { | ||||||
createEngine(); | ||||||
}} | ||||||
to={ENGINES_PATH} | ||||||
> | ||||||
{i18n.translate('xpack.enterpriseSearch.content.engines.createEngine.submit', { | ||||||
defaultMessage: 'Create this engine', | ||||||
defaultMessage: 'Create this Search Application', | ||||||
})} | ||||||
</EuiButton> | ||||||
</EuiButtonTo> | ||||||
</EuiFlexItem> | ||||||
</EuiFlexGroup> | ||||||
</EuiFlyoutFooter> | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.