Skip to content

Commit

Permalink
[Lens] lens_multitable removal. (#131699)
Browse files Browse the repository at this point in the history
* Removed lens_multitable from lens_datatable

* Removed lens_multitable from heatmap.

* Added datasource to the metric.

* Added datasource expression to pie.

* Added datasource expression to gauge.

* Fixed tests.

* Removed LensMultiTable.

* Removed additional `kibana` expression from the xy to_expression.

* Removed lens_multitable from x-pack/maps.

* Removed unused translation.

* Added `handlers.inspectorAdapters.tables.reset` to all the expressions from lens.

* Fixed choropleth chart.

* Fixed gauge tests.

* Fixed jest tests with inspector.tables.reset.

* Added tests for the new behavior.
  • Loading branch information
Kuznietsov authored May 11, 2022
1 parent 2e902ff commit 040efae
Show file tree
Hide file tree
Showing 67 changed files with 696 additions and 1,171 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe('interpreter/functions#gauge', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ export const gaugeFunction = (): GaugeExpressionFunctionDefinition => ({
}

if (handlers?.inspectorAdapters?.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const logTable = prepareLogTable(
data,
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe('interpreter/functions#heatmap', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export const heatmapFunction = (): HeatmapExpressionFunctionDefinition => ({
validateAccessor(args.splitColumnAccessor, data.columns);

if (handlers?.inspectorAdapters?.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const argsTable: Dimension[] = [];
if (args.valueAccessor) {
prepareHeatmapLogTable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe('interpreter/functions#metric', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
validateAccessor(args.bucket, input.columns);

if (handlers?.inspectorAdapters?.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const argsTable: Dimension[] = [
[
args.metric,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ describe('interpreter/functions#mosaicVis', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export const mosaicVisFunction = (): MosaicVisExpressionFunctionDefinition => ({
};

if (handlers?.inspectorAdapters?.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const logTable = prepareLogTable(
context,
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ describe('interpreter/functions#pieVis', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ export const pieVisFunction = (): PieVisExpressionFunctionDefinition => ({
};

if (handlers?.inspectorAdapters?.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const logTable = prepareLogTable(
context,
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ describe('interpreter/functions#treemapVis', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export const treemapVisFunction = (): TreemapVisExpressionFunctionDefinition =>
};

if (handlers?.inspectorAdapters?.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const logTable = prepareLogTable(
context,
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ describe('interpreter/functions#waffleVis', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ export const waffleVisFunction = (): WaffleVisExpressionFunctionDefinition => ({
};

if (handlers?.inspectorAdapters?.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const logTable = prepareLogTable(
context,
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ describe('interpreter/functions#tagcloud', () => {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
reset: () => {},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const XY_VIS = 'xyVis';
export const LAYERED_XY_VIS = 'layeredXyVis';
export const Y_CONFIG = 'yConfig';
export const EXTENDED_Y_CONFIG = 'extendedYConfig';
export const MULTITABLE = 'lens_multitable';
export const DATA_LAYER = 'dataLayer';
export const EXTENDED_DATA_LAYER = 'extendedDataLayer';
export const LEGEND_CONFIG = 'legendConfig';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export const xyVisFn: XyVisFn['fn'] = async (data, args, handlers) => {
];

if (handlers.inspectorAdapters.tables) {
handlers.inspectorAdapters.tables.reset();
handlers.inspectorAdapters.tables.allowCsvExport = true;

const layerDimensions = layers.reduce<Dimension[]>((dimensions, layer) => {
if (layer.layerType === LayerTypes.ANNOTATIONS) {
return dimensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type {
LegendConfig,
IconPosition,
DataLayerArgs,
LensMultiTable,
ValueLabelMode,
AxisExtentMode,
DataLayerConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
FittingFunctions,
IconPositions,
LayerTypes,
MULTITABLE,
LineStyles,
SeriesTypes,
ValueLabelModes,
Expand Down Expand Up @@ -296,15 +295,6 @@ export type XYExtendedLayerConfigResult =
| ExtendedReferenceLineLayerConfigResult
| ExtendedAnnotationLayerConfigResult;

export interface LensMultiTable {
type: typeof MULTITABLE;
tables: Record<string, Datatable>;
dateRange?: {
fromDate: Date;
toDate: Date;
};
}

export type ReferenceLineLayerConfigResult = ReferenceLineLayerArgs & {
type: typeof REFERENCE_LINE_LAYER;
layerType: typeof LayerTypes.REFERENCELINE;
Expand Down
Loading

0 comments on commit 040efae

Please sign in to comment.