Skip to content

Commit

Permalink
[8.0] Add URLs from ui_settings.ts to doc link service (#122408) (#12…
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Jan 11, 2022
1 parent d1a8e03 commit 28275fb
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ readonly links: {
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly kibana: {
readonly guide: string;
readonly autocompleteSuggestions: string;
};
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
Expand All @@ -213,6 +216,7 @@ readonly links: {
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuery: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
Expand Down Expand Up @@ -242,6 +246,7 @@ readonly links: {
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
multiSearch: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
Expand All @@ -250,8 +255,10 @@ readonly links: {
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
searchPreference: string;
simulatePipeline: string;
timeUnits: string;
unfreezeIndex: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class ChromeService {
breadcrumbs$={breadcrumbs$.pipe(takeUntil(this.stop$))}
breadcrumbsAppendExtension$={breadcrumbsAppendExtension$.pipe(takeUntil(this.stop$))}
customNavLink$={customNavLink$.pipe(takeUntil(this.stop$))}
kibanaDocLink={docLinks.links.kibana}
kibanaDocLink={docLinks.links.kibana.guide}
forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()}
helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))}
helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))}
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/doc_links/doc_links_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('DocLinksService#start()', () => {
const service = new DocLinksService();
const api = service.start({ injectedMetadata });
expect(api.DOC_LINK_VERSION).toEqual('test-branch');
expect(api.links.kibana).toEqual(
expect(api.links.kibana.guide).toEqual(
'https://www.elastic.co/guide/en/kibana/test-branch/index.html'
);
});
Expand Down
20 changes: 18 additions & 2 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ export class DocLinksService {
runtimeFields: `${KIBANA_DOCS}managing-data-views.html#runtime-fields`,
},
addData: `${KIBANA_DOCS}connect-to-elasticsearch.html`,
kibana: `${KIBANA_DOCS}index.html`,
kibana: {
guide: `${KIBANA_DOCS}index.html`,
autocompleteSuggestions: `${KIBANA_DOCS}kibana-concepts-analysts.html#autocomplete-suggestions`,
},
upgradeAssistant: {
overview: `${KIBANA_DOCS}upgrade-assistant.html`,
batchReindex: `${KIBANA_DOCS}batch-start-resume-reindex.html`,
Expand Down Expand Up @@ -265,6 +268,7 @@ export class DocLinksService {
mappingJoinFieldsPerformance: `${ELASTICSEARCH_DOCS}parent-join.html#_parent_join_and_performance`,
mappingMeta: `${ELASTICSEARCH_DOCS}mapping-field-meta.html`,
mappingMetaFields: `${ELASTICSEARCH_DOCS}mapping-meta-field.html`,
mappingMultifields: `${ELASTICSEARCH_DOCS}multi-fields.html`,
mappingNormalizer: `${ELASTICSEARCH_DOCS}normalizer.html`,
mappingNorms: `${ELASTICSEARCH_DOCS}norms.html`,
mappingNullValue: `${ELASTICSEARCH_DOCS}null-value.html`,
Expand All @@ -288,6 +292,7 @@ export class DocLinksService {
remoteClusersProxySettings: `${ELASTICSEARCH_DOCS}remote-clusters-settings.html#remote-cluster-proxy-settings`,
scriptParameters: `${ELASTICSEARCH_DOCS}modules-scripting-using.html#prefer-params`,
shardAllocationSettings: `${ELASTICSEARCH_DOCS}modules-cluster.html#cluster-shard-allocation-settings`,
sortSearch: `${ELASTICSEARCH_DOCS}sort-search-results.html`,
transportSettings: `${ELASTICSEARCH_DOCS}modules-network.html#common-network-settings`,
typesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`,
setupUpgrade: `${ELASTICSEARCH_DOCS}setup-upgrade.html`,
Expand All @@ -309,6 +314,7 @@ export class DocLinksService {
query: {
eql: `${ELASTICSEARCH_DOCS}eql.html`,
kueryQuerySyntax: `${KIBANA_DOCS}kuery-query.html`,
luceneQuery: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html`,
luceneQuerySyntax: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`,
percolate: `${ELASTICSEARCH_DOCS}query-dsl-percolate-query.html`,
queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`,
Expand Down Expand Up @@ -464,6 +470,7 @@ export class DocLinksService {
cronExpressions: `${ELASTICSEARCH_DOCS}cron-expressions.html`,
executeWatchActionModes: `${ELASTICSEARCH_DOCS}watcher-api-execute-watch.html#watcher-api-execute-watch-action-mode`,
indexExists: `${ELASTICSEARCH_DOCS}indices-exists.html`,
multiSearch: `${ELASTICSEARCH_DOCS}search-multi-search.html`,
openIndex: `${ELASTICSEARCH_DOCS}indices-open-close.html`,
putComponentTemplate: `${ELASTICSEARCH_DOCS}indices-component-template.html`,
painlessExecute: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-execute-api.html`,
Expand All @@ -473,8 +480,10 @@ export class DocLinksService {
putIndexTemplateV1: `${ELASTICSEARCH_DOCS}indices-templates-v1.html`,
putSnapshotLifecyclePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`,
putWatch: `${ELASTICSEARCH_DOCS}watcher-api-put-watch.html`,
searchPreference: `${ELASTICSEARCH_DOCS}search-search.html#search-preference`,
simulatePipeline: `${ELASTICSEARCH_DOCS}simulate-pipeline-api.html`,
timeUnits: `${ELASTICSEARCH_DOCS}api-conventions.html#time-units`,
unfreezeIndex: `${ELASTICSEARCH_DOCS}unfreeze-index-api.html`,
updateTransform: `${ELASTICSEARCH_DOCS}update-transform.html`,
},
plugins: {
Expand Down Expand Up @@ -771,7 +780,10 @@ export interface DocLinksStart {
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly kibana: {
readonly guide: string;
readonly autocompleteSuggestions: string;
};
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
Expand All @@ -795,6 +807,7 @@ export interface DocLinksStart {
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuery: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
Expand Down Expand Up @@ -824,6 +837,7 @@ export interface DocLinksStart {
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
multiSearch: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
Expand All @@ -832,8 +846,10 @@ export interface DocLinksStart {
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
searchPreference: string;
simulatePipeline: string;
timeUnits: string;
unfreezeIndex: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
Expand Down
9 changes: 8 additions & 1 deletion src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ export interface DocLinksStart {
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly kibana: {
readonly guide: string;
readonly autocompleteSuggestions: string;
};
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
Expand All @@ -684,6 +687,7 @@ export interface DocLinksStart {
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuery: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
Expand Down Expand Up @@ -713,6 +717,7 @@ export interface DocLinksStart {
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
multiSearch: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
Expand All @@ -721,8 +726,10 @@ export interface DocLinksStart {
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
searchPreference: string;
simulatePipeline: string;
timeUnits: string;
unfreezeIndex: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jest.doMock('../../../../../../src/plugins/kibana_react/public', () => ({
uiSettings: { get: jest.fn() },
docLinks: {
links: {
kibana: 'kibana_docs_url',
kibana: {
guide: 'kibana_docs_url',
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const Overview: FC<Props> = ({ newsFetchResult, solutions, features }) =>
}),
},
},
docsLink: docLinks.links.kibana,
docsLink: docLinks.links.kibana.guide,
};

// Show card for console if none of the manage data plugins are available, most likely in OSS
Expand Down

0 comments on commit 28275fb

Please sign in to comment.