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 dashboard plugin (#37) #105

Merged
merged 1 commit into from
Mar 12, 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
2 changes: 1 addition & 1 deletion src/plugins/dashboard/README.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[[kibana-dashboard-plugin]]
[[opensearch-dashboards-dashboard-plugin]]
== Dashboard plugin

- Registers the dashboard application.
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/dashboard/common/bwc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
* under the License.
*/

import { SavedObjectReference } from 'kibana/public';
import { SavedObjectReference } from 'opensearch-dashboards/public';

import { GridData } from '../';

interface SavedObjectAttributes {
kibanaSavedObjectMeta: {
opensearchDashboardsSavedObjectMeta: {
searchSourceJSON: string;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dashboard/common/migrate_to_730_panels.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 { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import semver from 'semver';
import uuid from 'uuid';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dashboard/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { schema, TypeOf } from '@kbn/config-schema';
import { schema, TypeOf } from '@osd/config-schema';

export const configSchema = schema.object({
allowByValueEmbeddables: schema.boolean({ defaultValue: false }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": "dashboard",
"version": "kibana",
"version": "opensearchDashboards",
"requiredPlugins": [
"data",
"embeddable",
"inspector",
"kibanaLegacy",
"opensearchDashboardsLegacy",
"urlForwarding",
"navigation",
"uiActions",
Expand All @@ -14,5 +14,5 @@
"optionalPlugins": ["home", "share", "usageCollection"],
"server": true,
"ui": true,
"requiredBundles": ["kibanaUtils", "kibanaReact", "home"]
"requiredBundles": ["opensearchDashboardsUtils", "opensearchDashboardsReact", "home"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { CoreStart } from 'opensearch-dashboards/public';
import { AddToLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ErrorEmbeddable, ViewMode } from '../../../../embeddable/public';
Expand Down Expand Up @@ -69,7 +69,7 @@ beforeEach(async () => {
ContactCardEmbeddableOutput,
ContactCardEmbeddable
>(CONTACT_CARD_EMBEDDABLE, {
firstName: 'Kibanana',
firstName: 'opensearchDashboards',
});

if (isErrorEmbeddable(contactCardEmbeddable)) {
Expand All @@ -80,7 +80,7 @@ beforeEach(async () => {
ContactCardEmbeddableInput
>(contactCardEmbeddable, {
mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: contactCardEmbeddable.id },
mockedByValueInput: { firstName: 'Kibanana', id: contactCardEmbeddable.id },
mockedByValueInput: { firstName: 'opensearchDashboards', id: contactCardEmbeddable.id },
});
embeddable.updateInput({ viewMode: ViewMode.EDIT });
}
Expand Down Expand Up @@ -128,7 +128,7 @@ test('Add to library is not compatible when embeddable is not in a dashboard con
ContactCardEmbeddableInput
>(orphanContactCard, {
mockedByReferenceInput: { savedObjectId: 'test', id: orphanContactCard.id },
mockedByValueInput: { firstName: 'Kibanana', id: orphanContactCard.id },
mockedByValueInput: { firstName: 'opensearchDashboards', id: orphanContactCard.id },
});
const action = new AddToLibraryAction();
expect(await action.isCompatible({ embeddable: orphanContactCard })).toBe(false);
Expand Down
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 _ from 'lodash';
import uuid from 'uuid';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { CoreStart } from 'opensearch-dashboards/public';
import { ClonePanelAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';

Expand Down Expand Up @@ -64,7 +64,7 @@ beforeEach(async () => {
const input = getSampleDashboardInput({
panels: {
'123': getSampleDashboardPanel<ContactCardEmbeddableInput>({
explicitInput: { firstName: 'Kibanana', id: '123' },
explicitInput: { firstName: 'opensearchDashboards', id: '123' },
type: CONTACT_CARD_EMBEDDABLE,
}),
},
Expand All @@ -76,7 +76,7 @@ beforeEach(async () => {
ContactCardEmbeddableOutput,
ContactCardEmbeddable
>(CONTACT_CARD_EMBEDDABLE, {
firstName: 'Kibana',
firstName: 'opensearchDashboards',
});

if (isErrorEmbeddable(contactCardEmbeddable)) {
Expand Down
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 { CoreStart } from 'src/core/public';
import uuid from 'uuid';
import _ from 'lodash';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ beforeEach(async () => {
ContactCardEmbeddableOutput,
ContactCardEmbeddable
>(CONTACT_CARD_EMBEDDABLE, {
firstName: 'Kibana',
firstName: 'opensearchDashboards',
});

if (isErrorEmbeddable(contactCardEmbeddable)) {
Expand Down
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 { IEmbeddable } from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { CoreStart } from 'opensearch-dashboards/public';
import { LibraryNotificationAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ErrorEmbeddable, IContainer, ViewMode } from '../../../../embeddable/public';
Expand Down Expand Up @@ -64,7 +64,7 @@ beforeEach(async () => {
ContactCardEmbeddableOutput,
ContactCardEmbeddable
>(CONTACT_CARD_EMBEDDABLE, {
firstName: 'Kibanana',
firstName: 'opensearchDashboards',
});

if (isErrorEmbeddable(contactCardEmbeddable)) {
Expand All @@ -75,7 +75,7 @@ beforeEach(async () => {
ContactCardEmbeddableInput
>(contactCardEmbeddable, {
mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: contactCardEmbeddable.id },
mockedByValueInput: { firstName: 'Kibanana', id: contactCardEmbeddable.id },
mockedByValueInput: { firstName: 'opensearchDashboards', id: contactCardEmbeddable.id },
});
embeddable.updateInput({ viewMode: ViewMode.EDIT });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React from 'react';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { EuiBadge } from '@elastic/eui';
import {
IEmbeddable,
Expand All @@ -27,7 +27,7 @@ import {
isErrorEmbeddable,
} from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { reactToUiComponent } from '../../../../kibana_react/public';
import { reactToUiComponent } from '../../../../opensearch_dashboards_react/public';

export const ACTION_LIBRARY_NOTIFICATION = 'ACTION_LIBRARY_NOTIFICATION';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React from 'react';
import { CoreStart } from 'src/core/public';
import { toMountPoint } from '../../../../../plugins/kibana_react/public';
import { toMountPoint } from '../../../../../plugins/opensearch_dashboards_react/public';
import { ReplacePanelFlyout } from './replace_panel_flyout';
import {
IEmbeddable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { CoreStart } from 'opensearch-dashboards/public';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';

const { setup, doStart } = embeddablePluginMock.createInstance();
Expand Down Expand Up @@ -69,7 +69,7 @@ beforeEach(async () => {
ContactCardEmbeddableOutput,
ContactCardEmbeddable
>(CONTACT_CARD_EMBEDDABLE, {
firstName: 'Kibana',
firstName: 'opensearchDashboards',
});

if (isErrorEmbeddable(contactCardEmbeddable)) {
Expand Down
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 { CoreStart } from 'src/core/public';
import { IEmbeddable, ViewMode, EmbeddableStart } from '../../embeddable_plugin';
import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable';
Expand Down
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 React from 'react';
import { EuiFlyoutBody, EuiFlyoutHeader, EuiTitle } from '@elastic/eui';
import { NotificationsStart, Toast } from 'src/core/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { CoreStart } from 'opensearch-dashboards/public';
import { UnlinkFromLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import {
Expand Down Expand Up @@ -68,7 +68,7 @@ beforeEach(async () => {
ContactCardEmbeddableOutput,
ContactCardEmbeddable
>(CONTACT_CARD_EMBEDDABLE, {
firstName: 'Kibanana',
firstName: 'opensearchDashboards',
});

if (isErrorEmbeddable(contactCardEmbeddable)) {
Expand All @@ -79,7 +79,7 @@ beforeEach(async () => {
ContactCardEmbeddableInput
>(contactCardEmbeddable, {
mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: contactCardEmbeddable.id },
mockedByValueInput: { firstName: 'Kibanana', id: contactCardEmbeddable.id },
mockedByValueInput: { firstName: 'opensearchDashboards', id: contactCardEmbeddable.id },
});
embeddable.updateInput({ viewMode: ViewMode.EDIT });
});
Expand Down Expand Up @@ -126,7 +126,7 @@ test('Unlink is not compatible when embeddable is not in a dashboard container',
ContactCardEmbeddableInput
>(orphanContactCard, {
mockedByReferenceInput: { savedObjectId: 'test', id: orphanContactCard.id },
mockedByValueInput: { firstName: 'Kibanana', id: orphanContactCard.id },
mockedByValueInput: { firstName: 'opensearchDashboards', id: orphanContactCard.id },
});
const action = new UnlinkFromLibraryAction();
expect(await action.isCompatible({ embeddable: orphanContactCard })).toBe(false);
Expand Down
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 _ from 'lodash';
import uuid from 'uuid';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
Expand Down
14 changes: 7 additions & 7 deletions src/plugins/dashboard/public/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { EuiIcon } from '@elastic/eui';
import angular, { IModule } from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import { i18nDirective, i18nFilter, I18nProvider } from '@osd/i18n/angular';
import {
ChromeStart,
IUiSettingsClient,
Expand All @@ -32,16 +32,16 @@ import {
PluginInitializerContext,
ScopedHistory,
AppMountParameters,
} from 'kibana/public';
} from 'opensearch-dashboards/public';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/public';
import { Storage } from '../../../kibana_utils/public';
import { Storage } from '../../../opensearch_dashboards_utils/public';
// @ts-ignore
import { initDashboardApp } from './legacy_app';
import { EmbeddableStart } from '../../../embeddable/public';
import { NavigationPublicPluginStart as NavigationStart } from '../../../navigation/public';
import { DataPublicPluginStart } from '../../../data/public';
import { SharePluginStart } from '../../../share/public';
import { KibanaLegacyStart, configureAppAngularModule } from '../../../kibana_legacy/public';
import { OpenSearchDashboardsLegacyStart, configureAppAngularModule } from '../../../opensearch_dashboards_legacy/public';
import { UrlForwardingStart } from '../../../url_forwarding/public';
import { SavedObjectLoader, SavedObjectsStart } from '../../../saved_objects/public';

Expand All @@ -57,7 +57,7 @@ export interface RenderDeps {
navigation: NavigationStart;
savedObjectsClient: SavedObjectsClientContract;
savedDashboards: SavedObjectLoader;
dashboardConfig: KibanaLegacyStart['dashboardConfig'];
dashboardConfig: OpenSearchDashboardsLegacyStart['dashboardConfig'];
dashboardCapabilities: any;
embeddableCapabilities: {
visualizeCapabilities: any;
Expand All @@ -72,7 +72,7 @@ export interface RenderDeps {
share?: SharePluginStart;
usageCollection?: UsageCollectionSetup;
navigateToDefaultApp: UrlForwardingStart['navigateToDefaultApp'];
navigateToLegacyKibanaUrl: UrlForwardingStart['navigateToLegacyKibanaUrl'];
navigateToLegacyOpenSearchDashboardsUrl: UrlForwardingStart['navigateToLegacyOpenSearchDashboardsUrl'];
scopedHistory: () => ScopedHistory;
setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'];
savedObjects: SavedObjectsStart;
Expand All @@ -97,7 +97,7 @@ export const renderApp = (element: HTMLElement, appBasePath: string, deps: Rende
const $injector = mountDashboardApp(appBasePath, element);

return () => {
($injector.get('kbnUrlStateStorage') as any).cancel();
($injector.get('osdUrlStateStorage') as any).cancel();
$injector.get('$rootScope').$destroy();
};
};
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/dashboard/public/application/dashboard_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { History } from 'history';

import { ViewMode } from 'src/plugins/embeddable/public';
import { IIndexPattern, TimeRange, Query, Filter, SavedQuery } from 'src/plugins/data/public';
import { IKbnUrlStateStorage } from 'src/plugins/kibana_utils/public';
import { IOsdUrlStateStorage } from 'src/plugins/opensearch_dashboards_utils/public';

import { DashboardAppState, SavedDashboardPanel } from '../types';
import { DashboardAppController } from './dashboard_app_controller';
Expand Down Expand Up @@ -59,7 +59,7 @@ export interface DashboardAppScope extends ng.IScope {
topNavMenu: any;
showAddPanel: any;
showSaveQuery: boolean;
kbnTopNav: any;
osdTopNav: any;
enterEditMode: () => void;
timefilterSubscriptions$: Subscription;
isVisible: boolean;
Expand All @@ -75,15 +75,15 @@ export function initDashboardAppDirective(app: any, deps: RenderDeps) {
$routeParams: {
id?: string;
},
kbnUrlStateStorage: IKbnUrlStateStorage,
osdUrlStateStorage: IOsdUrlStateStorage,
history: History
) =>
new DashboardAppController({
$route,
$scope,
$routeParams,
indexPatterns: deps.data.indexPatterns,
kbnUrlStateStorage,
osdUrlStateStorage,
history,
...deps,
}),
Expand Down
Loading