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 <[email protected]>

* Add CHANGELOG

Signed-off-by: Willie Hung <[email protected]>

* Edit CHANGELOG message

Signed-off-by: Willie Hung <[email protected]>

* Edit CHANGELOG message

Signed-off-by: Willie Hung <[email protected]>

* Changed new file copyright license

Signed-off-by: Willie Hung <[email protected]>

* Update new snapshots

Signed-off-by: Willie Hung <[email protected]>

---------

Signed-off-by: Willie Hung <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
  • Loading branch information
willie-hung and ashwin-pc authored Oct 14, 2023
1 parent 7a964b6 commit 60f4c8f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
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 @@
/*
* 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 60f4c8f

Please sign in to comment.