From 9ab92883590b06514ff7e5e4ffc3d5a641b1ac42 Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Wed, 30 Jun 2021 11:09:10 -0700 Subject: [PATCH] [DOCS] Replace settings and help menu links (#565) Replacing previous upstream references with working links. This does not fully resolve the current issue due to the link being replaced with a temporary link, and the link directing to related documentation if it exists but some do not so it sends it to the basic OpenSearch Dashboards documentation which is a bad experience but better than a 404. Partially resolves: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335 Will track replacement with: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335 Signed-off-by: Kawika Avilla --- src/core/public/doc_links/doc_links_service.ts | 12 ++++++++---- .../server/ui_settings/settings/date_formats.ts | 4 +++- .../spec_definitions/json/generated/msearch.json | 2 +- .../json/generated/msearch_template.json | 2 +- .../public/application/help_menu/help_menu_util.ts | 4 +++- src/plugins/data/server/ui_settings.ts | 14 ++++++++------ .../context/api/utils/get_opensearch_query_sort.ts | 2 +- .../components/help_menu/help_menu_util.js | 4 +++- .../__snapshots__/empty_state.test.tsx.snap | 2 +- src/plugins/maps_legacy/server/ui_settings.ts | 4 +++- .../public/components/vega_help_menu.tsx | 4 +++- 11 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index b2122cb2380e..909157d93ec5 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -124,9 +124,13 @@ export class DocLinksService { }, indexPatterns: { loadingData: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/tutorial-load-dataset.html`, - introduction: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/index-patterns.html`, + // TODO: [RENAMEME] Need prod urls. + // issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864 + introduction: `${OPENSEARCH_DASHBOARDS_DOCS}`, }, - addData: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/connect-to-elasticsearch.html`, + // TODO: [RENAMEME] Need prod urls. + // issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864 + addData: `${OPENSEARCH_DASHBOARDS_DOCS}`, opensearchDashboards: `${OPENSEARCH_DASHBOARDS_DOCS}`, siem: { guide: `${OPENSEARCH_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/index.html`, @@ -147,8 +151,8 @@ export class DocLinksService { dashboardSettings: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/advanced-options.html#opensearch-dashboard-settings`, }, visualize: { - guide: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/dashboard.html`, - timelineDeprecation: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/dashboard.html#timeline-deprecation`, + guide: `${OPENSEARCH_DASHBOARDS_DOCS}`, + timelineDeprecation: `${OPENSEARCH_DASHBOARDS_DOCS}`, }, }, }); diff --git a/src/core/server/ui_settings/settings/date_formats.ts b/src/core/server/ui_settings/settings/date_formats.ts index 3f2b922d5ca1..e0b28a313c22 100644 --- a/src/core/server/ui_settings/settings/date_formats.ts +++ b/src/core/server/ui_settings/settings/date_formats.ts @@ -168,7 +168,9 @@ export const getDateFormatSettings = (): Record => { defaultMessage: 'Used for the {dateNanosLink} datatype of OpenSearch', values: { dateNanosLink: - '' + + // TODO: [RENAMEME] Need prod urls. + // issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864 + '' + i18n.translate('core.ui_settings.params.dateNanosLinkTitle', { defaultMessage: 'date_nanos', }) + diff --git a/src/plugins/console/server/lib/spec_definitions/json/generated/msearch.json b/src/plugins/console/server/lib/spec_definitions/json/generated/msearch.json index 91a1a1f07875..6901972c9432 100644 --- a/src/plugins/console/server/lib/spec_definitions/json/generated/msearch.json +++ b/src/plugins/console/server/lib/spec_definitions/json/generated/msearch.json @@ -23,6 +23,6 @@ "{indices}/_msearch", "{indices}/{type}/_msearch" ], - "documentation": "https://www.opensearch.org/guide/en/elasticsearch/reference/master/search-multi-search.html" + "documentation": "https://docs-beta.opensearch.org/opensearch/query-dsl/full-text/#multi-match" } } diff --git a/src/plugins/console/server/lib/spec_definitions/json/generated/msearch_template.json b/src/plugins/console/server/lib/spec_definitions/json/generated/msearch_template.json index 4052823b699d..0e1e5d989cff 100644 --- a/src/plugins/console/server/lib/spec_definitions/json/generated/msearch_template.json +++ b/src/plugins/console/server/lib/spec_definitions/json/generated/msearch_template.json @@ -21,6 +21,6 @@ "{indices}/_msearch/template", "{indices}/{type}/_msearch/template" ], - "documentation": "https://www.opensearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html" + "documentation": "https://docs-beta.opensearch.org/opensearch/query-dsl/full-text/#multi-match" } } diff --git a/src/plugins/dashboard/public/application/help_menu/help_menu_util.ts b/src/plugins/dashboard/public/application/help_menu/help_menu_util.ts index 816893d0ef1e..ccc2b56a528d 100644 --- a/src/plugins/dashboard/public/application/help_menu/help_menu_util.ts +++ b/src/plugins/dashboard/public/application/help_menu/help_menu_util.ts @@ -44,7 +44,9 @@ export function addHelpMenuToAppChrome( links: [ { linkType: 'documentation', - href: `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/dashboard.html`, + // TODO: [RENAMEME] Need prod urls. + // issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864 + href: `${docLinks.links.opensearchDashboards}`, }, ], }); diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index ce50ceeb8c4e..97d3a9783f6a 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -106,7 +106,9 @@ export function getUiSettings(): Record> { 'data.advancedSettings.query.queryStringOptionsText', values: { optionsLink: - '' + + // TODO: [RENAMEME] Need prod urls. + // issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864 + '' + i18n.translate('data.advancedSettings.query.queryStringOptions.optionsLinkText', { defaultMessage: 'Options', }) + @@ -165,7 +167,7 @@ export function getUiSettings(): Record> { 'data.advancedSettings.sortOptionsText', values: { optionsLink: - '' + + '' + i18n.translate('data.advancedSettings.sortOptions.optionsLinkText', { defaultMessage: 'Options', }) + @@ -247,7 +249,7 @@ export function getUiSettings(): Record> { setRequestReferenceSetting: `${UI_SETTINGS.COURIER_SET_REQUEST_PREFERENCE}`, customSettingValue: '"custom"', requestPreferenceLink: - '' + + '' + i18n.translate( 'data.advancedSettings.courier.customRequestPreference.requestPreferenceLinkText', { @@ -271,7 +273,7 @@ export function getUiSettings(): Record> { 'Controls the {maxRequestsLink} setting used for _msearch requests sent by OpenSearch Dashboards. ' + 'Set to 0 to disable this config and use the OpenSearch default.', values: { - maxRequestsLink: `max_concurrent_shard_requests`, }, }), @@ -301,7 +303,7 @@ export function getUiSettings(): Record> { }, [UI_SETTINGS.SEARCH_INCLUDE_FROZEN]: { name: 'Search in frozen indices', - description: `Will include frozen indices in results if enabled. Searching through frozen indices might increase the search time.`, value: false, @@ -650,7 +652,7 @@ export function getUiSettings(): Record> { 'data.advancedSettings.timepicker.quickRanges.acceptedFormatsLinkText', values: { acceptedFormatsLink: - `` + i18n.translate('data.advancedSettings.timepicker.quickRanges.acceptedFormatsLinkText', { defaultMessage: 'accepted formats', diff --git a/src/plugins/discover/public/application/angular/context/api/utils/get_opensearch_query_sort.ts b/src/plugins/discover/public/application/angular/context/api/utils/get_opensearch_query_sort.ts index 545073633a20..61e7a71a8842 100644 --- a/src/plugins/discover/public/application/angular/context/api/utils/get_opensearch_query_sort.ts +++ b/src/plugins/discover/public/application/angular/context/api/utils/get_opensearch_query_sort.ts @@ -37,7 +37,7 @@ import { /** * Returns `OpenSearchQuerySort` which is used to sort records in the OpenSearch query - * https://www.opensearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html + * https://docs-beta.opensearch.org/opensearch/ux/#sort-results * @param timeField * @param tieBreakerField * @param sortDir diff --git a/src/plugins/discover/public/application/components/help_menu/help_menu_util.js b/src/plugins/discover/public/application/components/help_menu/help_menu_util.js index 9b7b804a5bca..11ed192cbcdc 100644 --- a/src/plugins/discover/public/application/components/help_menu/help_menu_util.js +++ b/src/plugins/discover/public/application/components/help_menu/help_menu_util.js @@ -42,7 +42,9 @@ export function addHelpMenuToAppChrome(chrome) { links: [ { linkType: 'documentation', - href: `${docLinks.OPENSEARCH_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/discover.html`, + // TODO: [RENAMEME] Need prod urls. + // issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864 + href: `${docLinks.links.opensearchDashboards}`, }, ], }); diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap index 797dedcd6349..81a170942552 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap @@ -103,7 +103,7 @@ exports[`EmptyState should render normally 1`] = ` Object { "description": > { 'maps_legacy.advancedSettings.visualization.tileMap.maxPrecision.cellDimensionsLinkText', values: { cellDimensionsLink: - `` + i18n.translate( 'maps_legacy.advancedSettings.visualization.tileMap.maxPrecision.cellDimensionsLinkText', diff --git a/src/plugins/vis_type_vega/public/components/vega_help_menu.tsx b/src/plugins/vis_type_vega/public/components/vega_help_menu.tsx index 2edafa93534a..17f5b17fe34f 100644 --- a/src/plugins/vis_type_vega/public/components/vega_help_menu.tsx +++ b/src/plugins/vis_type_vega/public/components/vega_help_menu.tsx @@ -54,7 +54,9 @@ function VegaHelpMenu() { const items = [