Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uiSetting to adopt interface changes #2013

Open
wants to merge 2 commits into
base: 2.16
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
explorerSearchMetadata.datasources?.[0]?.type || ''
)
);
}, [explorerSearchMetadata.datasources, dataSourceOptionList]);

Check warning on line 181 in public/components/event_analytics/explorer/datasources/datasources_selection.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'memorizedDataSourceOptionList'. Either include it or remove the dependency array

const handleDataSetFetchError = useCallback(() => {
return (error: Error) => {
Expand Down Expand Up @@ -219,7 +219,7 @@
});

return () => subscription.unsubscribe();
}, []);

Check warning on line 222 in public/components/event_analytics/explorer/datasources/datasources_selection.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'dataSources.dataSourceService'. Either include it or remove the dependency array

/**
* Check for URL parameters to update the data source if redirected from discover.
Expand Down Expand Up @@ -267,7 +267,7 @@
);
}
}
}, []);

Check warning on line 270 in public/components/event_analytics/explorer/datasources/datasources_selection.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'dispatch', 'resetStateOnDataSourceChange', 'routerContext?.searchParams', and 'tabId'. Either include them or remove the dependency array

useEffect(() => {
// Execute a dummy query to initialize the cluster and obtain a sessionId for subsequent queries.
Expand All @@ -280,7 +280,7 @@
) {
runDummyQuery(dsName);
}
}, [explorerSearchMetadata.datasources]);

Check warning on line 283 in public/components/event_analytics/explorer/datasources/datasources_selection.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'runDummyQuery'. Either include it or remove the dependency array

/**
* Process the data source options to display different than discover's group names.
Expand Down Expand Up @@ -314,6 +314,7 @@
dataSourceSelectorConfigs={DATA_SOURCE_SELECTOR_CONFIGS}
onGetDataSetError={handleDataSetFetchError}
onRefresh={onRefresh}
uiSettings={coreRefs.uiSettings!}
/>
);
};
4 changes: 4 additions & 0 deletions public/framework/core_refs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
import { DashboardStart } from '../../../../src/plugins/dashboard/public';
import { DataSourcePluginStart } from '../../../../src/plugins/data_source/public';
import PPLService from '../services/requests/ppl';
import { DataSourceStart } from '../../../../src/plugins/data/public/data_sources/datasource_services/types';
import { IUiSettingsClient } from '../../../../src/core/public';

class CoreRefs {
private static _instance: CoreRefs;
Expand All @@ -34,6 +36,8 @@ class CoreRefs {
public dashboardProviders?: unknown;
public overlays?: OverlayStart;
public dataSource?: DataSourcePluginStart;
public dataSources?: DataSourceStart;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of these coreRefs have very similar names, is there plans to change the naming?

public uiSettings?: IUiSettingsClient;
private constructor() {
// ...
}
Expand Down
1 change: 1 addition & 0 deletions public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ export class ObservabilityPlugin
coreRefs.summarizeEnabled = this.config.summarize.enabled;
coreRefs.overlays = core.overlays;
coreRefs.dataSource = startDeps.dataSource;
coreRefs.uiSettings = core.uiSettings;

const { dataSourceService, dataSourceFactory } = startDeps.data.dataSources;
dataSourceFactory.registerDataSourceType(S3_DATA_SOURCE_TYPE, S3DataSource);
Expand Down
Loading