From 17e7c9985ef1f51f2744694f525d2927b3129296 Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Wed, 10 Mar 2021 19:05:26 -0800 Subject: [PATCH] [Rename] management plugin (#148) Signed-off-by: Kawika Avilla --- src/plugins/management/kibana.json | 8 -------- .../management/opensearch_dashboards.json | 8 ++++++++ src/plugins/management/public/application.tsx | 2 +- .../public/components/landing/landing.tsx | 4 ++-- .../management_app/management_app.tsx | 8 ++++---- .../management_app/management_router.tsx | 4 ++-- .../management_app_wrapper.tsx | 2 +- .../public/components/management_sections.tsx | 20 +++++++++---------- .../management_sidebar_nav.tsx | 6 +++--- src/plugins/management/public/index.ts | 2 +- .../public/management_sections_service.ts | 6 +++--- src/plugins/management/public/mocks/index.ts | 2 +- src/plugins/management/public/plugin.ts | 8 ++++---- src/plugins/management/public/types.ts | 6 +++--- .../management/public/utils/breadcrumbs.ts | 2 +- .../public/utils/management_section.ts | 2 +- .../server/capabilities_provider.ts | 2 +- src/plugins/management/server/index.ts | 2 +- src/plugins/management/server/plugin.ts | 2 +- 19 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 src/plugins/management/kibana.json create mode 100644 src/plugins/management/opensearch_dashboards.json diff --git a/src/plugins/management/kibana.json b/src/plugins/management/kibana.json deleted file mode 100644 index 6c8574f02422..000000000000 --- a/src/plugins/management/kibana.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "management", - "version": "kibana", - "server": true, - "ui": true, - "optionalPlugins": ["home"], - "requiredBundles": ["kibanaReact", "kibanaUtils", "home"] -} diff --git a/src/plugins/management/opensearch_dashboards.json b/src/plugins/management/opensearch_dashboards.json new file mode 100644 index 000000000000..5f08e79223ec --- /dev/null +++ b/src/plugins/management/opensearch_dashboards.json @@ -0,0 +1,8 @@ +{ + "id": "management", + "version": "opensearchDashboards", + "server": true, + "ui": true, + "optionalPlugins": ["home"], + "requiredBundles": ["opensearchDashboardsReact", "opensearchDashboardsUtils", "home"] +} diff --git a/src/plugins/management/public/application.tsx b/src/plugins/management/public/application.tsx index 035f5d56e4cc..5d9c5585730e 100644 --- a/src/plugins/management/public/application.tsx +++ b/src/plugins/management/public/application.tsx @@ -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 ( diff --git a/src/plugins/management/public/components/landing/landing.tsx b/src/plugins/management/public/components/landing/landing.tsx index f15374173e5f..658edc917b22 100644 --- a/src/plugins/management/public/components/landing/landing.tsx +++ b/src/plugins/management/public/components/landing/landing.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@osd/i18n/react'; import { EuiHorizontalRule, @@ -55,7 +55,7 @@ export const ManagementLandingPage = ({ version, setBreadcrumbs }: ManagementLan diff --git a/src/plugins/management/public/components/management_app/management_app.tsx b/src/plugins/management/public/components/management_app/management_app.tsx index 313884a90908..bed502be6ec1 100644 --- a/src/plugins/management/public/components/management_app/management_app.tsx +++ b/src/plugins/management/public/components/management_app/management_app.tsx @@ -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'; @@ -37,7 +37,7 @@ interface ManagementAppProps { export interface ManagementAppDependencies { sections: SectionsServiceStart; - kibanaVersion: string; + opensearchDashboardsVersion: string; setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void; } diff --git a/src/plugins/management/public/components/management_app/management_router.tsx b/src/plugins/management/public/components/management_app/management_router.tsx index 3f934fa68c6b..806cfba44bff 100644 --- a/src/plugins/management/public/components/management_app/management_router.tsx +++ b/src/plugins/management/public/components/management_app/management_router.tsx @@ -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'; @@ -60,7 +60,7 @@ export const ManagementRouter = memo( path={'/'} component={() => ( )} diff --git a/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx b/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx index bcfb86c33108..d4cebb7f1a11 100644 --- a/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx +++ b/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx @@ -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'; diff --git a/src/plugins/management/public/components/management_sections.tsx b/src/plugins/management/public/components/management_sections.tsx index 02d3371171d8..a7a46f085ac4 100644 --- a/src/plugins/management/public/components/management_sections.tsx +++ b/src/plugins/management/public/components/management_sections.tsx @@ -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', { @@ -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', { @@ -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, }; @@ -115,6 +115,6 @@ export const managementSections = [ DataSection, InsightsAndAlertingSection, SecuritySection, - KibanaSection, + OpenSearchDashboardsSection, StackSection, ]; diff --git a/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx b/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx index 37d1167661d8..a05549466964 100644 --- a/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx +++ b/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx @@ -18,7 +18,7 @@ */ import React, { useState } from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { sortBy } from 'lodash'; import { @@ -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[]; diff --git a/src/plugins/management/public/index.ts b/src/plugins/management/public/index.ts index f3e25b90b73c..d7fec61f618b 100644 --- a/src/plugins/management/public/index.ts +++ b/src/plugins/management/public/index.ts @@ -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) { diff --git a/src/plugins/management/public/management_sections_service.ts b/src/plugins/management/public/management_sections_service.ts index b9dc2dd416d9..bdab7dc11de7 100644 --- a/src/plugins/management/public/management_sections_service.ts +++ b/src/plugins/management/public/management_sections_service.ts @@ -23,7 +23,7 @@ import { DataSection, InsightsAndAlertingSection, SecuritySection, - KibanaSection, + OpenSearchDashboardsSection, StackSection, } from './components/management_sections'; @@ -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 @@ -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), }; } diff --git a/src/plugins/management/public/mocks/index.ts b/src/plugins/management/public/mocks/index.ts index fbb37647dad9..2b69031b1ac9 100644 --- a/src/plugins/management/public/mocks/index.ts +++ b/src/plugins/management/public/mocks/index.ts @@ -37,7 +37,7 @@ const createSetupContract = (): ManagementSetup => ({ data: createManagementSectionMock(), insightsAndAlerting: createManagementSectionMock(), security: createManagementSectionMock(), - kibana: createManagementSectionMock(), + opensearchDashboards: createManagementSectionMock(), stack: createManagementSectionMock(), } as unknown) as DefinedSections, }, diff --git a/src/plugins/management/public/plugin.ts b/src/plugins/management/public/plugin.ts index 122e73796753..125cc0916286 100644 --- a/src/plugins/management/public/plugin.ts +++ b/src/plugins/management/public/plugin.ts @@ -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'; @@ -53,7 +53,7 @@ export class ManagementPlugin implements Plugin ({ * 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, diff --git a/src/plugins/management/server/index.ts b/src/plugins/management/server/index.ts index afc7adf8832e..8a3f303ac626 100644 --- a/src/plugins/management/server/index.ts +++ b/src/plugins/management/server/index.ts @@ -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) => diff --git a/src/plugins/management/server/plugin.ts b/src/plugins/management/server/plugin.ts index f8fda7da9b95..31bb7a94fb43 100644 --- a/src/plugins/management/server/plugin.ts +++ b/src/plugins/management/server/plugin.ts @@ -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 {