-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor-controls-services_2022-08-10
- Loading branch information
Showing
36 changed files
with
416 additions
and
1,166 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
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
63 changes: 63 additions & 0 deletions
63
...rch_content/components/search_index/components/header_actions/create_engine_menu_item.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,63 @@ | ||
/* | ||
* 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 { EuiBetaBadge, EuiContextMenuItem, EuiText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { APP_SEARCH_PLUGIN } from '../../../../../../../common/constants'; | ||
import { ENGINE_CREATION_PATH } from '../../../../../app_search/routes'; | ||
import { ESINDEX_QUERY_PARAMETER } from '../../../../../shared/constants'; | ||
import { generateEncodedPath } from '../../../../../shared/encode_path_params'; | ||
import { KibanaLogic } from '../../../../../shared/kibana'; | ||
|
||
export interface CreateEngineMenuItemProps { | ||
indexName?: string; | ||
isHiddenIndex?: boolean; | ||
} | ||
|
||
export const CreateEngineMenuItem: React.FC<CreateEngineMenuItemProps> = ({ | ||
indexName, | ||
isHiddenIndex, | ||
}) => { | ||
const engineCreationPath = !indexName | ||
? `${APP_SEARCH_PLUGIN.URL}${ENGINE_CREATION_PATH}` | ||
: generateEncodedPath(`${APP_SEARCH_PLUGIN.URL}${ENGINE_CREATION_PATH}?:indexKey=:indexName`, { | ||
indexKey: ESINDEX_QUERY_PARAMETER, | ||
indexName, | ||
}); | ||
|
||
return ( | ||
<EuiFlexGroup alignItems="center" gutterSize="xs"> | ||
<EuiFlexItem> | ||
<EuiContextMenuItem | ||
size="s" | ||
icon="plusInCircle" | ||
onClick={() => { | ||
KibanaLogic.values.navigateToUrl(engineCreationPath, { | ||
shouldNotCreateHref: true, | ||
}); | ||
}} | ||
disabled={isHiddenIndex} | ||
> | ||
<EuiText> | ||
<p> | ||
{i18n.translate('xpack.enterpriseSearch.content.index.searchEngines.createEngine', { | ||
defaultMessage: 'Create an App Search engine', | ||
})} | ||
</p> | ||
</EuiText> | ||
</EuiContextMenuItem> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false} style={{ paddingTop: '.125rem' }}> | ||
<EuiBetaBadge label="Beta" size="s" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; |
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
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/enterprise_search/public/applications/shared/constants/query_params.ts
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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const ESINDEX_QUERY_PARAMETER = 'esindex'; |
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.