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

[Fix] Added documentation link for the dev tools' help menu #5166

Merged
merged 9 commits into from
Oct 14, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
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 @@
/*
willie-hung marked this conversation as resolved.
Show resolved Hide resolved
* 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