Skip to content

Commit

Permalink
adds commit from 2.2 into 2.x (#42)
Browse files Browse the repository at this point in the history
Signed-off-by: Shivam Dhar <dhshivam@amazon.com>
  • Loading branch information
Shivamdhar committed Sep 7, 2022
1 parent 02fb05e commit aa7a551
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"serverSourcePatterns": [
"package.json",
"tsconfig.json",
"yarn.lock",
".yarnrc",
"{lib,public,server,webpackShims,translations,utils,models,test,common}/**/*",
"!__tests__"
]
}
4 changes: 2 additions & 2 deletions src/plugins/custom_import_map/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "customImportMapDashboards",
"version": "2.2.0.0",
"opensearchDashboardsVersion": "2.2.0",
"version": "2.2.1.0",
"opensearchDashboardsVersion": "2.2.1",
"server": true,
"ui": true,
"requiredPlugins": ["regionMap", "opensearchDashboardsReact"],
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/custom_import_map/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "customImportMap",
"version": "2.2.0.0",
"version": "2.2.1.0",
"license": "Apache-2.0",
"config": {
"id": "customImportMapDashboards"
Expand Down
23 changes: 16 additions & 7 deletions src/plugins/custom_import_map/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,29 @@ import {
} from './types';
import { RegionMapVisualizationDependencies } from '../../../src/plugins/region_map/public';
import { VectorUploadOptions } from './components/vector_upload_options';
import { OpenSearchDashboardsContextProvider } from '../../../src/plugins/opensearch_dashboards_react/public';

export class CustomImportMapPlugin
implements Plugin<CustomImportMapPluginSetup, CustomImportMapPluginStart> {
public setup(
core: CoreSetup,
{ regionMap }: AppPluginSetupDependencies
): CustomImportMapPluginSetup {
regionMap.addOptionTab({
name: 'controls',
title: i18n.translate('regionMap.mapVis.regionMapEditorConfig.controlTabs.controlsTitle', {
defaultMessage: 'Import Vector Map',
}),
editor: (props: RegionMapVisualizationDependencies) => <VectorUploadOptions {...props} />,
});
const customSetup = async () => {
const [coreStart] = await core.getStartServices();
regionMap.addOptionTab({
name: 'controls',
title: i18n.translate('regionMap.mapVis.regionMapEditorConfig.controlTabs.controlsTitle', {
defaultMessage: 'Import Vector Map',
}),
editor: (props: RegionMapVisualizationDependencies) => (
<OpenSearchDashboardsContextProvider services={coreStart}>
<VectorUploadOptions {...props} />
</OpenSearchDashboardsContextProvider>
),
});
};
customSetup();

// Return methods that should be available to other plugins
return {};
Expand Down
1 change: 1 addition & 0 deletions src/plugins/custom_import_map/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"types": ["node", "jest", "react"]
},
"include": [
"common/**/*",
"server/**/*",
"public/**/*",
"utils/**/*",
Expand Down

0 comments on commit aa7a551

Please sign in to comment.