diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b0d15b785e9..44fbb42e834e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [BUG][Data Explorer][Discover] Allow filter and query persist when refresh page or paste url to a new tab ([#5206](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5206)) - [Data Explorer] Remove the `X` icon in data source selection field ([#5238](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5238)) - [BUG][Fuctional Test] Make setDefaultAbsoluteRange more robust and update doc views tests ([#5242](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5242)) +- [BUG][Dev Tool] Add dev tool documentation link to dev tool's help menu [#5166](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5166) ### 🚞 Infrastructure diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 7dd8c6561ade..0acf4524ab14 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -388,6 +388,8 @@ export class DocLinksService { ganttCharts: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}gantt`, // https://opensearch.org/docs/latest/dashboards/reporting/ reporting: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}reporting`, + // https://opensearch.org/docs/latest/dashboards/dev-tools/index-dev/ + devTools: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}dev-tools/index-dev/`, notebooks: { // https://opensearch.org/docs/latest/dashboards/notebooks/ base: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}notebooks`, diff --git a/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap b/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap index 1b3c486615c8..848106a7fba3 100644 --- a/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap +++ b/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap @@ -794,6 +794,7 @@ exports[`dashboard listing hideWriteControls 1`] = ` "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -1886,6 +1887,7 @@ exports[`dashboard listing render table listing with initial filters from URL 1` "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -3039,6 +3041,7 @@ exports[`dashboard listing renders call to action when no dashboards exist 1`] = "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -4192,6 +4195,7 @@ exports[`dashboard listing renders table rows 1`] = ` "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -5345,6 +5349,7 @@ exports[`dashboard listing renders warning when listingLimit is exceeded 1`] = ` "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", diff --git a/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap b/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap index 101e0e520304..b0f1abee686a 100644 --- a/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap +++ b/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap @@ -686,6 +686,7 @@ exports[`Dashboard top nav render in embed mode 1`] = ` "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -1603,6 +1604,7 @@ exports[`Dashboard top nav render in embed mode, and force hide filter bar 1`] = "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -2520,6 +2522,7 @@ exports[`Dashboard top nav render in embed mode, components can be forced show b "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -3437,6 +3440,7 @@ exports[`Dashboard top nav render in full screen mode with appended URL param bu "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -4354,6 +4358,7 @@ exports[`Dashboard top nav render in full screen mode, no componenets should be "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", @@ -5271,6 +5276,7 @@ exports[`Dashboard top nav render with all components 1`] = ` "dataSource": Object { "guide": "https://opensearch.org/docs/mocked-test-branch/dashboards/discover/multi-data-sources/", }, + "devTools": "https://opensearch.org/docs/mocked-test-branch/dashboards/dev-tools/index-dev/", "dql": Object { "base": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql", "boolean_query": "https://opensearch.org/docs/mocked-test-branch/dashboards/dql/#boolean-query", diff --git a/src/plugins/dev_tools/public/application.tsx b/src/plugins/dev_tools/public/application.tsx index 8c1c936de646..3b2a8d78ccd6 100644 --- a/src/plugins/dev_tools/public/application.tsx +++ b/src/plugins/dev_tools/public/application.tsx @@ -57,6 +57,7 @@ import { useEffectOnce } from 'react-use'; import { getDataSources } from '../../data_source_management/public/components/utils'; import { DevToolApp } from './dev_tool'; import { DevToolsSetupDependencies } from './plugin'; +import { addHelpMenuToAppChrome } from './utils/util'; interface DevToolsWrapperProps { devTools: readonly DevToolApp[]; @@ -254,7 +255,7 @@ function setBreadcrumbs(chrome: ChromeStart) { } export function renderApp( - { application, chrome, savedObjects, notifications }: CoreStart, + { application, chrome, docLinks, savedObjects, notifications }: CoreStart, element: HTMLElement, history: ScopedHistory, devTools: readonly DevToolApp[], @@ -265,6 +266,7 @@ export function renderApp( return () => {}; } + addHelpMenuToAppChrome(chrome, docLinks); setBadge(application, chrome); setBreadcrumbs(chrome); setTitle(chrome); diff --git a/src/plugins/dev_tools/public/utils/util.ts b/src/plugins/dev_tools/public/utils/util.ts new file mode 100644 index 000000000000..7738e84bd15f --- /dev/null +++ b/src/plugins/dev_tools/public/utils/util.ts @@ -0,0 +1,24 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { i18n } from '@osd/i18n'; +import { CoreStart } from 'opensearch-dashboards/public'; + +export function addHelpMenuToAppChrome( + chrome: CoreStart['chrome'], + docLinks: CoreStart['docLinks'] +) { + chrome.setHelpExtension({ + appName: i18n.translate('devTools.helpMenu.appName', { + defaultMessage: 'Dev Tools', + }), + links: [ + { + linkType: 'documentation', + href: `${docLinks.links.opensearchDashboards.devTools}`, + }, + ], + }); +}