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

Add Elasticsearch guide #128190

Merged
merged 45 commits into from
Mar 29, 2022
Merged

Conversation

yakhinvadim
Copy link
Contributor

@yakhinvadim yakhinvadim commented Mar 21, 2022

Summary

This PR adds a new page to the Enterprise Search app with Elasticsearch guide:

image

And a new panel to get to this page:

image

The PR is quite big, but 90% of the code is just plain HTML built with EUI components. I recommend reviewing the whole diff and not look at individual commits.

Several things are intentionally skipped:

  • i18n for language clients (folder elasticsearch_client_instructions). It would be a huge lift to translate all these instructions, but the value is going to be low, because all the language clients docs are in English anyway.
  • Tests for most components. We will add tests in a separate PR, the goal right now is to merge the main functionality before the FF.
  • There was a bug where navigating to page keeps the scroll position. I addressed this by doing scroll(0,0) in useEffect, but probably more centralized Enterpise Search-wide solution is needed.

Checklist

@yakhinvadim yakhinvadim changed the title Add basic elasticsearch card and page Add Elasticsearch guide Mar 24, 2022
@yakhinvadim

This comment was marked as outdated.

@yakhinvadim

This comment was marked as outdated.

@yakhinvadim yakhinvadim marked this pull request as ready for review March 26, 2022 17:12
@yakhinvadim yakhinvadim requested review from a team and scottybollinger March 26, 2022 17:12
const client = queryString.parse(window.location.search).client;
const languageExists = languages.some((language) => language.value === client);
const [selectedLanguage, setSelectedLanguage] = useState(
languageExists ? (client as string) : 'java'
Copy link
Member

Choose a reason for hiding this comment

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

I suggest moving the string cast to line 44

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, nice catch, useState should usually be higher. But in this case, it seems necessary, because I'm using the languageExists variable that I define above. Or did I misunderstand something?

Copy link
Contributor

@scottybollinger scottybollinger left a comment

Choose a reason for hiding this comment

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

Few minor changes. Thanks for helping out with this!

<EuiText size="s">
{i18n.translate('xpack.enterpriseSearch.overview.elasticsearchCard.description', {
defaultMessage:
'Design and build performant, relevant search-powered application or large-scale search implementations directly in Elasticsearch',
Copy link
Contributor

Choose a reason for hiding this comment

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

We either need to make this change...

Suggested change
'Design and build performant, relevant search-powered application or large-scale search implementations directly in Elasticsearch',
'Design and build a performant, relevant search-powered application or large-scale search implementations directly in Elasticsearch',

...or make "applications" plural:

Suggested change
'Design and build performant, relevant search-powered application or large-scale search implementations directly in Elasticsearch',
'Design and build performant, relevant search-powered applications or large-scale search implementations directly in Elasticsearch',

<div>
<EuiButtonTo to={ELASTICSEARCH_GUIDE_PATH}>
{i18n.translate('xpack.enterpriseSearch.overview.elasticsearchCard.button', {
defaultMessage: 'Get Started',
Copy link
Contributor

Choose a reason for hiding this comment

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

To be consistent with our writing guidelines, this should be:

Suggested change
defaultMessage: 'Get Started',
defaultMessage: 'Get started',

</ul>
<EuiLink
target="_blank"
href="https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/introduction.html"
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use the docsLink service for these URLs. It will future-proof these in case the URLs change. This goes for all links in this PR that start with https://www.elastic.co/guide/en/.

{i18n.translate(
'xpack.enterpriseSearch.overview.elasticsearchCloudId.manageApiKeysLink',
{
defaultMessage: 'Manage API Keys',
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: 'Manage API Keys',
defaultMessage: 'Manage API keys',

@yakhinvadim yakhinvadim requested a review from a team as a code owner March 28, 2022 22:15
Copy link
Contributor

@scottybollinger scottybollinger left a comment

Choose a reason for hiding this comment

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

Changes LGTM, pending CI

Vadim Yakhin added 2 commits March 28, 2022 15:39
Looks like it was fixed in `master`, but not in `current` docs. Since the PR is going to master, we could use the corrected link
Copy link
Contributor

@lcawl lcawl left a comment

Choose a reason for hiding this comment

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

The additions in kbn-doc-links LGTM

@yakhinvadim yakhinvadim enabled auto-merge (squash) March 28, 2022 23:21
@yakhinvadim yakhinvadim merged commit ecd2a50 into elastic:main Mar 29, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1403 1421 +18

Async chunks

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

id before after diff
enterpriseSearch 1.4MB 1.4MB +37.9KB

Page load bundle

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

id before after diff
core 296.5KB 297.9KB +1.4KB
enterpriseSearch 17.2KB 19.9KB +2.7KB
total +4.1KB

History

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

@kibanamachine
Copy link
Contributor

⚪ Backport skipped

The pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually.

Manual backport

To create the backport manually run:

node scripts/backport --pr 128190

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 31, 2022
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 128190 or prevent reminders by adding the backport:skip label.

@yakhinvadim yakhinvadim added the backport:skip This commit does not require backporting label Mar 31, 2022
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 31, 2022
@yakhinvadim yakhinvadim removed auto-backport Deprecated - use backport:version if exact versions are needed v8.2.0 labels Mar 31, 2022
@tylersmalley tylersmalley added ci:cloud-deploy Create or update a Cloud deployment and removed ci:deploy-cloud labels Aug 17, 2022
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 ci:cloud-deploy Create or update a Cloud deployment release_note:skip Skip the PR/issue when compiling release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants