Skip to content

Commit

Permalink
Apply dataSource plugin as dependent for cm and dsm plugins (opensear…
Browse files Browse the repository at this point in the history
…ch-project#2150)

Signed-off-by: Louis Chu <[email protected]>

Apply dataSource plugin as dependent for cm and dsm plugins (opensearch-project#2150)
  • Loading branch information
noCharger authored and kristenTian committed Sep 14, 2022
1 parent 61f8725 commit 22ef83d
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "opensearchDashboards",
"server": false,
"ui": true,
"requiredPlugins": ["management"],
"requiredPlugins": ["management", "dataSource"],
"requiredBundles": ["opensearchDashboardsReact"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
EuiFieldPassword,
} from '@elastic/eui';
import { DocLinksStart } from 'src/core/public';
import { Credential } from '../../../../data_source/common';
import { Credential } from '../../../../data_source/public';

import { getCreateBreadcrumbs } from '../breadcrumbs';
import { CredentialManagmentContextValue } from '../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
EuiConfirmModal,
} from '@elastic/eui';
import { DocLinksStart } from 'src/core/public';
import { Credential } from '../../../../data_source/common';
import { Credential } from '../../../../data_source/public';

import { getCreateBreadcrumbs } from '../breadcrumbs';
import { CredentialManagmentContextValue } from '../../types';
Expand Down
7 changes: 1 addition & 6 deletions src/plugins/credential_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
import { i18n } from '@osd/i18n';

import { CoreSetup, CoreStart, Plugin } from '../../../core/public';

import { ManagementSetup } from '../../management/public';

export interface CredentialManagementSetupDependencies {
management: ManagementSetup;
}
import { CredentialManagementSetupDependencies } from './types';

const sectionsHeader = i18n.translate('credentialManagement.credential.sectionsHeader', {
defaultMessage: 'Credentials',
Expand Down
7 changes: 3 additions & 4 deletions src/plugins/credential_management/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import {
NotificationsStart,
DocLinksStart,
} from 'src/core/public';
import { NavigationPublicPluginStart } from '../../navigation/public';
import { ManagementAppMountParams } from '../../management/public';
import { ManagementAppMountParams, ManagementSetup } from 'src/plugins/management/public';

import { OpenSearchDashboardsReactContextValue } from '../../opensearch_dashboards_react/public';

export interface AppPluginStartDependencies {
navigation: NavigationPublicPluginStart;
export interface CredentialManagementSetupDependencies {
management: ManagementSetup;
}

export interface CredentialManagementContext {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data_source/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "opensearchDashboards",
"opensearchDashboardsVersion": "opensearchDashboards",
"server": true,
"ui": false,
"ui": true,
"requiredPlugins": [],
"optionalPlugins": []
}
16 changes: 16 additions & 0 deletions src/plugins/data_source/public/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { DataSourcePublicPlugin } from './plugin';

// This exports static code and TypeScript types,
// as well as, OpenSearch Dashboards Platform `plugin()` initializer.
export function plugin() {
return new DataSourcePublicPlugin();
}

export { DataSourcePublicPluginSetup, DataSourcePublicPluginStart } from './types';

export { Credential } from '../common';
20 changes: 20 additions & 0 deletions src/plugins/data_source/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { CoreSetup, CoreStart, Plugin } from '../../../core/public';
import { DataSourcePublicPluginSetup, DataSourcePublicPluginStart } from './types';

export class DataSourcePublicPlugin
implements Plugin<DataSourcePublicPluginSetup, DataSourcePublicPluginStart> {
public setup(core: CoreSetup): DataSourcePublicPluginSetup {
return {};
}

public start(core: CoreStart): DataSourcePublicPluginStart {
return {};
}

public stop() {}
}
10 changes: 10 additions & 0 deletions src/plugins/data_source/public/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DataSourcePublicPluginSetup {}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DataSourcePublicPluginStart {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "opensearchDashboards",
"server": false,
"ui": true,
"requiredPlugins": ["management", "credentialManagement"],
"requiredPlugins": ["management", "dataSource"],
"optionalPlugins": [],
"requiredBundles": ["opensearchDashboardsReact"]
}

0 comments on commit 22ef83d

Please sign in to comment.