Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] [Fix] Added documentation link for the dev tools' help menu #5302

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}`,
},
],
});
}
Loading