Skip to content

Commit

Permalink
[DOCS] Replace settings and help menu links (#565)
Browse files Browse the repository at this point in the history
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:
#335

Will track replacement with:
#335

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla authored Jun 30, 2021
1 parent 0136ce7 commit 570858a
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 19 deletions.
12 changes: 8 additions & 4 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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}`,
},
},
});
Expand Down
4 changes: 3 additions & 1 deletion src/core/server/ui_settings/settings/date_formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ export const getDateFormatSettings = (): Record<string, UiSettingsParams> => {
defaultMessage: 'Used for the {dateNanosLink} datatype of OpenSearch',
values: {
dateNanosLink:
'<a href="https://www.opensearch.org/guide/en/elasticsearch/reference/master/date_nanos.html" target="_blank" rel="noopener noreferrer">' +
// TODO: [RENAMEME] Need prod urls.
// issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864
'<a href="https://docs-beta.opensearch.org/opensearch/units" target="_blank" rel="noopener noreferrer">' +
i18n.translate('core.ui_settings.params.dateNanosLinkTitle', {
defaultMessage: 'date_nanos',
}) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
},
],
});
Expand Down
14 changes: 8 additions & 6 deletions src/plugins/data/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
'data.advancedSettings.query.queryStringOptionsText',
values: {
optionsLink:
'<a href="https://www.opensearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html" target="_blank" rel="noopener">' +
// TODO: [RENAMEME] Need prod urls.
// issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864
'<a href="https://docs-beta.opensearch.org/opensearch/query-dsl/index" target="_blank" rel="noopener">' +
i18n.translate('data.advancedSettings.query.queryStringOptions.optionsLinkText', {
defaultMessage: 'Options',
}) +
Expand Down Expand Up @@ -165,7 +167,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
'data.advancedSettings.sortOptionsText',
values: {
optionsLink:
'<a href="https://www.opensearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html" target="_blank" rel="noopener">' +
'<a href="https://docs-beta.opensearch.org/opensearch/ux/#sort-results" target="_blank" rel="noopener">' +
i18n.translate('data.advancedSettings.sortOptions.optionsLinkText', {
defaultMessage: 'Options',
}) +
Expand Down Expand Up @@ -247,7 +249,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
setRequestReferenceSetting: `<strong>${UI_SETTINGS.COURIER_SET_REQUEST_PREFERENCE}</strong>`,
customSettingValue: '"custom"',
requestPreferenceLink:
'<a href="https://www.opensearch.org/guide/en/elasticsearch/reference/current/search-request-preference.html" target="_blank" rel="noopener">' +
'<a href="https://docs-beta.opensearch.org/opensearch/popular-api" target="_blank" rel="noopener">' +
i18n.translate(
'data.advancedSettings.courier.customRequestPreference.requestPreferenceLinkText',
{
Expand All @@ -271,7 +273,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
'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: `<a href="https://www.opensearch.org/guide/en/elasticsearch/reference/current/search-multi-search.html"
maxRequestsLink: `<a href="https://docs-beta.opensearch.org/opensearch/query-dsl/full-text/#multi-match"
target="_blank" rel="noopener" >max_concurrent_shard_requests</a>`,
},
}),
Expand Down Expand Up @@ -301,7 +303,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
},
[UI_SETTINGS.SEARCH_INCLUDE_FROZEN]: {
name: 'Search in frozen indices',
description: `Will include <a href="https://www.opensearch.org/guide/en/elasticsearch/reference/current/frozen-indices.html"
description: `Will include <a href="https://docs-beta.opensearch.org/opensearch/index-data"
target="_blank" rel="noopener">frozen indices</a> in results if enabled. Searching through frozen indices
might increase the search time.`,
value: false,
Expand Down Expand Up @@ -650,7 +652,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
'data.advancedSettings.timepicker.quickRanges.acceptedFormatsLinkText',
values: {
acceptedFormatsLink:
`<a href="https://www.opensearch.org/guide/en/elasticsearch/reference/current/common-options.html#date-math"
`<a href="https://docs-beta.opensearch.org/opensearch/units"
target="_blank" rel="noopener">` +
i18n.translate('data.advancedSettings.timepicker.quickRanges.acceptedFormatsLinkText', {
defaultMessage: 'accepted formats',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
},
],
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/plugins/maps_legacy/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
'maps_legacy.advancedSettings.visualization.tileMap.maxPrecision.cellDimensionsLinkText',
values: {
cellDimensionsLink:
`<a href="http://www.opensearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html#_cell_dimensions_at_the_equator"
// TODO: [RENAMEME] Need prod urls.
// issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864
`<a href="https://docs-beta.opensearch.org/dashboards/maptiles"
target="_blank" rel="noopener">` +
i18n.translate(
'maps_legacy.advancedSettings.visualization.tileMap.maxPrecision.cellDimensionsLinkText',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ function VegaHelpMenu() {
const items = [
<EuiContextMenuItem
key="vegaHelp"
href="https://www.opensearch.org/guide/en/kibana/master/vega-graph.html"
// TODO: [RENAMEME] Need prod urls.
// issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/335#issuecomment-868294864
href="https://docs-beta.opensearch.org/docs/opensearch-dashboards"
target="_blank"
onClick={closePopover}
>
Expand Down

0 comments on commit 570858a

Please sign in to comment.