Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
Browse files Browse the repository at this point in the history
…-fix'
  • Loading branch information
kibanamachine committed Nov 13, 2023
1 parent bcda322 commit 91e6263
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import {
UserMessage,
} from '../../types';
import type {
ValueBasedPrivateState,
ValueBasedPersistedState,
ValueBasedLayerColumn,
ValueBasedPrivateState,
ValueBasedPersistedState,
ValueBasedLayerColumn,
} from './types';
import type { Datasource } from '../../types';
import { getUniqueLabelGenerator, nonNullable } from '../../utils';
Expand Down Expand Up @@ -55,7 +55,6 @@ export function getValueBasedDatasource({
expressions: ExpressionsStart;
dataViews: DataViewsPublicPluginStart;
}) {

const ValueBasedDatasource: Datasource<ValueBasedPrivateState, ValueBasedPersistedState> = {
id: 'valueBased',

Expand Down Expand Up @@ -90,12 +89,7 @@ export function getValueBasedDatasource({
return message;
});
},
initialize(
state?: ValueBasedPersistedState,
savedObjectReferences?,
context?,
) {

initialize(state?: ValueBasedPersistedState, savedObjectReferences?, context?) {
const initState = state || { layers: {} };
return {
...initState,
Expand Down Expand Up @@ -169,7 +163,6 @@ export function getValueBasedDatasource({
},
isTimeBased: (state, indexPatterns) => {
return false;

},
getUsedDataView: (state: ValueBasedPrivateState, layerId?: string) => {
return '';
Expand Down Expand Up @@ -268,8 +261,8 @@ export function getValueBasedDatasource({
getDatasourceSuggestionsForVisualizeField: () => {
return [];
},
getDatasourceSuggestionsFromCurrentState: () => ([]),
getDatasourceSuggestionsForVisualizeCharts: () => ([]),
getDatasourceSuggestionsFromCurrentState: () => [],
getDatasourceSuggestionsForVisualizeCharts: () => [],
isEqual: (
persistableState1: ValueBasedPersistedState,
references1: SavedObjectReference[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ function getExpressionForLayer(layer: ValueBasedLayer, layerId: string): Ast | n
arguments: {
name: [layerId],
},
},{
},
{
type: 'function',
function: 'lens_map_to_columns',
arguments: {
idMap: [JSON.stringify(idMapper)],
},
}
},
],
};
}
Expand Down
12 changes: 6 additions & 6 deletions x-pack/plugins/lens/public/embeddable/embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
DefaultInspectorAdapters,
ErrorLike,
ExpressionValue,
RenderMode
RenderMode,
} from '@kbn/expressions-plugin/common';
import { map, distinctUntilChanged, skip, debounceTime } from 'rxjs/operators';
import fastIsEqual from 'fast-deep-equal';
Expand Down Expand Up @@ -85,6 +85,7 @@ import {
import { DataViewSpec } from '@kbn/data-views-plugin/common';
import { FormattedMessage, I18nProvider } from '@kbn/i18n-react';
import { useEuiFontSize, useEuiTheme, EuiEmptyPrompt } from '@elastic/eui';
import { ValueBasedPersistedState } from '../datasources/value_based/types';
import { getExecutionContextEvents, trackUiCounterEvents } from '../lens_ui_telemetry';
import { Document } from '../persistence';
import { ExpressionWrapper, ExpressionWrapperProps } from './expression_wrapper';
Expand Down Expand Up @@ -142,7 +143,6 @@ import type { LensPluginStartDependencies } from '../plugin';
import { EmbeddableFeatureBadge } from './embeddable_info_badges';
import { getDatasourceLayers } from '../state_management/utils';
import type { EditLensConfigurationProps } from '../app_plugin/shared/edit_on_the_fly/get_edit_lens_configuration';
import {ValueBasedPersistedState} from "@kbn/lens-plugin/public/datasources/value_based/types";

export type LensSavedObjectAttributes = Omit<Document, 'savedObjectId' | 'type'>;

Expand Down Expand Up @@ -1078,14 +1078,14 @@ export class Embeddable

const getInternalTables = (states: Record<string, unknown>) => {
const result: Record<string, Datatable> = {};
const layers = (states['valueBased'] as ValueBasedPersistedState).layers;
const layers = (states.valueBased as ValueBasedPersistedState).layers;
if ('valueBased' in states) {
for (let layer in layers) {
for (const layer in layers) {
result[layer] = layers[layer].table;
}
}
return result;
}
};

if (this.expression && !blockingErrors.length) {
render(
Expand All @@ -1100,7 +1100,7 @@ export class Embeddable
embeddableTitle: this.getTitle(),
...(input.palette ? { theme: { palette: input.palette } } : {}),
...('overrides' in input ? { overrides: input.overrides } : {}),
...getInternalTables(this.savedVis.state.datasourceStates)
...getInternalTables(this.savedVis.state.datasourceStates),
}}
searchSessionId={this.getInput().searchSessionId}
handleEvent={this.handleEvent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
IEmbeddable,
useEmbeddableFactory,
} from '@kbn/embeddable-plugin/public';
import { ValueBasedPersistedState } from '../datasources/value_based/types';
import type { LensByReferenceInput, LensByValueInput } from './embeddable';
import type { Document } from '../persistence';
import type { FormBasedPersistedState } from '../datasources/form_based/types';
Expand All @@ -37,7 +38,6 @@ import type { DatatableVisualizationState } from '../visualizations/datatable/vi
import type { MetricVisualizationState } from '../visualizations/metric/types';
import type { HeatmapVisualizationState } from '../visualizations/heatmap/types';
import type { GaugeVisualizationState } from '../visualizations/gauge/constants';
import {ValueBasedPersistedState} from "@kbn/lens-plugin/public/datasources/value_based/types";

type LensAttributes<TVisType, TVisState> = Omit<
Document,
Expand Down

0 comments on commit 91e6263

Please sign in to comment.