-
Notifications
You must be signed in to change notification settings - Fork 917
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
[Manual Backport 2.x] New management overview page and rename stack management to dashboard management #4528
Merged
manasvinibs
merged 2 commits into
opensearch-project:2.x
from
Hailong-am:backport/backport-4287-to-2.x
Jul 10, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update the PR number to be the backport one (4528) or keep using the original one is good enough ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autocut PR's anyway skip the change log entry and even though manual backport ones has the opportunity to update the PR number in the change log, I see most of the existing ones in 2.x pointing to the original PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Original PR stands as it has the most accurate history.