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

[Enterprise Search][Search Application] Update engines to be search application #155299

Merged
merged 16 commits into from
Apr 21, 2023

Conversation

saarikabhasi
Copy link
Member

@saarikabhasi saarikabhasi commented Apr 19, 2023

Summary

  • Update "engines" to be "Search Application" in UI
  • Navigate to Search application from indices page rather than app search engine
  • Pre-select index and open Create Search Application Flyout when navigated from Index page
demo.mov

Checklist

Delete any items that are not applicable to this PR.

@saarikabhasi saarikabhasi changed the title Search app rename [Search Application] Update engines to be search application Apr 19, 2023
@saarikabhasi saarikabhasi changed the title [Search Application] Update engines to be search application [Enterprise Search][Search Application] Update engines to be search application Apr 19, 2023
@saarikabhasi saarikabhasi marked this pull request as ready for review April 19, 2023 17:09
@saarikabhasi saarikabhasi requested a review from a team April 19, 2023 17:09

export const EnginesList: React.FC = () => {
export const EnginesList: React.FC<ListProps> = ({ isCreateEngineFlyoutOpen }) => {
Copy link
Member Author

@saarikabhasi saarikabhasi Apr 19, 2023

Choose a reason for hiding this comment

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

Without this new prop ListProps , When create search app flyout is open ( instantiated from indices page ) doesn't redirect to engine list page after successfully creating search application.
Adding this optional isCreateEngineFlyoutOpen helped with that.

This was the best solution I could come up with. So looking for better alternative if any!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the right solution to control the flyout being open via URL instead of using state.

onClick={openEngineCreate}
to={ENGINE_CREATION_PATH}
Copy link
Member Author

Choose a reason for hiding this comment

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

Replaced EuiButton to EuiButtonTo in create search application buttons to help with redirecting route to /new route path

@@ -56,16 +55,8 @@ export const BUILD_SEARCH_EXPERIENCE_STEP: EuiContainedStepProps = {
<p>
<FormattedMessage
id="xpack.enterpriseSearch.content.newIndex.steps.buildSearchExperience.content"
defaultMessage="After building your connector, your content is ready. Build your first search experience with {elasticsearchLink}, or explore the search experience tools provided by {appSearchLink}. We recommend that you create a {searchEngineLink} for the best balance of flexible power and turnkey simplicity."
defaultMessage="After building your connector, your content is ready to create a {searchApplicationLink} with {elasticsearchLink}."
Copy link
Member Author

@saarikabhasi saarikabhasi Apr 19, 2023

Choose a reason for hiding this comment

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

@julianrosado FYI I think this page will not exist when new redesign PR is merged. Added these changes in this PR, just in case


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',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultMessage: 'Create an Search Application',
defaultMessage: 'Create a Search Application',

@@ -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!"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultMessage="An Search Application allows your users to query data in your indices. Explore our {enginesDocsLink} to learn more!"
defaultMessage="A Search Application allows your users to query data in your indices. Explore our {enginesDocsLink} to learn more!"


export const EnginesList: React.FC = () => {
export const EnginesList: React.FC<ListProps> = ({ isCreateEngineFlyoutOpen }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the right solution to control the flyout being open via URL instead of using state.

@@ -139,6 +148,9 @@ export const EnginesList: React.FC = () => {
if (!isGated) {
setIsFirstRequest();
}
if (!!isCreateEngineFlyoutOpen) {
openEngineCreate();
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should be needed. We should just be able to render the Flyout with isOpen if isCreateEngineFlyoutOpen

We should be able to remove openEngineCreate and the state in the logic completely.
We would also remove closeEngineCreate and just navigate to the list URL or to the engine on create being completed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll work on removing the state in the logic completely

searchEngineLink: (
<EuiLinkTo to={`${APP_SEARCH_URL}/engines/new`} shouldNotCreateHref>
searchApplicationLink: (
<EuiLink onClick={() => KibanaLogic.values.navigateToUrl(ENGINES_PATH)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

we could continue to use to if we do ${ENTERPRISE_SEARCH_CONTENT_PLUGIN.URL}${ENGINES_PATH}

defaultMessage: 'Search Applications',
}),
]}
pageHeader={{
description: (
<FormattedMessage
id="xpack.enterpriseSearch.content.engines.description"
id="xpack.enterpriseSearch.content.searchApplications.description"
defaultMessage="Search Applications allow you to query indexed data with a complete set of relevance, analytics and personalization tools. To learn more about how engines work in Enterprise search {documentationUrl}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultMessage="Search Applications allow you to query indexed data with a complete set of relevance, analytics and personalization tools. To learn more about how engines work in Enterprise search {documentationUrl}"
defaultMessage="Search Applications allow you to query indexed data with a complete set of relevance, analytics and personalization tools. To learn more about how Search Applications work in Enterprise search {documentationUrl}"

{
defaultMessage: 'Locate an engine via name or by its included indices.',
defaultMessage:
'Locate an search application via name or by its included indices.',
Copy link
Contributor

@leemthompo leemthompo Apr 20, 2023

Choose a reason for hiding this comment

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

Suggested change
'Locate an search application via name or by its included indices.',
'Find a search application by name or by an index it includes.',

{i18n.translate(
'xpack.enterpriseSearch.content.index.searchApplication.createSearchApplication',
{
defaultMessage: 'Create an Search Application',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultMessage: 'Create an Search Application',
defaultMessage: 'Create a Search Application',

</EuiButtonTo>
</div>
}
>
<EuiPopoverTitle>
<FormattedMessage
id="xpack.enterpriseSearch.content.engines.createEngineDisabledPopover.title"
id="xpack.enterpriseSearch.content.searchApplications.createEngineDisabledPopover.title"
Copy link
Member Author

Choose a reason for hiding this comment

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

Question: Should I continue including these translation changes in this PR ?

NAV_TITLE: i18n.translate('xpack.enterpriseSearch.engines.navTitle', {
defaultMessage: 'Engines',
NAV_TITLE: i18n.translate('xpack.enterpriseSearch.applications.navTitle', {
defaultMessage: 'Applications',
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed the breadcrumb to Applications

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.3MB 2.3MB +137.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
enterpriseSearch 31.0KB 30.9KB -62.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 394 397 +3

Total ESLint disabled count

id before after diff
securitySolution 474 477 +3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

});
},
engineCreated: () => {
actions.fetchEngines();
actions.closeEngineCreate();
KibanaLogic.values.navigateToUrl(ENGINES_PATH);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed in this PR but we should check with Product and see if we should navigate to the Search Application (Preview) on create.

IMO that would be better UX. since if you have a lot of applications it might be annoying to find the new one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. Agree with you 💯

@saarikabhasi saarikabhasi merged commit d32c867 into elastic:main Apr 21, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 21, 2023
@saarikabhasi saarikabhasi deleted the search-app-rename branch April 21, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants