diff --git a/src/plugins/region_map/config.ts b/src/plugins/region_map/config.ts index a721a76ca0a8..6ce019c18341 100644 --- a/src/plugins/region_map/config.ts +++ b/src/plugins/region_map/config.ts @@ -17,10 +17,10 @@ * under the License. */ -import { schema, TypeOf } from '@kbn/config-schema'; +import { schema, TypeOf } from '@osd/config-schema'; export const configSchema = schema.object({ - includeElasticMapsService: schema.boolean({ defaultValue: true }), + includeOpenSearchMapsService: schema.boolean({ defaultValue: true }), layers: schema.arrayOf( schema.object({ url: schema.string(), diff --git a/src/plugins/region_map/kibana.json b/src/plugins/region_map/opensearch_dashboards.json similarity index 70% rename from src/plugins/region_map/kibana.json rename to src/plugins/region_map/opensearch_dashboards.json index e679baf6d6f0..2f107a4156c4 100644 --- a/src/plugins/region_map/kibana.json +++ b/src/plugins/region_map/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "regionMap", "version": "8.0.0", - "kibanaVersion": "kibana", + "opensearchDashboardsVersion": "opensearchDashboards", "configPath": ["map", "regionmap"], "ui": true, "server": true, @@ -9,12 +9,12 @@ "visualizations", "expressions", "mapsLegacy", - "kibanaLegacy", + "opensearchDashboardsLegacy", "data", "share" ], "requiredBundles": [ - "kibanaUtils", + "opensearchDashboardsUtils", "charts", "visDefaultEditor" ] diff --git a/src/plugins/region_map/package.json b/src/plugins/region_map/package.json index 62274b3b9ae4..0f6226cc4c9f 100644 --- a/src/plugins/region_map/package.json +++ b/src/plugins/region_map/package.json @@ -1,4 +1,4 @@ { "name": "region_map", - "version": "kibana" + "version": "opensearchDashboards" } diff --git a/src/plugins/region_map/public/choropleth_layer.js b/src/plugins/region_map/public/choropleth_layer.js index 62f4ffe9be67..344aa45e79e7 100644 --- a/src/plugins/region_map/public/choropleth_layer.js +++ b/src/plugins/region_map/public/choropleth_layer.js @@ -20,10 +20,10 @@ import $ from 'jquery'; import _ from 'lodash'; import d3 from 'd3'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import * as topojson from 'topojson-client'; -import { getNotifications } from './kibana_services'; -import { colorUtil, KibanaMapLayer } from '../../maps_legacy/public'; +import { getNotifications } from './opensearch_dashboards_services'; +import { colorUtil, OpensearchDashboardsMapLayer } from '../../maps_legacy/public'; import { truncatedColorMaps } from '../../charts/public'; const EMPTY_STYLE = { @@ -33,19 +33,19 @@ const EMPTY_STYLE = { fillOpacity: 0, }; -export class ChoroplethLayer extends KibanaMapLayer { +export class ChoroplethLayer extends OpensearchDashboardsMapLayer { static _doInnerJoin(sortedMetrics, sortedGeojsonFeatures, joinField) { let j = 0; for (let i = 0; i < sortedGeojsonFeatures.length; i++) { const property = sortedGeojsonFeatures[i].properties[joinField]; - sortedGeojsonFeatures[i].__kbnJoinedMetric = null; + sortedGeojsonFeatures[i].__osdJoinedMetric = null; const position = sortedMetrics.length ? compareLexicographically(property, sortedMetrics[j].term) : -1; if (position === -1) { //just need to cycle on } else if (position === 0) { - sortedGeojsonFeatures[i].__kbnJoinedMetric = sortedMetrics[j]; + sortedGeojsonFeatures[i].__osdJoinedMetric = sortedMetrics[j]; } else if (position === 1) { //needs to catch up while (j < sortedMetrics.length) { @@ -54,7 +54,7 @@ export class ChoroplethLayer extends KibanaMapLayer { if (newPosition === -1) { //not far enough } else if (newPosition === 0) { - sortedGeojsonFeatures[i].__kbnJoinedMetric = sortedMetrics[j]; + sortedGeojsonFeatures[i].__osdJoinedMetric = sortedMetrics[j]; break; } else if (newPosition === 1) { //too far! @@ -186,7 +186,7 @@ Make sure the file exists at that location.", { defaultMessage: 'Cannot download {name} file. Please ensure the \ -CORS configuration of the server permits requests from the Kibana application on this host.', +CORS configuration of the server permits requests from the OpenSearch Dashboards application on this host.', values: { name: name }, } ); @@ -231,7 +231,7 @@ CORS configuration of the server permits requests from the Kibana application on if (!this._showAllShapes) { const featureCollection = { type: 'FeatureCollection', - features: this._sortedFeatures.filter((feature) => feature.__kbnJoinedMetric), + features: this._sortedFeatures.filter((feature) => feature.__osdJoinedMetric), }; this._leafletLayer.addData(featureCollection); } @@ -440,7 +440,7 @@ CORS configuration of the server permits requests from the Kibana application on const boundsOfAllFeatures = new this._leaflet.LatLngBounds(); return { leafletStyleFunction: (geojsonFeature) => { - const match = geojsonFeature.__kbnJoinedMetric; + const match = geojsonFeature.__osdJoinedMetric; if (!match) { return emptyStyle(); } @@ -463,7 +463,7 @@ CORS configuration of the server permits requests from the Kibana application on getMismatches: () => { const mismatches = this._metrics.slice(); this._sortedFeatures.forEach((feature) => { - const index = mismatches.indexOf(feature.__kbnJoinedMetric); + const index = mismatches.indexOf(feature.__osdJoinedMetric); if (index >= 0) { mismatches.splice(index, 1); } diff --git a/src/plugins/region_map/public/components/region_map_options.tsx b/src/plugins/region_map/public/components/region_map_options.tsx index 4d564d7347a1..1510a81076e1 100644 --- a/src/plugins/region_map/public/components/region_map_options.tsx +++ b/src/plugins/region_map/public/components/region_map_options.tsx @@ -19,8 +19,8 @@ import React, { useCallback, useMemo } from 'react'; import { EuiIcon, EuiLink, EuiPanel, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@osd/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; import { VisOptionsProps } from 'src/plugins/vis_default_editor/public'; import { FileLayerField, VectorLayer, IServiceSettings } from '../../../maps_legacy/public'; import { NumberInputOption, SelectOption, SwitchOption } from '../../../charts/public'; @@ -111,7 +111,7 @@ function RegionMapOptions(props: RegionMapOptionsProps) { href={stateParams.emsHotLink} target="_blank" title={i18n.translate('regionMap.visParams.previewOnEMSLinkTitle', { - defaultMessage: 'Preview {selectedLayerName} on the Elastic Maps Service', + defaultMessage: 'Preview {selectedLayerName} on the OpenSearch Maps Service', values: { selectedLayerName: stateParams.selectedLayer && stateParams.selectedLayer.name, diff --git a/src/plugins/region_map/public/get_deprecation_message.tsx b/src/plugins/region_map/public/get_deprecation_message.tsx index ea5cdf42c311..f8d8f1d0e4ea 100644 --- a/src/plugins/region_map/public/get_deprecation_message.tsx +++ b/src/plugins/region_map/public/get_deprecation_message.tsx @@ -17,10 +17,10 @@ * under the License. */ -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import React from 'react'; import { UrlGeneratorContract } from 'src/plugins/share/public'; -import { getCoreService, getQueryService, getShareService } from './kibana_services'; +import { getCoreService, getQueryService, getShareService } from './opensearch_dashboards_services'; import { Vis } from '../../visualizations/public'; import { LegacyMapDeprecationMessage } from '../../maps_legacy/public'; diff --git a/src/plugins/region_map/public/index.ts b/src/plugins/region_map/public/index.ts index 3f920ad16683..b36565005120 100644 --- a/src/plugins/region_map/public/index.ts +++ b/src/plugins/region_map/public/index.ts @@ -17,11 +17,11 @@ * under the License. */ -import { PluginInitializerContext } from 'kibana/public'; +import { PluginInitializerContext } from 'opensearch-dashboards/public'; import { RegionMapPlugin as Plugin } from './plugin'; export interface RegionMapsConfigType { - includeElasticMapsService: boolean; + includeOpenSearchMapsService: boolean; layers: any[]; } diff --git a/src/plugins/region_map/public/kibana_services.ts b/src/plugins/region_map/public/opensearch_dashboards_services.ts similarity index 76% rename from src/plugins/region_map/public/kibana_services.ts rename to src/plugins/region_map/public/opensearch_dashboards_services.ts index 7edbf2da36fc..b2325be01923 100644 --- a/src/plugins/region_map/public/kibana_services.ts +++ b/src/plugins/region_map/public/opensearch_dashboards_services.ts @@ -17,11 +17,11 @@ * under the License. */ -import { CoreStart } from 'kibana/public'; -import { NotificationsStart } from 'kibana/public'; -import { createGetterSetter } from '../../kibana_utils/public'; +import { CoreStart } from 'opensearch-dashboards/public'; +import { NotificationsStart } from 'opensearch-dashboards/public'; +import { createGetterSetter } from '../../opensearch_dashboards_utils/public'; import { DataPublicPluginStart } from '../../data/public'; -import { KibanaLegacyStart } from '../../kibana_legacy/public'; +import { OpenSearchDashboardsLegacyStart } from '../../opensearch_dashboards_legacy/public'; import { SharePluginStart } from '../../share/public'; export const [getCoreService, setCoreService] = createGetterSetter('Core'); @@ -40,6 +40,6 @@ export const [getQueryService, setQueryService] = createGetterSetter< export const [getShareService, setShareService] = createGetterSetter('Share'); -export const [getKibanaLegacy, setKibanaLegacy] = createGetterSetter( - 'KibanaLegacy' +export const [getOpenSearchDashboardsLegacy, setOpenSearchDashboardsLegacy] = createGetterSetter( + 'OpenSearchDashboardsLegacy' ); diff --git a/src/plugins/region_map/public/plugin.ts b/src/plugins/region_map/public/plugin.ts index e9978803ad5e..c30d88b71f28 100644 --- a/src/plugins/region_map/public/plugin.ts +++ b/src/plugins/region_map/public/plugin.ts @@ -23,7 +23,7 @@ import { PluginInitializerContext, IUiSettingsClient, NotificationsStart, -} from 'kibana/public'; +} from 'opensearch-dashboards/public'; import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public'; import { VisualizationsSetup } from '../../visualizations/public'; // @ts-ignore @@ -35,14 +35,14 @@ import { setCoreService, setFormatService, setNotifications, - setKibanaLegacy, + setOpenSearchDashboardsLegacy, setQueryService, setShareService, -} from './kibana_services'; +} from './opensearch_dashboards_services'; import { DataPublicPluginStart } from '../../data/public'; import { RegionMapsConfigType } from './index'; import { MapsLegacyConfig } from '../../maps_legacy/config'; -import { KibanaLegacyStart } from '../../kibana_legacy/public'; +import { OpenSearchDashboardsLegacyStart } from '../../opensearch_dashboards_legacy/public'; import { SharePluginStart } from '../../share/public'; /** @private */ @@ -64,13 +64,13 @@ export interface RegionMapPluginSetupDependencies { export interface RegionMapPluginStartDependencies { data: DataPublicPluginStart; notifications: NotificationsStart; - kibanaLegacy: KibanaLegacyStart; + opensearchDashboardsLegacy: OpenSearchDashboardsLegacyStart; share: SharePluginStart; } /** @internal */ export interface RegionMapsConfig { - includeElasticMapsService: boolean; + includeOpenSearchMapsService: boolean; layers: any[]; } @@ -122,7 +122,7 @@ export class RegionMapPlugin implements Plugin ({ name: 'regionmap', type: 'render', context: { - types: ['kibana_datatable'], + types: ['opensearch_dashboards_datatable'], }, help: i18n.translate('regionMap.function.help', { defaultMessage: 'Regionmap visualization', diff --git a/src/plugins/region_map/public/region_map_fn.test.js b/src/plugins/region_map/public/region_map_fn.test.js index 684cc5e897df..b7fdfe77f026 100644 --- a/src/plugins/region_map/public/region_map_fn.test.js +++ b/src/plugins/region_map/public/region_map_fn.test.js @@ -24,7 +24,7 @@ import { createRegionMapFn } from './region_map_fn'; describe('interpreter/functions#regionmap', () => { const fn = functionWrapper(createRegionMapFn()); const context = { - type: 'kibana_datatable', + type: 'opensearch_dashboards_datatable', rows: [{ 'col-0-1': 0 }], columns: [{ id: 'col-0-1', name: 'Count' }], }; diff --git a/src/plugins/region_map/public/region_map_type.js b/src/plugins/region_map/public/region_map_type.js index ec32d582ce15..61601c6c7d6d 100644 --- a/src/plugins/region_map/public/region_map_type.js +++ b/src/plugins/region_map/public/region_map_type.js @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { mapToLayerWithId } from './util'; import { createRegionMapVisualization } from './region_map_visualization'; import { RegionMapOptions } from './components/region_map_options'; @@ -109,11 +109,11 @@ provided base maps, or add your own. Darker colors represent higher values.', } const vectorLayers = regionmapsConfig.layers.map( - mapToLayerWithId.bind(null, ORIGIN.KIBANA_YML) + mapToLayerWithId.bind(null, ORIGIN.OPENSEARCH_DASHBOARDS_YML) ); let selectedLayer = vectorLayers[0]; let selectedJoinField = selectedLayer ? selectedLayer.fields[0] : null; - if (regionmapsConfig.includeElasticMapsService) { + if (regionmapsConfig.includeOpenSearchMapsService) { const layers = await serviceSettings.getFileLayers(); const newLayers = layers .map(mapToLayerWithId.bind(null, ORIGIN.EMS)) diff --git a/src/plugins/region_map/public/region_map_visualization.js b/src/plugins/region_map/public/region_map_visualization.js index ecb3541827cb..53137231d19b 100644 --- a/src/plugins/region_map/public/region_map_visualization.js +++ b/src/plugins/region_map/public/region_map_visualization.js @@ -17,8 +17,8 @@ * under the License. */ -import { i18n } from '@kbn/i18n'; -import { getFormatService, getNotifications, getKibanaLegacy } from './kibana_services'; +import { i18n } from '@osd/i18n'; +import { getFormatService, getNotifications, getOpenSearchDashboardsLegacy } from './opensearch_dashboards_services'; import { truncatedColorMaps } from '../../charts/public'; import { tooltipFormatter } from './tooltip_formatter'; import { mapTooltipProvider, ORIGIN, lazyLoadMapsLegacyModules } from '../../maps_legacy/public'; @@ -37,9 +37,9 @@ export function createRegionMapVisualization({ this._tooltipFormatter = mapTooltipProvider(container, tooltipFormatter); } - async render(esResponse, visParams) { - getKibanaLegacy().loadFontAwesome(); - await super.render(esResponse, visParams); + async render(opensearchResponse, visParams) { + getOpenSearchDashboardsLegacy().loadFontAwesome(); + await super.render(opensearchResponse, visParams); if (this._choroplethLayer) { await this._choroplethLayer.whenDataLoaded(); } @@ -88,7 +88,7 @@ export function createRegionMapVisualization({ ); } - this._kibanaMap.useUiStateFromVisualization(this._vis); + this._opensearchDashboardsMap.useUiStateFromVisualization(this._vis); } async _loadConfig(fileLayerConfig) { @@ -106,7 +106,7 @@ export function createRegionMapVisualization({ return await serviceSettings.loadFileLayerConfig(fileLayerConfig); } - //Configured in the kibana.yml. Needs to be resolved through the settings. + //Configured in the opensearch_dashboards.yml. Needs to be resolved through the settings. const configuredLayer = regionmapsConfig.layers.find( (layer) => layer.name === fileLayerConfig.name ); @@ -171,7 +171,7 @@ export function createRegionMapVisualization({ async _recreateChoroplethLayer(name, attribution, showAllData) { const selectedLayer = await this._loadConfig(this._params.selectedLayer); - this._kibanaMap.removeLayer(this._choroplethLayer); + this._opensearchDashboardsMap.removeLayer(this._choroplethLayer); if (this._choroplethLayer) { this._choroplethLayer = this._choroplethLayer.cloneChoroplethLayerForNewData( @@ -233,7 +233,7 @@ export function createRegionMapVisualization({ } }); - this._kibanaMap.addLayer(this._choroplethLayer); + this._opensearchDashboardsMap.addLayer(this._choroplethLayer); } _hasColumns() { diff --git a/src/plugins/region_map/server/index.ts b/src/plugins/region_map/server/index.ts index f4684e1c6034..5b79a8918d11 100644 --- a/src/plugins/region_map/server/index.ts +++ b/src/plugins/region_map/server/index.ts @@ -17,14 +17,14 @@ * under the License. */ -import { PluginConfigDescriptor } from 'kibana/server'; +import { PluginConfigDescriptor } from 'opensearch-dashboards/server'; import { CoreSetup } from 'src/core/server'; import { configSchema, ConfigSchema } from '../config'; import { getUiSettings } from './ui_settings'; export const config: PluginConfigDescriptor = { exposeToBrowser: { - includeElasticMapsService: true, + includeOpenSearchMapsService: true, layers: true, }, schema: configSchema, diff --git a/src/plugins/region_map/server/ui_settings.ts b/src/plugins/region_map/server/ui_settings.ts index 9c404676b9ff..89b4be6f0f9b 100644 --- a/src/plugins/region_map/server/ui_settings.ts +++ b/src/plugins/region_map/server/ui_settings.ts @@ -17,9 +17,9 @@ * under the License. */ -import { i18n } from '@kbn/i18n'; -import { UiSettingsParams } from 'kibana/server'; -import { schema } from '@kbn/config-schema'; +import { i18n } from '@osd/i18n'; +import { UiSettingsParams } from 'opensearch-dashboards/server'; +import { schema } from '@osd/config-schema'; export function getUiSettings(): Record> { return {