Skip to content

Commit

Permalink
Support OpenSearch Dashboards 1.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Eva Millán <[email protected]>
  • Loading branch information
evamillan authored and dlumbrer committed Nov 11, 2021
1 parent 7e4d0cf commit 252a78a
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 36 deletions.
14 changes: 7 additions & 7 deletions kibana.json → opensearch_dashboards.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"id": "kbnNetwork",
"version": "7.10.0",
"version": "1.0.0",
"opensearchDashboardsVersion": "opensearchDashboards",
"server": false,
"ui": true,
"requiredPlugins": [
"visualizations",
"data",
"inspector",
"kibanaLegacy"
],
"requiredBundles": [
"kibanaUtils",
"opensearchDashboardsLegacy",
"opensearchDashboardsUtils",
"visDefaultEditor",
"share",
"charts"
]
}
],
"optionalPlugins": []
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "kbn_network",
"version": "7.10.0",
"description": "Network plugin for visualizing networks",
"kibana": {
"version": "7.10.0"
},
"authors": [
"David Moreno Lumbreras <[email protected]>"
],
Expand All @@ -20,5 +17,10 @@
"moment": "^2.24.0",
"vis-data": "^6.5.1",
"vis-util": "^1.1.8"
},
"scripts": {
"build": "yarn plugin-helpers build",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"osd": "node ../../scripts/osd"
}
}
}
2 changes: 1 addition & 1 deletion public/components/field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { get } from 'lodash';
import React, { useEffect, useState, useCallback } from 'react';

import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

import { IndexPatternField } from '../../../../src/plugins/data/public';
import { ComboBoxGroupedOptions } from '../../../../src/plugins/vis_default_editor/public/utils';
Expand Down
2 changes: 1 addition & 1 deletion public/components/field_column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { clone } from 'lodash';
import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { IndexPatternField } from '../../../../src/plugins/data/public';
import { EuiDraggable, EuiIconTip, EuiSpacer, EuiAccordion, EuiToolTip, EuiButtonIcon, EuiButtonIconProps } from '@elastic/eui';

Expand Down
4 changes: 2 additions & 2 deletions public/components/kbn_network_vis_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { some } from 'lodash';
import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiButtonEmpty, EuiDragDropContext, euiDragDropReorder, EuiDroppable, EuiFlexGroup, EuiFlexItem, EuiFormErrorText, EuiIconTip, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';

import { IAggConfigs } from '../../../../src/plugins/data/public';
Expand Down
2 changes: 1 addition & 1 deletion public/components/utils.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 enum AggTypes {
SUM = 'sum',
Expand Down
4 changes: 2 additions & 2 deletions public/data_load/kibana_cloned_code/courier.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { hasIn } from 'lodash';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

import { calculateObjectHash } from '../../../../../src/plugins/kibana_utils/public';
import { calculateObjectHash } from '../../../../../src/plugins/opensearch_dashboards_utils/public';
import { PersistedState } from '../../../../../src/plugins/visualizations/public';
import { Adapters } from '../../../../../src/plugins/inspector/public';

Expand Down
10 changes: 5 additions & 5 deletions public/get_inner_angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import angular from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import 'angular-recursion';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import { CoreStart, IUiSettingsClient, PluginInitializerContext } from 'kibana/public';
import { i18nDirective, i18nFilter, I18nProvider } from '@osd/i18n/angular';
import { CoreStart, IUiSettingsClient, PluginInitializerContext } from '../../../src/core/public';
import {
initAngularBootstrap,
PaginateDirectiveProvider,
PaginateControlsDirectiveProvider,
PrivateProvider,
watchMultiDecorator,
KbnAccessibleClickProvider,
} from '../../../src/plugins/kibana_legacy/public';
OsdAccessibleClickProvider,
} from '../../../src/plugins/opensearch_dashboards_legacy/public';

initAngularBootstrap();

Expand Down Expand Up @@ -63,7 +63,7 @@ export function getInnerAngular(name = 'kibana/kbn_network_vis', core: CoreStart
'tableVisI18n',
])
.config(watchMultiDecorator)
.directive('kbnAccessibleClick', KbnAccessibleClickProvider);
.directive('osdAccessibleClick', OsdAccessibleClickProvider);
}

function createLocalPrivateModule() {
Expand Down
2 changes: 1 addition & 1 deletion public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import './index.scss';
import { PluginInitializerContext } from 'kibana/public';
import { PluginInitializerContext } from 'opensearch-dashboards/public';
import { KbnNetworkPlugin as Plugin } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
Expand Down
2 changes: 1 addition & 1 deletion public/kbn-network-vis.js
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 { AggGroupNames } from '../../../src/plugins/data/public';
import { Schemas } from '../../../src/plugins/vis_default_editor/public';

Expand Down
10 changes: 5 additions & 5 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { VisualizationsSetup } from '../../../src/plugins/visualizations/public'
import { kbnNetworkVisTypeDefinition } from './kbn-network-vis';

import { DataPublicPluginStart } from '../../../src/plugins/data/public';
import { setFormatService, setKibanaLegacy, setNotifications, setQueryService, setSearchService } from './services';
import { KibanaLegacyStart } from '../../../src/plugins/kibana_legacy/public';
import { setFormatService, setOpensearchDashboardsLegacy, setNotifications, setQueryService, setSearchService } from './services';
import { OpensearchDashboardsLegacyStart } from '../../../src/plugins/opensearch_dashboards_legacy/public';


/** @internal */
Expand All @@ -34,7 +34,7 @@ export interface TablePluginSetupDependencies {
/** @internal */
export interface TablePluginStartDependencies {
data: DataPublicPluginStart;
kibanaLegacy: KibanaLegacyStart;
opensearchDashboardsLegacy: OpensearchDashboardsLegacyStart;
}

/** @internal */
Expand All @@ -56,9 +56,9 @@ export class KbnNetworkPlugin implements Plugin<Promise<void>, void> {

}

public start(core: CoreStart, { data, kibanaLegacy }: TablePluginStartDependencies) {
public start(core: CoreStart, { data, opensearchDashboardsLegacy }: TablePluginStartDependencies) {
setFormatService(data.fieldFormats);
setKibanaLegacy(kibanaLegacy);
setOpensearchDashboardsLegacy(opensearchDashboardsLegacy);
setNotifications(core.notifications);
setQueryService(data.query);
setSearchService(data.search);
Expand Down
8 changes: 4 additions & 4 deletions public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
* under the License.
*/

import { createGetterSetter } from '../../../src/plugins/kibana_utils/public';
import { createGetterSetter } from '../../../src/plugins/opensearch_dashboards_utils/public';
import { NotificationsStart } from '../../../src/core/public';
import { DataPublicPluginStart } from '../../../src/plugins/data/public';
import { KibanaLegacyStart } from '../../../src/plugins/kibana_legacy/public';
import { OpensearchDashboardsLegacyStart } from '../../../src/plugins/opensearch_dashboards_legacy/public';

export const [getFormatService, setFormatService] = createGetterSetter<
DataPublicPluginStart['fieldFormats']
>('table data.fieldFormats');

export const [getKibanaLegacy, setKibanaLegacy] = createGetterSetter<KibanaLegacyStart>(
'table kibanaLegacy'
export const [getOpensearchDashboardsLegacy, setOpensearchDashboardsLegacy] = createGetterSetter<OpensearchDashboardsLegacyStart>(
'table opensearchDashboardsLegacy'
);

export const [getNotifications, setNotifications] = createGetterSetter<
Expand Down
4 changes: 2 additions & 2 deletions public/vis_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import $ from 'jquery';

import { VisParams, ExprVis } from '../../../src/plugins/visualizations/public';
import { getAngularModule } from './get_inner_angular';
import { getKibanaLegacy } from './services';
import { getOpensearchDashboardsLegacy } from './services';
import { initTableVisLegacyModule } from './table_vis_legacy_module';

const innerAngularName = 'kibana/kbn_network_vis';
Expand Down Expand Up @@ -65,7 +65,7 @@ export function getKbnNetworkVisualizationController(
}

async render(esResponse: object, visParams: VisParams) {
getKibanaLegacy().loadFontAwesome();
getOpensearchDashboardsLegacy().loadFontAwesome();
await this.initLocalAngular();

return new Promise(async (resolve, reject) => {
Expand Down

0 comments on commit 252a78a

Please sign in to comment.