Skip to content

Commit

Permalink
Leverage datasource enablement in index pattern management
Browse files Browse the repository at this point in the history
Signed-off-by: Kristen Tian <[email protected]>
  • Loading branch information
kristenTian committed Sep 14, 2022
1 parent 22ef83d commit 6d44289
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "opensearchDashboards",
"server": true,
"ui": true,
"optionalPlugins": ["dataSource"],
"requiredPlugins": ["management", "data", "urlForwarding"],
"requiredBundles": ["opensearchDashboardsReact", "opensearchDashboardsUtils", "savedObjects"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ export async function mountManagementSection(
) {
const [
{ chrome, application, savedObjects, uiSettings, notifications, overlays, http, docLinks },
{ data },
{ data, dataSource },
indexPatternManagementStart,
] = await getStartServices();
const canSave = Boolean(application.capabilities.indexPatterns.save);
const dataSourceEnabled = false;
// todo: Boolean(application.capabilities.indexPatterns.dataSourceEnabled) or get from plugin constructor; #2111
const dataSourceEnabled = !!dataSource;

if (!canSave) {
chrome.setBadge(readOnlyBadge);
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/index_pattern_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import { i18n } from '@osd/i18n';
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public';
import { DataPublicPluginStart } from 'src/plugins/data/public';
import { DataSourcePluginStart } from 'src/plugins/data_source/public';
import { UrlForwardingSetup } from '../../url_forwarding/public';
import {
IndexPatternManagementService,
Expand All @@ -47,6 +48,7 @@ export interface IndexPatternManagementSetupDependencies {

export interface IndexPatternManagementStartDependencies {
data: DataPublicPluginStart;
dataSource?: DataSourcePluginStart;
}

export type IndexPatternManagementSetup = IndexPatternManagementServiceSetup;
Expand Down

0 comments on commit 6d44289

Please sign in to comment.