Skip to content

Commit

Permalink
[App Search] Version documentation links (#83245)
Browse files Browse the repository at this point in the history
* Fix CURRENT_MAJOR_VERSION for use in Elastic docs links

- Was previously just sending (e.g.) "7". instead of "7.9"

* Add App Search DOCS_PREFIX constant

- follow WS's example

* Update all App Search doc links to use prefixed URLs

- except for Enterprise Search setup guide, which should be updated to use a shared URL at some point in any case
  • Loading branch information
Constance authored Nov 12, 2020
1 parent eaa6553 commit bd99b19
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/enterprise_search/common/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ import { SemVer } from 'semver';
import pkg from '../../../../package.json';

export const CURRENT_VERSION = new SemVer(pkg.version as string);
export const CURRENT_MAJOR_VERSION = CURRENT_VERSION.major;
export const CURRENT_MAJOR_VERSION = `${CURRENT_VERSION.major}.${CURRENT_VERSION.minor}`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

import { i18n } from '@kbn/i18n';
import { DOCS_PREFIX } from '../../routes';

export const CREDENTIALS_TITLE = i18n.translate(
'xpack.enterpriseSearch.appSearch.credentials.title',
Expand Down Expand Up @@ -100,4 +101,4 @@ export const TOKEN_TYPE_INFO = [

export const FLYOUT_ARIA_LABEL_ID = 'credentialsFlyoutTitle';

export const DOCS_HREF = 'https://www.elastic.co/guide/en/app-search/current/authentication.html';
export const DOCS_HREF = `${DOCS_PREFIX}/authentication.html`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { i18n } from '@kbn/i18n';
import { EuiLink, EuiSpacer, EuiSwitch, EuiText, EuiTextColor, EuiTitle } from '@elastic/eui';
import { useActions, useValues } from 'kea';

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

import { LogRetentionLogic } from './log_retention_logic';
import { AnalyticsLogRetentionMessage, ApiLogRetentionMessage } from './messaging';
import { LogRetentionOptions } from './types';
Expand Down Expand Up @@ -41,10 +43,7 @@ export const LogRetentionPanel: React.FC = () => {
{i18n.translate('xpack.enterpriseSearch.appSearch.settings.logRetention.description', {
defaultMessage: 'Manage the default write settings for API Logs and Analytics.',
})}{' '}
<EuiLink
href="https://www.elastic.co/guide/en/app-search/current/logs.html"
target="_blank"
>
<EuiLink href={`${DOCS_PREFIX}/logs.html`} target="_blank">
{i18n.translate('xpack.enterpriseSearch.appSearch.settings.logRetention.learnMore', {
defaultMessage: 'Learn more about retention settings.',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import { APP_SEARCH_PLUGIN } from '../../../../../common/constants';
import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide';
import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
import { DOCS_PREFIX } from '../../routes';
import GettingStarted from './assets/getting_started.png';

export const SetupGuide: React.FC = () => (
<SetupGuideLayout
productName={APP_SEARCH_PLUGIN.NAME}
productEuiIcon="logoAppSearch"
standardAuthLink="https://www.elastic.co/guide/en/app-search/current/security-and-users.html#app-search-self-managed-security-and-user-management-standard"
elasticsearchNativeAuthLink="https://www.elastic.co/guide/en/app-search/current/security-and-users.html#app-search-self-managed-security-and-user-management-elasticsearch-native-realm"
standardAuthLink={`${DOCS_PREFIX}/security-and-users.html#app-search-self-managed-security-and-user-management-standard`}
elasticsearchNativeAuthLink={`${DOCS_PREFIX}/security-and-users.html#app-search-self-managed-security-and-user-management-elasticsearch-native-realm`}
>
<SetPageChrome
trail={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

import { generatePath } from 'react-router-dom';

import { CURRENT_MAJOR_VERSION } from '../../../common/version';

export const DOCS_PREFIX = `https://www.elastic.co/guide/en/app-search/${CURRENT_MAJOR_VERSION}`;

export const ROOT_PATH = '/';
export const SETUP_GUIDE_PATH = '/setup_guide';
export const SETTINGS_PATH = '/settings/account';
Expand Down

0 comments on commit bd99b19

Please sign in to comment.