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

Fix broken documentation links in the App Search plugin #198572

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

import { API_DOCS_URL } from '../../../routes';
import { docLinks } from '../../../../shared/doc_links';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not very happy with this import and would prefer to use a property for the component. But considering the number of components to be updated, it would be too long and risky to do it like this.

it will be good enough to fix the issue before 8.16.0 is released and we can revisit it later.


export const EmptyState: React.FC = () => (
<EuiEmptyPrompt
Expand All @@ -31,7 +31,7 @@ export const EmptyState: React.FC = () => (
</p>
}
actions={
<EuiButton size="s" target="_blank" iconType="popout" href={API_DOCS_URL}>
<EuiButton size="s" target="_blank" iconType="popout" href={docLinks.appSearchApis}>
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.apiLogs.empty.buttonLabel', {
defaultMessage: 'View the API reference',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../../shared/doc_links';
import { clearFlashMessages, flashSuccessToast } from '../../../../shared/flash_messages';
import { GenericEndpointInlineEditableTable } from '../../../../shared/tables/generic_endpoint_inline_editable_table';
import { InlineEditableTableColumn } from '../../../../shared/tables/inline_editable_table/types';
import { ItemWithAnID } from '../../../../shared/tables/types';
import { CRAWL_RULES_DOCS_URL } from '../../../routes';
import { CrawlerSingleDomainLogic } from '../crawler_single_domain_logic';
import {
CrawlerPolicies,
Expand All @@ -53,7 +53,7 @@ const DEFAULT_DESCRIPTION = (
defaultMessage="Create a crawl rule to include or exclude pages whose URL matches the rule. Rules run in sequential order, and each URL is evaluated according to the first match. {link}"
values={{
link: (
<EuiLink href={CRAWL_RULES_DOCS_URL} target="_blank" external>
<EuiLink href={docLinks.appSearchCrawlRules} target="_blank" external>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.crawlRulesTable.descriptionLinkText',
{ defaultMessage: 'Learn more about crawl rules' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { EuiSelectableLIOption } from '@elastic/eui/src/components/selectable/se
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { DUPLICATE_DOCS_URL } from '../../../../routes';
import { docLinks } from '../../../../../shared/doc_links';
import { DataPanel } from '../../../data_panel';
import { CrawlerSingleDomainLogic } from '../../crawler_single_domain_logic';

Expand Down Expand Up @@ -84,7 +84,7 @@ export const DeduplicationPanel: React.FC = () => {
documents on this domain. {documentationLink}."
values={{
documentationLink: (
<EuiLink href={DUPLICATE_DOCS_URL} target="_blank" external>
<EuiLink href={docLinks.appSearchDuplicateDocuments} target="_blank" external>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.deduplicationPanel.learnMoreMessage',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { EuiFieldText, EuiLink, EuiSpacer, EuiText, EuiTitle } from '@elastic/eu
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../../shared/doc_links'
import { GenericEndpointInlineEditableTable } from '../../../../shared/tables/generic_endpoint_inline_editable_table';
import { InlineEditableTableColumn } from '../../../../shared/tables/inline_editable_table/types';
import { ItemWithAnID } from '../../../../shared/tables/types';
import { ENTRY_POINTS_DOCS_URL } from '../../../routes';
import { CrawlerDomain, EntryPoint } from '../types';

import { EntryPointsTableLogic } from './entry_points_table_logic';
Expand Down Expand Up @@ -80,7 +80,7 @@ export const EntryPointsTable: React.FC<EntryPointsTableProps> = ({
defaultMessage:
'Include the most important URLs for your website here. Entry point URLs will be the first pages to be indexed and processed for links to other pages.',
})}{' '}
<EuiLink href={ENTRY_POINTS_DOCS_URL} target="_blank" external>
<EuiLink href={docLinks.appSearchEntryPoints} target="_blank" external>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.entryPointsTable.learnMoreLinkText',
{ defaultMessage: 'Learn more about entry points.' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import {
MONTHS_UNIT_LABEL,
WEEKS_UNIT_LABEL,
} from '../../../../../shared/constants/units';
import { docLinks } from '../../../../../shared/doc_links';

import { WEB_CRAWLER_DOCS_URL } from '../../../../routes';
import { CrawlUnits } from '../../types';

import { AutomaticCrawlSchedulerLogic } from './automatic_crawl_scheduler_logic';
Expand Down Expand Up @@ -81,7 +81,7 @@ export const AutomaticCrawlScheduler: React.FC = () => {
defaultMessage="Don't worry about it, we'll start a crawl for you. {readMoreMessage}."
values={{
readMoreMessage: (
<EuiLink href={WEB_CRAWLER_DOCS_URL} target="_blank">
<EuiLink href={docLinks.appSearchWebCrawler} target="_blank">
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.automaticCrawlSchedule.readMoreLink',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiSpacer, EuiText, EuiTitle } from

import { i18n } from '@kbn/i18n';

import { WEB_CRAWLER_DOCS_URL, WEB_CRAWLER_LOG_DOCS_URL } from '../../routes';
import { docLinks } from '../../../shared/doc_links';
import { getEngineBreadcrumbs } from '../engine';
import { AppSearchPageTemplate } from '../layout';

Expand Down Expand Up @@ -82,7 +82,7 @@ export const CrawlerOverview: React.FC = () => {
defaultMessage:
"Easily index your website's content. To get started, enter your domain name, provide optional entry points and crawl rules, and we will handle the rest.",
})}{' '}
<EuiLink external target="_blank" href={WEB_CRAWLER_DOCS_URL}>
<EuiLink external target="_blank" href={docLinks.appSearchWebCrawler}>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.empty.crawlerDocumentationLinkDescription',
{
Expand Down Expand Up @@ -125,7 +125,7 @@ export const CrawlerOverview: React.FC = () => {
defaultMessage:
"Recent crawl requests are logged here. Using the request ID of each crawl, you can track progress and examine crawl events in Kibana's Discover or Logs user interfaces.",
})}{' '}
<EuiLink href={WEB_CRAWLER_LOG_DOCS_URL} target="_blank" external>
<EuiLink href={docLinks.appSearchWebCrawlerEventLogs} target="_blank" external>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.configurationDocumentationLinkDescription',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import { i18n } from '@kbn/i18n';

import { AUTHENTICATION_DOCS_URL } from '../../routes';

export const CREDENTIALS_TITLE = i18n.translate(
'xpack.enterpriseSearch.appSearch.credentials.title',
{ defaultMessage: 'Credentials' }
Expand Down Expand Up @@ -108,5 +106,3 @@ export const TOKEN_TYPE_INFO = [
];

export const FLYOUT_ARIA_LABEL_ID = 'credentialsFlyoutTitle';

export const DOCS_HREF = AUTHENTICATION_DOCS_URL;
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import { useValues, useActions } from 'kea';
import { EuiFormRow, EuiSelect, EuiText, EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { docLinks } from '../../../../../shared/doc_links';

import { AppLogic } from '../../../../app_logic';
import { TOKEN_TYPE_DESCRIPTION, TOKEN_TYPE_INFO, DOCS_HREF } from '../../constants';
import { TOKEN_TYPE_DESCRIPTION, TOKEN_TYPE_INFO } from '../../constants';
import { CredentialsLogic } from '../../credentials_logic';

export const FormKeyType: React.FC = () => {
Expand All @@ -36,7 +38,7 @@ export const FormKeyType: React.FC = () => {
<EuiText size="xs">
<p>
<strong>{tokenDescription}</strong>{' '}
<EuiLink href={DOCS_HREF}>
<EuiLink target="_blank" href={docLinks.appSearchAuthentication}>
{i18n.translate('xpack.enterpriseSearch.appSearch.credentials.documentationLink1', {
defaultMessage: 'Visit the documentation',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
import { i18n } from '@kbn/i18n';

import { EDIT_BUTTON_LABEL, DELETE_BUTTON_LABEL } from '../../../../shared/constants';
import { docLinks } from '../../../../shared/doc_links';
import { HiddenText } from '../../../../shared/hidden_text';
import { convertMetaToPagination, handlePageChange } from '../../../../shared/table_pagination';
import { API_KEYS_DOCS_URL } from '../../../routes';
import { TOKEN_TYPE_DISPLAY_NAMES } from '../constants';
import { CredentialsLogic } from '../credentials_logic';
import { ApiToken } from '../types';
Expand Down Expand Up @@ -141,7 +141,7 @@ export const CredentialsList: React.FC = () => {
defaultMessage: 'Allow applications to access Elastic App Search on your behalf.',
})}
actions={
<EuiButton size="s" target="_blank" iconType="popout" href={API_KEYS_DOCS_URL}>
<EuiButton size="s" target="_blank" iconType="popout" href={docLinks.appSearchApiKeys}>
{i18n.translate('xpack.enterpriseSearch.appSearch.credentials.empty.buttonLabel', {
defaultMessage: 'Learn about API keys',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { CURATIONS_DOCS_URL } from '../../../routes';
import { docLinks } from '../../../../shared/doc_links';

export const EmptyState: React.FC = () => (
<EuiEmptyPrompt
Expand All @@ -33,7 +33,7 @@ export const EmptyState: React.FC = () => (
</p>
}
actions={
<EuiButton size="s" target="_blank" iconType="popout" href={CURATIONS_DOCS_URL}>
<EuiButton size="s" target="_blank" iconType="popout" href={docLinks.appSearchCurations}>
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.curations.empty.buttonLabel', {
defaultMessage: 'Read the curations guide',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import { FormattedMessage } from '@kbn/i18n-react';

import { DocumentCreationLogic } from '..';
import { CANCEL_BUTTON_LABEL } from '../../../../shared/constants';
import { docLinks } from '../../../../shared/doc_links';
import { getEnterpriseSearchUrl } from '../../../../shared/enterprise_search_url';
import { API_CLIENTS_DOCS_URL, INDEXING_DOCS_URL } from '../../../routes';
import { EngineLogic } from '../../engine';
import { EngineDetails } from '../../engine/types';

Expand Down Expand Up @@ -74,12 +74,12 @@ export const FlyoutBody: React.FC = () => {
defaultMessage="The {documentsApiLink} can be used to add new documents to your engine, update documents, retrieve documents by id, and delete documents. There are a variety of {clientLibrariesLink} to help you get started."
values={{
documentsApiLink: (
<EuiLink target="_blank" href={INDEXING_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.appSearchIndexingDocs}>
documents API
</EuiLink>
),
clientLibrariesLink: (
<EuiLink target="_blank" href={API_CLIENTS_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.appSearchApiClients}>
client libraries
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { docLinks } from '../../../shared/doc_links';
import { parseQueryParams } from '../../../shared/query_params';
import { EuiCardTo } from '../../../shared/react_router_helpers';
import { INDEXING_DOCS_URL, ENGINE_CRAWLER_PATH } from '../../routes';
import { ENGINE_CRAWLER_PATH } from '../../routes';
import { generateEnginePath } from '../engine';

import illustration from './illustration.svg';
Expand Down Expand Up @@ -106,7 +107,7 @@ export const DocumentCreationButtons: React.FC<Props> = ({
)}
</span>
</EuiTitle>{' '}
<EuiLink href={INDEXING_DOCS_URL} target="_blank">
<EuiLink href={docLinks.appSearchIndexingDocs} target="_blank">
{i18n.translate(
'xpack.enterpriseSearch.appSearch.documentCreation.buttons.emptyStateFooterLink',
{ defaultMessage: 'Read documentation' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import React from 'react';

import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { INDEXING_DOCS_URL } from '../../../routes';
import { docLinks } from '../../../../shared/doc_links';

export const EmptyState = () => (
<EuiEmptyPrompt
Expand All @@ -32,7 +31,7 @@ export const EmptyState = () => (
</p>
}
actions={
<EuiButton size="s" target="_blank" iconType="popout" href={INDEXING_DOCS_URL}>
<EuiButton size="s" target="_blank" iconType="popout" href={docLinks.appSearchIndexingDocs}>
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.documents.empty.buttonLabel', {
defaultMessage: 'Read the documents guide',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { useValues } from 'kea';
import { EuiButton, EuiEmptyPrompt, EuiImage, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { docLinks } from '../../../shared/doc_links';
import { EuiButtonTo } from '../../../shared/react_router_helpers';
import { DOCS_URL } from '../../routes';
import { DocumentCreationButtons, DocumentCreationFlyout } from '../document_creation';
import illustration from '../document_creation/illustration.svg';

Expand Down Expand Up @@ -85,7 +85,7 @@ export const EmptyEngineOverview: React.FC = () => {
{ defaultMessage: 'Engine setup' }
),
rightSideItems: [
<EuiButton href={DOCS_URL} target="_blank" iconType="popout">
<EuiButton href={docLinks.appSearchGuide} target="_blank" iconType="popout">
{i18n.translate(
'xpack.enterpriseSearch.appSearch.engine.overview.empty.headingAction',
{ defaultMessage: 'View documentation' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { EuiEmptyPrompt, EuiButton } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { META_ENGINES_DOCS_URL } from '../../../routes';
import { docLinks } from '../../../../shared/doc_links';

export const EmptyMetaEnginesState: React.FC = () => (
<EuiEmptyPrompt
Expand All @@ -34,7 +34,7 @@ export const EmptyMetaEnginesState: React.FC = () => (
</p>
}
actions={
<EuiButton size="s" target="_blank" iconType="popout" href={META_ENGINES_DOCS_URL}>
<EuiButton size="s" target="_blank" iconType="popout" href={docLinks.appSearchMetaEngines}>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.engines.metaEngines.emptyPromptButtonLabel',
{ defaultMessage: 'Learn more about meta engines' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { META_ENGINES_DOCS_URL } from '../../routes';
import { docLinks } from '../../../shared/doc_links';

export const DEFAULT_LANGUAGE = 'Universal';

Expand Down Expand Up @@ -57,7 +57,7 @@ export const META_ENGINE_CREATION_FORM_DOCUMENTATION_DESCRIPTION = (
defaultMessage="{documentationLink} for information about how to get started."
values={{
documentationLink: (
<EuiLink href={META_ENGINES_DOCS_URL} target="_blank">
<EuiLink href={docLinks.appSearchMetaEngines} target="_blank">
{META_ENGINE_CREATION_FORM_DOCUMENTATION_LINK}
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { RELEVANCE_DOCS_URL } from '../../../routes';
import { docLinks } from '../../../../shared/doc_links';

export const EmptyState: React.FC = () => (
<EuiEmptyPrompt
Expand All @@ -30,7 +30,7 @@ export const EmptyState: React.FC = () => (
}
)}
actions={
<EuiButton size="s" target="_blank" iconType="popout" href={RELEVANCE_DOCS_URL}>
<EuiButton size="s" target="_blank" iconType="popout" href={docLinks.appSearchRelevance}>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.empty.buttonLabel',
{ defaultMessage: 'Read the relevance tuning guide' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { PRECISION_DOCS_URL } from '../../../../routes';
import { docLinks } from '../../../../../shared/doc_links';
import { RelevanceTuningLogic } from '../../relevance_tuning_logic';

import { STEP_DESCRIPTIONS } from './constants';
Expand Down Expand Up @@ -57,7 +57,7 @@ export const PrecisionSlider: React.FC = () => {
defaultMessage: 'Fine tune the precision vs. recall settings on your engine.',
}
)}{' '}
<EuiLink data-test-subj="documentationLink" href={PRECISION_DOCS_URL} target="_blank">
<EuiLink data-test-subj="documentationLink" href={docLinks.appSearchPrecision} target="_blank">
{i18n.translate(
'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.learnMore.link',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import { EuiCallOut, EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../shared/doc_links';
import { EuiLinkTo } from '../../../shared/react_router_helpers';
import { META_ENGINES_DOCS_URL, ENGINE_SCHEMA_PATH } from '../../routes';
import { ENGINE_SCHEMA_PATH } from '../../routes';
import { EngineLogic, generateEnginePath } from '../engine';

import { RelevanceTuningLogic } from '.';
Expand Down Expand Up @@ -98,7 +99,7 @@ export const RelevanceTuningCallouts: React.FC = () => {
values={{
schemaFieldsWithConflictsCount,
link: (
<EuiLink href={META_ENGINES_DOCS_URL} target="_blank">
<EuiLink href={docLinks.appSearchMetaEngines} target="_blank">
{i18n.translate(
'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.whatsThisLinkLabel',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import React from 'react';
import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { RESULT_SETTINGS_DOCS_URL } from '../../../routes';

import { docLinks } from '../../../../shared/doc_links';

export const EmptyState: React.FC = () => (
<EuiEmptyPrompt
Expand All @@ -30,7 +31,7 @@ export const EmptyState: React.FC = () => (
}
)}
actions={
<EuiButton size="s" target="_blank" iconType="popout" href={RESULT_SETTINGS_DOCS_URL}>
<EuiButton size="s" target="_blank" iconType="popout" href={docLinks.appSearchResultSettings}>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.engine.resultSettings.empty.buttonLabel',
{ defaultMessage: 'Read the result settings guide' }
Expand Down
Loading