forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New management overview page and rename stack management to dashboard…
… management (opensearch-project#4287) Support navigation changes for administrative features. This change includes * Rename stack management to Dashboard management * Add new management overview page * Replace Stack Management to Management overview page on home app categories page * Make home plugin optional for managemnet overview Issue Resolved: opensearch-project#4132 --------- Signed-off-by: Hailong Cui <[email protected]> Co-authored-by: Josh Romero <[email protected]> Co-authored-by: Ashwin P Chandran <[email protected]>
- Loading branch information
1 parent
24bde32
commit d8f0c48
Showing
27 changed files
with
365 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.mgtSideBarNav { | ||
width: 210px; | ||
width: 220px; | ||
margin-right: $euiSize; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const MANAGEMENT_OVERVIEW_PLUGIN_ID = 'opensearch_management_overview'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"id": "managementOverview", | ||
"version": "opensearchDashboards", | ||
"ui": true, | ||
"server": false, | ||
"requiredPlugins": ["navigation"], | ||
"optionalPlugins": ["home"], | ||
"requiredBundles": ["home"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import ReactDOM from 'react-dom'; | ||
import { I18nProvider, FormattedMessage } from '@osd/i18n/react'; | ||
import React from 'react'; | ||
import { EuiFlexGrid, EuiFlexItem, EuiPage, EuiPageBody, EuiSpacer, EuiTitle } from '@elastic/eui'; | ||
import useObservable from 'react-use/lib/useObservable'; | ||
import { ApplicationStart, ChromeStart, CoreStart } from '../../../core/public'; | ||
import { OverviewApp } from '.'; | ||
import { OverviewCard } from './components/overview_card'; | ||
|
||
export interface ManagementOverviewProps { | ||
application: ApplicationStart; | ||
chrome: ChromeStart; | ||
overviewApps?: OverviewApp[]; | ||
} | ||
|
||
function ManagementOverviewWrapper(props: ManagementOverviewProps) { | ||
const { chrome, application, overviewApps } = props; | ||
|
||
const hiddenAppIds = | ||
useObservable(chrome.navLinks.getNavLinks$()) | ||
?.filter((link) => link.hidden) | ||
.map((link) => link.id) || []; | ||
|
||
const availableApps = overviewApps?.filter((app) => hiddenAppIds.indexOf(app.id) === -1); | ||
|
||
return ( | ||
<EuiPage restrictWidth={1200}> | ||
<EuiPageBody component="main"> | ||
<EuiTitle size="l"> | ||
<h1> | ||
<FormattedMessage id="management.overview.overviewTitle" defaultMessage="Overview" /> | ||
</h1> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
<EuiFlexGrid columns={3}> | ||
{availableApps?.map((app) => ( | ||
<EuiFlexItem key={app.id}> | ||
<OverviewCard | ||
{...app} | ||
onClick={() => { | ||
application.navigateToApp(app.id); | ||
}} | ||
/> | ||
</EuiFlexItem> | ||
))} | ||
</EuiFlexGrid> | ||
</EuiPageBody> | ||
</EuiPage> | ||
); | ||
} | ||
|
||
export function renderApp( | ||
{ application, chrome }: CoreStart, | ||
overviewApps: OverviewApp[], | ||
element: HTMLElement | ||
) { | ||
ReactDOM.render( | ||
<I18nProvider> | ||
<ManagementOverviewWrapper | ||
chrome={chrome} | ||
application={application} | ||
overviewApps={overviewApps} | ||
/> | ||
</I18nProvider>, | ||
element | ||
); | ||
|
||
return () => { | ||
chrome.docTitle.reset(); | ||
ReactDOM.unmountComponentAtNode(element); | ||
}; | ||
} |
Oops, something went wrong.