Skip to content

Commit 60f4c8f

Browse files
[Fix] Added documentation link for the dev tools' help menu (#5166)
* Add documentation link to dev tool's help menu Signed-off-by: Willie Hung <willie880201044@gmail.com> * Add CHANGELOG Signed-off-by: Willie Hung <willie880201044@gmail.com> * Edit CHANGELOG message Signed-off-by: Willie Hung <willie880201044@gmail.com> * Edit CHANGELOG message Signed-off-by: Willie Hung <willie880201044@gmail.com> * Changed new file copyright license Signed-off-by: Willie Hung <willie880201044@gmail.com> * Update new snapshots Signed-off-by: Willie Hung <willie880201044@gmail.com> --------- Signed-off-by: Willie Hung <willie880201044@gmail.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
1 parent 7a964b6 commit 60f4c8f

File tree

6 files changed

+41
-1
lines changed

6 files changed

+41
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6868
- [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))
6969
- [Data Explorer] Remove the `X` icon in data source selection field ([#5238](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5238))
7070
- [BUG][Fuctional Test] Make setDefaultAbsoluteRange more robust and update doc views tests ([#5242](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5242))
71+
- [BUG][Dev Tool] Add dev tool documentation link to dev tool's help menu [#5166](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5166)
7172

7273
### 🚞 Infrastructure
7374

src/core/public/doc_links/doc_links_service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ export class DocLinksService {
388388
ganttCharts: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}gantt`,
389389
// https://opensearch.org/docs/latest/dashboards/reporting/
390390
reporting: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}reporting`,
391+
// https://opensearch.org/docs/latest/dashboards/dev-tools/index-dev/
392+
devTools: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}dev-tools/index-dev/`,
391393
notebooks: {
392394
// https://opensearch.org/docs/latest/dashboards/notebooks/
393395
base: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}notebooks`,

src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/dev_tools/public/application.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import { useEffectOnce } from 'react-use';
5757
import { getDataSources } from '../../data_source_management/public/components/utils';
5858
import { DevToolApp } from './dev_tool';
5959
import { DevToolsSetupDependencies } from './plugin';
60+
import { addHelpMenuToAppChrome } from './utils/util';
6061

6162
interface DevToolsWrapperProps {
6263
devTools: readonly DevToolApp[];
@@ -254,7 +255,7 @@ function setBreadcrumbs(chrome: ChromeStart) {
254255
}
255256

256257
export function renderApp(
257-
{ application, chrome, savedObjects, notifications }: CoreStart,
258+
{ application, chrome, docLinks, savedObjects, notifications }: CoreStart,
258259
element: HTMLElement,
259260
history: ScopedHistory,
260261
devTools: readonly DevToolApp[],
@@ -265,6 +266,7 @@ export function renderApp(
265266
return () => {};
266267
}
267268

269+
addHelpMenuToAppChrome(chrome, docLinks);
268270
setBadge(application, chrome);
269271
setBreadcrumbs(chrome);
270272
setTitle(chrome);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
import { i18n } from '@osd/i18n';
7+
import { CoreStart } from 'opensearch-dashboards/public';
8+
9+
export function addHelpMenuToAppChrome(
10+
chrome: CoreStart['chrome'],
11+
docLinks: CoreStart['docLinks']
12+
) {
13+
chrome.setHelpExtension({
14+
appName: i18n.translate('devTools.helpMenu.appName', {
15+
defaultMessage: 'Dev Tools',
16+
}),
17+
links: [
18+
{
19+
linkType: 'documentation',
20+
href: `${docLinks.links.opensearchDashboards.devTools}`,
21+
},
22+
],
23+
});
24+
}

0 commit comments

Comments
 (0)