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

New management overview page and rename stack management to dashboard management #4287

Merged
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d7bae77
navigation changes and overview page
Hailong-am Jun 14, 2023
d822316
Merge remote-tracking branch 'upstream/main' into feature/navigation_…
Hailong-am Jun 14, 2023
1ef839e
Add changelog
Hailong-am Jun 14, 2023
caca46d
Rename stack management to dashboard management
Hailong-am Jun 15, 2023
74faff7
management overviw page align with app directory page
Hailong-am Jun 16, 2023
d7716ce
wording changes for dashboards management
Hailong-am Jun 19, 2023
59bb4ce
wording changes
Hailong-am Jun 20, 2023
144c415
wording update
Hailong-am Jun 23, 2023
b4cd336
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jun 24, 2023
8c22160
i18n title fix
Hailong-am Jun 24, 2023
bdff260
Merge branch 'main' into feature/navigation_changes_2
joshuarrrr Jun 26, 2023
9f39df8
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jun 26, 2023
b1286f0
Merge branch 'main' into feature/navigation_changes_2
ashwin-pc Jun 28, 2023
7c37ceb
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jun 29, 2023
8c23c95
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jun 29, 2023
fa7be2f
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jun 30, 2023
a148aaa
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jul 1, 2023
c73eec9
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jul 3, 2023
d49fcd3
Merge branch 'main' into feature/navigation_changes_2
Hailong-am Jul 4, 2023
e2be9ce
Merge branch 'main' into feature/navigation_changes_2
ashwin-pc Jul 5, 2023
01d8ea6
remove overview register setup in start phase
Hailong-am Jul 6, 2023
833179c
Add comment for dev tools order change
Hailong-am Jul 6, 2023
9472de0
Make home plugin optional for managemnet overview
Hailong-am Jul 6, 2023
66f286e
Fix failed functional test due to wording change
Hailong-am Jul 7, 2023
d83d7a9
Merge remote-tracking branch 'upstream/main' into feature/navigation_…
Hailong-am Jul 7, 2023
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### 🔩 Tests

## [2.9.0 - TBD]

### 📈 Features/Enhancements

- New management overview page and rename stack management to dashboard management ([#4287](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4287))
Hailong-am marked this conversation as resolved.
Show resolved Hide resolved

## [2.8.0 - 2023-06-06](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/2.8.0)

### Deprecations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { ComponentRegistry } from '../types';
import './index.scss';

const title = i18n.translate('advancedSettings.advancedSettingsLabel', {
defaultMessage: 'Advanced Settings',
defaultMessage: 'Advanced settings',
});
const crumb = [{ text: title }];

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/advanced_settings/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { AdvancedSettingsSetup, AdvancedSettingsStart, AdvancedSettingsPluginSet
const component = new ComponentRegistry();

const title = i18n.translate('advancedSettings.advancedSettingsLabel', {
defaultMessage: 'Advanced Settings',
defaultMessage: 'Advanced settings',
});

export class AdvancedSettingsPlugin
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data_source_management/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
*/

export const PLUGIN_ID = 'dataSourceManagement';
export const PLUGIN_NAME = 'Data Sources';
export const PLUGIN_NAME = 'Data sources';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { mockDataSourceAttributesWithAuth } from '../mocks';
describe('DataSourceManagement: breadcrumbs.ts', () => {
test('get listing breadcrumb', () => {
const bc = getListBreadcrumbs();
expect(bc[0].text).toBe('Data Sources');
expect(bc[0].text).toBe('Data sources');
expect(bc[0].href).toBe('/');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getListBreadcrumbs() {
return [
{
text: i18n.translate('dataSourcesManagement.dataSources.listBreadcrumb', {
defaultMessage: 'Data Sources',
defaultMessage: 'Data sources',
}),
href: `/`,
},
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dev_tools/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "opensearchDashboards",
"server": false,
"ui": true,
"optionalPlugins": ["dataSource"],
"optionalPlugins": ["dataSource", "managementOverview"],
"requiredPlugins": ["urlForwarding"],
"requiredBundles": ["dataSourceManagement"]
}
30 changes: 24 additions & 6 deletions src/plugins/dev_tools/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

import { BehaviorSubject } from 'rxjs';
import { Plugin, CoreSetup, AppMountParameters } from 'src/core/public';
import { Plugin, CoreSetup, AppMountParameters, CoreStart } from 'src/core/public';
import { AppUpdater } from 'opensearch-dashboards/public';
import { i18n } from '@osd/i18n';
import { sortBy } from 'lodash';
Expand All @@ -40,10 +40,16 @@ import { UrlForwardingSetup } from '../../url_forwarding/public';
import { CreateDevToolArgs, DevToolApp, createDevToolApp } from './dev_tool';

import './index.scss';
import { ManagementOverViewPluginStart } from '../../management_overview/public';

export interface DevToolsSetupDependencies {
dataSource?: DataSourcePluginStart;
}

export interface DevToolsStartDependencies {
managementOverview?: ManagementOverViewPluginStart;
}

export interface DevToolsSetup {
/**
* Register a developer tool. It will be available
Expand All @@ -66,6 +72,10 @@ export class DevToolsPlugin implements Plugin<DevToolsSetup, void> {
return sortBy([...this.devTools.values()], 'order');
}

private title = i18n.translate('devTools.devToolsTitle', {
defaultMessage: 'Dev Tools',
});

public setup(
coreSetup: CoreSetup<DevToolsSetupDependencies>,
{ urlForwarding }: { urlForwarding: UrlForwardingSetup }
Expand All @@ -74,12 +84,10 @@ export class DevToolsPlugin implements Plugin<DevToolsSetup, void> {

applicationSetup.register({
id: 'dev_tools',
title: i18n.translate('devTools.devToolsTitle', {
defaultMessage: 'Dev Tools',
}),
title: this.title,
updater$: this.appStateUpdater,
icon: '/plugins/home/public/assets/logos/opensearch_mark_default.svg',
order: 9010,
order: 9070,
Hailong-am marked this conversation as resolved.
Show resolved Hide resolved
category: DEFAULT_APP_CATEGORIES.management,
mount: async (params: AppMountParameters) => {
const { element, history } = params;
Expand Down Expand Up @@ -109,9 +117,19 @@ export class DevToolsPlugin implements Plugin<DevToolsSetup, void> {
};
}

public start() {
public start(core: CoreStart, { managementOverview }: DevToolsStartDependencies) {
if (this.getSortedDevTools().length === 0) {
this.appStateUpdater.next(() => ({ navLinkStatus: AppNavLinkStatus.hidden }));
} else {
managementOverview?.register({
id: 'dev_tools',
title: this.title,
description: i18n.translate('devTools.devToolsDescription', {
defaultMessage:
'Use the console to set up and troubleshoot your OpenSearch environment with the REST API.',
}),
order: 9070,
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/index_pattern_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export type IndexPatternManagementSetup = IndexPatternManagementServiceSetup;
export type IndexPatternManagementStart = IndexPatternManagementServiceStart;

const sectionsHeader = i18n.translate('indexPatternManagement.indexPattern.sectionsHeader', {
defaultMessage: 'Index Patterns',
defaultMessage: 'Index patterns',
});

const IPM_APP_ID = 'indexPatterns';
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/management/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "opensearchDashboards",
"server": true,
"ui": true,
"optionalPlugins": ["home"],
"requiredBundles": ["opensearchDashboardsReact", "opensearchDashboardsUtils", "home"]
"optionalPlugins": ["home", "managementOverview"],
"requiredBundles": ["opensearchDashboardsReact", "opensearchDashboardsUtils"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface ManagementLandingPageProps {
setBreadcrumbs: () => void;
}

export const ManagementLandingPage = ({ version, setBreadcrumbs }: ManagementLandingPageProps) => {
export const ManagementLandingPage = ({ setBreadcrumbs }: ManagementLandingPageProps) => {
useMount(() => {
setBreadcrumbs();
});
Expand All @@ -61,15 +61,14 @@ export const ManagementLandingPage = ({ version, setBreadcrumbs }: ManagementLan
<h1>
<FormattedMessage
id="management.landing.header"
defaultMessage="Welcome to Stack Management {version}"
values={{ version }}
defaultMessage="Welcome to Dashboards Management"
/>
</h1>
</EuiTitle>
<EuiText>
<FormattedMessage
id="management.landing.subhead"
defaultMessage="Manage your indices, index patterns, saved objects, OpenSearch Dashboards settings, and more."
defaultMessage="Manage your index patterns, saved objects, OpenSearch Dashboards settings, and more."
/>
</EuiText>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const sectionTip = i18n.translate('management.sections.section.tip', {
});

const opensearchDashboardsTitle = i18n.translate('management.sections.opensearchDashboardsTitle', {
defaultMessage: 'OpenSearch Dashboards',
defaultMessage: 'Dashboards Management',
});

const opensearchDashboardsTip = i18n.translate('management.sections.opensearchDashboardsTip', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.mgtSideBarNav {
width: 210px;
width: 220px;
margin-right: $euiSize;
}

Expand Down
48 changes: 25 additions & 23 deletions src/plugins/management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import { i18n } from '@osd/i18n';
import { BehaviorSubject } from 'rxjs';
import { ManagementSetup, ManagementStart } from './types';
import { FeatureCatalogueCategory, HomePublicPluginSetup } from '../../home/public';
import { HomePublicPluginSetup } from '../../home/public';
import {
CoreSetup,
CoreStart,
Expand All @@ -49,11 +49,16 @@ import {
ManagementSectionsService,
getSectionsServiceStartPrivate,
} from './management_sections_service';
import { ManagementOverViewPluginStart } from '../../management_overview/public';

interface ManagementSetupDependencies {
home?: HomePublicPluginSetup;
}

interface ManagementStartDependencies {
managementOverview?: ManagementOverViewPluginStart;
}

export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart> {
private readonly managementSections = new ManagementSectionsService();

Expand All @@ -63,32 +68,17 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart

constructor(private initializerContext: PluginInitializerContext) {}

private title = i18n.translate('management.dashboardManagement.title', {
defaultMessage: 'Dashboards Management',
});

public setup(core: CoreSetup, { home }: ManagementSetupDependencies) {
const opensearchDashboardsVersion = this.initializerContext.env.packageInfo.version;

if (home) {
home.featureCatalogue.register({
id: 'stack-management',
title: i18n.translate('management.stackManagement.managementLabel', {
defaultMessage: 'Stack Management',
}),
description: i18n.translate('management.stackManagement.managementDescription', {
defaultMessage: 'Your center console for managing the OpenSearch Stack.',
}),
icon: 'managementApp',
path: '/app/management',
showOnHomePage: false,
category: FeatureCatalogueCategory.ADMIN,
visible: () => this.hasAnyEnabledApps,
});
}

core.application.register({
id: MANAGEMENT_APP_ID,
title: i18n.translate('management.stackManagement.title', {
defaultMessage: 'Stack Management',
}),
order: 9040,
title: this.title,
order: 9030,
icon: '/plugins/home/assets/logos/opensearch_mark_default.svg',
category: DEFAULT_APP_CATEGORIES.management,
updater$: this.appUpdater,
Expand All @@ -109,7 +99,7 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart
};
}

public start(core: CoreStart) {
public start(core: CoreStart, { managementOverview }: ManagementStartDependencies) {
this.managementSections.start({ capabilities: core.application.capabilities });
this.hasAnyEnabledApps = getSectionsServiceStartPrivate()
.getSectionsEnabled()
Expand All @@ -124,6 +114,18 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart
});
}

if (managementOverview && this.hasAnyEnabledApps) {
managementOverview.register({
id: MANAGEMENT_APP_ID,
title: this.title,
description: i18n.translate('management.dashboardManagement.description', {
defaultMessage:
'Manage Dashboards saved objects and data source connections. You can also modify advanced settings for Dashboards.',
}),
order: 9030,
});
}

return {};
}
}
2 changes: 1 addition & 1 deletion src/plugins/management/public/utils/breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { i18n } from '@osd/i18n';

export const MANAGEMENT_BREADCRUMB = {
text: i18n.translate('management.breadcrumb', {
defaultMessage: 'Stack Management',
defaultMessage: 'Dashboards Management',
}),
href: '/',
};
6 changes: 6 additions & 0 deletions src/plugins/management_overview/common/constants.ts
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';
8 changes: 8 additions & 0 deletions src/plugins/management_overview/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "managementOverview",
"version": "opensearchDashboards",
"ui": true,
"server": false,
"requiredPlugins": ["navigation", "home"],
"optionalPlugins": []
}
64 changes: 64 additions & 0 deletions src/plugins/management_overview/public/application.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* 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 { ApplicationStart, CoreStart } from '../../../core/public';
import { OverviewApp } from '.';
import { OverviewCard } from './components/overview_card';

export interface ManagementOverviewProps {
application: ApplicationStart;
overviewApps?: OverviewApp[];
}

function ManagementOverviewWrapper(props: ManagementOverviewProps) {
const { application, overviewApps } = props;

return (
<EuiPage restrictWidth={1200}>
<EuiPageBody component="main">
<EuiTitle size="l">
<h1>
<FormattedMessage id="management.overview.overviewTitle" defaultMessage="Overview" />
</h1>
</EuiTitle>
<EuiSpacer />
<EuiFlexGrid columns={3}>
{overviewApps?.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 application={application} overviewApps={overviewApps} />
</I18nProvider>,
element
);

return () => {
chrome.docTitle.reset();
ReactDOM.unmountComponentAtNode(element);
};
}
Loading