Skip to content

Commit

Permalink
Register Data source to savedObject & Update license header
Browse files Browse the repository at this point in the history
Signed-off-by: Kristen Tian <tyarong@amazon.com>
  • Loading branch information
kristenTian committed Aug 2, 2022
1 parent 2abcc21 commit c60b185
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 72 deletions.
2 changes: 2 additions & 0 deletions src/plugins/data_source/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '

import { DataSourcePluginSetup, DataSourcePluginStart } from './types';

import { dataSource } from './saved_objects';
export class DataSourcePlugin implements Plugin<DataSourcePluginSetup, DataSourcePluginStart> {
private readonly logger: Logger;

Expand All @@ -16,6 +17,7 @@ export class DataSourcePlugin implements Plugin<DataSourcePluginSetup, DataSourc

public setup(core: CoreSetup) {
this.logger.debug('data_source: Setup');
core.savedObjects.registerType(dataSource);

return {};
}
Expand Down
37 changes: 37 additions & 0 deletions src/plugins/data_source/server/saved_objects/data_source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { SavedObjectsType } from 'opensearch-dashboards/server';

export const dataSource: SavedObjectsType = {
name: 'data-source',
namespaceType: 'agnostic',
hidden: false,
management: {
icon: 'apps', // todo: pending ux #2034
defaultSearchField: 'title',
importableAndExportable: true,
getTitle(obj) {
return obj.attributes.title;
},
// todo: update getEditUrl & getInAppUrl after #2021
},
mappings: {
dynamic: false,
properties: {
title: {
type: 'text',
},
endpoint: {
type: 'keyword',
index: false,
doc_values: false,
},
version: {
type: 'integer',
},
},
},
};
6 changes: 6 additions & 0 deletions src/plugins/data_source/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export { dataSource } from './data_source';
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export const PLUGIN_ID = 'dataSourceManagement';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"id": "dataSourceManagement",
"version": "1.0.0",
"opensearchDashboardsVersion": "opensearchDashboards",
"version": "opensearchDashboards",
"server": false,
"ui": true,
"requiredPlugins": ["management"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { EuiTitle } from '@elastic/eui';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export { CreateDataSourceWizardWithRouter } from './create_data_source_wizard';
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { EuiTitle } from '@elastic/eui';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export { DataSourceTableWithRouter } from './data_source_table';
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/public/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { DataSourceManagementPlugin } from './plugin';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export { mountManagementSection } from './mount_management_section';
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { StartServicesAccessor } from 'src/core/public';
Expand Down
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { CoreSetup, CoreStart, Plugin } from '../../../core/public';
Expand Down
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/public/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import {
Expand Down

0 comments on commit c60b185

Please sign in to comment.