Skip to content

Commit

Permalink
[Canvas] Improvements to datasource expressions including SQL paramet…
Browse files Browse the repository at this point in the history
…er support and array leniency (#99549) (#103527)

* Remove es sql strategy from behind Labs project, remove legacy essql code, remove last spot of legacy elasticsearch client from canvas

* clean up test

* fix es field test

* remove comment

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Poff Poffenberger <[email protected]>
  • Loading branch information
kibanamachine and poffdeluxe authored Jun 28, 2021
1 parent a8f3ef1 commit b3c920d
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 556 deletions.
19 changes: 1 addition & 18 deletions src/plugins/presentation_util/common/labs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
import { i18n } from '@kbn/i18n';

export const LABS_PROJECT_PREFIX = 'labs:';
export const USE_DATA_SERVICE = `${LABS_PROJECT_PREFIX}canvas:useDataService` as const;
export const TIME_TO_PRESENT = `${LABS_PROJECT_PREFIX}presentation:timeToPresent` as const;
export const DEFER_BELOW_FOLD = `${LABS_PROJECT_PREFIX}dashboard:deferBelowFold` as const;

export const projectIDs = [TIME_TO_PRESENT, USE_DATA_SERVICE, DEFER_BELOW_FOLD] as const;
export const projectIDs = [TIME_TO_PRESENT, DEFER_BELOW_FOLD] as const;
export const environmentNames = ['kibana', 'browser', 'session'] as const;
export const solutionNames = ['canvas', 'dashboard', 'presentation'] as const;

Expand All @@ -35,22 +34,6 @@ export const projects: { [ID in ProjectID]: ProjectConfig & { id: ID } } = {
}),
solutions: ['canvas'],
},
[USE_DATA_SERVICE]: {
id: USE_DATA_SERVICE,
isActive: true,
isDisplayed: true,
environments: ['kibana', 'browser', 'session'],
name: i18n.translate('presentationUtil.experiments.enableUseDataServiceExperimentName', {
defaultMessage: 'Use data service',
}),
description: i18n.translate(
'presentationUtil.experiments.enableUseDataServiceExperimentDescription',
{
defaultMessage: 'An experiment of using the new data.search service for Canvas datasources',
}
),
solutions: ['canvas'],
},
[DEFER_BELOW_FOLD]: {
id: DEFER_BELOW_FOLD,
isActive: false,
Expand Down

This file was deleted.

114 changes: 0 additions & 114 deletions x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts

This file was deleted.

61 changes: 0 additions & 61 deletions x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
*/

import { demodata } from './demodata';
import { escount } from './escount';
import { esdocs } from './esdocs';
import { pointseries } from './pointseries';
import { essql } from './essql';

export const functions = [demodata, esdocs, escount, essql, pointseries];
export const functions = [demodata, pointseries];
12 changes: 1 addition & 11 deletions x-pack/plugins/canvas/public/services/expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export const expressionsServiceFactory: CanvasServiceFactory<ExpressionsService>
const loadServerFunctionWrappers = async () => {
if (!cached) {
cached = (async () => {
const labService = startPlugins.presentationUtil.labsService;
const hasDataSearch = labService.isProjectEnabled('labs:canvas:useDataService');
const dataSearchFns = ['essql', 'esdocs', 'escount'];

const serverFunctionList = await coreSetup.http.get(API_ROUTE_FUNCTIONS);
const batchedFunction = bfetch.batchedFunction({ url: API_ROUTE_FUNCTIONS });
const { serialize } = serializeProvider(expressions.getTypes());
Expand All @@ -36,13 +32,7 @@ export const expressionsServiceFactory: CanvasServiceFactory<ExpressionsService>
// function that matches its definition, but which simply
// calls the server-side function endpoint.
Object.keys(serverFunctionList).forEach((functionName) => {
// Allow function to be overwritten if we want to use
// the server-hosted essql, esdocs, and escount functions
if (dataSearchFns.includes(functionName)) {
if (hasDataSearch && expressions.getFunction(functionName)) {
return;
}
} else if (expressions.getFunction(functionName)) {
if (expressions.getFunction(functionName)) {
return;
}

Expand Down
Loading

0 comments on commit b3c920d

Please sign in to comment.