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

[Rename] management plugin #148

Merged
merged 1 commit into from
Mar 11, 2021
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
8 changes: 0 additions & 8 deletions src/plugins/management/kibana.json

This file was deleted.

8 changes: 8 additions & 0 deletions src/plugins/management/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "management",
"version": "opensearchDashboards",
"server": true,
"ui": true,
"optionalPlugins": ["home"],
"requiredBundles": ["opensearchDashboardsReact", "opensearchDashboardsUtils", "home"]
}
2 changes: 1 addition & 1 deletion src/plugins/management/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React from 'react';
import ReactDOM from 'react-dom';

import { AppMountParameters } from 'kibana/public';
import { AppMountParameters } from 'opensearch-dashboards/public';
import { ManagementApp, ManagementAppDependencies } from './components/management_app';

export const renderApp = async (
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/management/public/components/landing/landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@osd/i18n/react';

import {
EuiHorizontalRule,
Expand Down Expand Up @@ -55,7 +55,7 @@ export const ManagementLandingPage = ({ version, setBreadcrumbs }: ManagementLan
<EuiText>
<FormattedMessage
id="management.landing.subhead"
defaultMessage="Manage your indices, index patterns, saved objects, Kibana settings, and more."
defaultMessage="Manage your indices, 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 @@ -17,14 +17,14 @@
* under the License.
*/
import React, { useState, useEffect, useCallback } from 'react';
import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from 'kibana/public';
import { I18nProvider } from '@kbn/i18n/react';
import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from 'opensearch-dashboards/public';
import { I18nProvider } from '@osd/i18n/react';
import { EuiPage } from '@elastic/eui';
import { ManagementSection, MANAGEMENT_BREADCRUMB } from '../../utils';

import { ManagementRouter } from './management_router';
import { ManagementSidebarNav } from '../management_sidebar_nav';
import { reactRouterNavigate } from '../../../../kibana_react/public';
import { reactRouterNavigate } from '../../../../opensearch_dashboards_react/public';
import { SectionsServiceStart } from '../../types';

import './management_app.scss';
Expand All @@ -37,7 +37,7 @@ interface ManagementAppProps {

export interface ManagementAppDependencies {
sections: SectionsServiceStart;
kibanaVersion: string;
opensearchDashboardsVersion: string;
setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React, { memo } from 'react';
import { Route, Router, Switch } from 'react-router-dom';
import { EuiPageBody } from '@elastic/eui';
import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from 'kibana/public';
import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from 'opensearch-dashboards/public';
import { ManagementAppWrapper } from '../management_app_wrapper';
import { ManagementLandingPage } from '../landing';
import { ManagementAppDependencies } from './management_app';
Expand Down Expand Up @@ -60,7 +60,7 @@ export const ManagementRouter = memo(
path={'/'}
component={() => (
<ManagementLandingPage
version={dependencies.kibanaVersion}
version={dependencies.opensearchDashboardsVersion}
setBreadcrumbs={setBreadcrumbs}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import React, { createRef, Component } from 'react';

import { ChromeBreadcrumb, AppMountParameters, ScopedHistory } from 'kibana/public';
import { ChromeBreadcrumb, AppMountParameters, ScopedHistory } from 'opensearch-dashboards/public';
import { ManagementApp } from '../../utils';
import { Unmount } from '../../types';

Expand Down
20 changes: 10 additions & 10 deletions src/plugins/management/public/components/management_sections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { ManagementSectionId } from '../types';

const ingestTitle = i18n.translate('management.sections.ingestTitle', {
Expand Down Expand Up @@ -52,12 +52,12 @@ const sectionTip = i18n.translate('management.sections.section.tip', {
defaultMessage: 'Control access to features and data',
});

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

const kibanaTip = i18n.translate('management.sections.kibanaTip', {
defaultMessage: 'Customize Kibana and manage saved objects',
const opensearchDashboardsTip = i18n.translate('management.sections.opensearchDashboardsTip', {
defaultMessage: 'Customize OpenSearch Dashboards and manage saved objects',
});

const stackTitle = i18n.translate('management.sections.stackTitle', {
Expand Down Expand Up @@ -96,10 +96,10 @@ export const SecuritySection = {
order: 3,
};

export const KibanaSection = {
id: ManagementSectionId.Kibana,
title: kibanaTitle,
tip: kibanaTip,
export const OpenSearchDashboardsSection = {
id: ManagementSectionId.OpenSearchDashboards,
title: opensearchDashboardsTitle,
tip: opensearchDashboardsTip,
order: 4,
};

Expand All @@ -115,6 +115,6 @@ export const managementSections = [
DataSection,
InsightsAndAlertingSection,
SecuritySection,
KibanaSection,
OpenSearchDashboardsSection,
StackSection,
];
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { useState } from 'react';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { sortBy } from 'lodash';

import {
Expand All @@ -30,13 +30,13 @@ import {
EuiFlexItem,
EuiToolTip,
} from '@elastic/eui';
import { AppMountParameters } from 'kibana/public';
import { AppMountParameters } from 'opensearch-dashboards/public';
import { ManagementApp, ManagementSection } from '../../utils';

import './management_sidebar_nav.scss';

import { ManagementItem } from '../../utils/management_item';
import { reactRouterNavigate } from '../../../../kibana_react/public';
import { reactRouterNavigate } from '../../../../opensearch_dashboards_react/public';

interface ManagementSidebarNavProps {
sections: ManagementSection[];
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginInitializerContext } from 'kibana/public';
import { PluginInitializerContext } from 'opensearch-dashboards/public';
import { ManagementPlugin } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/management/public/management_sections_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
DataSection,
InsightsAndAlertingSection,
SecuritySection,
KibanaSection,
OpenSearchDashboardsSection,
StackSection,
} from './components/management_sections';

Expand All @@ -34,7 +34,7 @@ import {
DefinedSections,
ManagementSectionsStartPrivate,
} from './types';
import { createGetterSetter } from '../../kibana_utils/public';
import { createGetterSetter } from '../../opensearch_dashboards_utils/public';

const [getSectionsServiceStartPrivate, setSectionsServiceStartPrivate] = createGetterSetter<
ManagementSectionsStartPrivate
Expand All @@ -53,7 +53,7 @@ export class ManagementSectionsService {
data: this.registerSection(DataSection),
insightsAndAlerting: this.registerSection(InsightsAndAlertingSection),
security: this.registerSection(SecuritySection),
kibana: this.registerSection(KibanaSection),
opensearchDashboards: this.registerSection(OpenSearchDashboardsSection),
stack: this.registerSection(StackSection),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/public/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const createSetupContract = (): ManagementSetup => ({
data: createManagementSectionMock(),
insightsAndAlerting: createManagementSectionMock(),
security: createManagementSectionMock(),
kibana: createManagementSectionMock(),
opensearchDashboards: createManagementSectionMock(),
stack: createManagementSectionMock(),
} as unknown) as DefinedSections,
},
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { BehaviorSubject } from 'rxjs';
import { ManagementSetup, ManagementStart } from './types';
import { FeatureCatalogueCategory, HomePublicPluginSetup } from '../../home/public';
Expand Down Expand Up @@ -53,7 +53,7 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart
constructor(private initializerContext: PluginInitializerContext) {}

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

if (home) {
home.featureCatalogue.register({
Expand All @@ -62,7 +62,7 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart
defaultMessage: 'Stack Management',
}),
description: i18n.translate('management.stackManagement.managementDescription', {
defaultMessage: 'Your center console for managing the Elastic Stack.',
defaultMessage: 'Your center console for managing the OpenSearch Stack.',
}),
icon: 'managementApp',
path: '/app/management',
Expand All @@ -87,7 +87,7 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart

return renderApp(params, {
sections: getSectionsServiceStartPrivate(),
kibanaVersion,
opensearchDashboardsVersion,
setBreadcrumbs: coreStart.chrome.setBreadcrumbs,
});
},
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/management/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { ScopedHistory, Capabilities } from 'kibana/public';
import { ScopedHistory, Capabilities } from 'opensearch-dashboards/public';
import { ManagementSection, RegisterManagementSectionArgs } from './utils';
import { ChromeBreadcrumb } from '../../../core/public/';

Expand All @@ -30,7 +30,7 @@ export interface DefinedSections {
data: ManagementSection;
insightsAndAlerting: ManagementSection;
security: ManagementSection;
kibana: ManagementSection;
opensearchDashboards: ManagementSection;
stack: ManagementSection;
}

Expand Down Expand Up @@ -59,7 +59,7 @@ export enum ManagementSectionId {
Data = 'data',
InsightsAndAlerting = 'insightsAndAlerting',
Security = 'security',
Kibana = 'kibana',
OpenSearchDashboards = 'opensearchDashboards',
Stack = 'stack',
}

Expand Down
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 @@ -17,7 +17,7 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

export const MANAGEMENT_BREADCRUMB = {
text: i18n.translate('management.breadcrumb', {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/public/utils/management_section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { Assign } from '@kbn/utility-types';
import { Assign } from '@osd/utility-types';
import { CreateManagementItemArgs, ManagementSectionId } from '../types';
import { ManagementItem } from './management_item';
import { ManagementApp, RegisterManagementAppArgs } from './management_app';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/server/capabilities_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const capabilitiesProvider = () => ({
* Management settings correspond to management section/link ids, and should not be changed
* without also updating those definitions.
*/
kibana: {
opensearchDashboards: {
settings: true,
indexPatterns: true,
objects: true,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginInitializerContext } from 'kibana/server';
import { PluginInitializerContext } from 'opensearch-dashboards/server';
import { ManagementServerPlugin } from './plugin';

export const plugin = (initContext: PluginInitializerContext) =>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from 'kibana/server';
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from 'opensearch-dashboards/server';
import { capabilitiesProvider } from './capabilities_provider';

export class ManagementServerPlugin implements Plugin<object, object> {
Expand Down