Skip to content

Commit

Permalink
[Fix] Added documentation link for the dev tools' help menu (#5166)
Browse files Browse the repository at this point in the history
* 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>
(cherry picked from commit 60f4c8f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
github-actions[bot] committed Oct 14, 2023
1 parent 2a31887 commit 85c532b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

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

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/dev_tools/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down Expand Up @@ -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[],
Expand All @@ -265,6 +266,7 @@ export function renderApp(
return () => {};
}

addHelpMenuToAppChrome(chrome, docLinks);
setBadge(application, chrome);
setBreadcrumbs(chrome);
setTitle(chrome);
Expand Down
24 changes: 24 additions & 0 deletions src/plugins/dev_tools/public/utils/util.ts
Original file line number Diff line number Diff line change
@@ -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}`,
},
],
});
}

0 comments on commit 85c532b

Please sign in to comment.