Skip to content

Commit

Permalink
🔥 remove old cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Aug 12, 2022
1 parent 8510724 commit 1b64dda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/lens/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ export interface Visualization<T = unknown> {
/** Optional, if the visualization supports multiple layers */
removeLayer?: (state: T, layerId: string) => T;
/** Track added layers in internal state */
appendLayer?: (state: T, layerId: string, type: LayerType, indexPatternId?: string) => T;
appendLayer?: (state: T, layerId: string, type: LayerType) => T;

/** Retrieve a list of supported layer types with initialization data */
getSupportedLayers: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const getXyVisualization = ({
};
},

appendLayer(state, layerId, layerType, indexPatternId) {
appendLayer(state, layerId, layerType) {
const firstUsedSeriesType = getDataLayers(state.layers)?.[0]?.seriesType;
return {
...state,
Expand All @@ -131,7 +131,6 @@ export const getXyVisualization = ({
seriesType: firstUsedSeriesType || state.preferredSeriesType,
layerId,
layerType,
indexPatternId: indexPatternId ?? core.uiSettings.get('defaultIndex'),
}),
],
};
Expand All @@ -146,7 +145,6 @@ export const getXyVisualization = ({
: newLayerState({
seriesType: state.preferredSeriesType,
layerId,
indexPatternId: core.uiSettings.get('defaultIndex'),
})
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,7 @@ const newLayerFn = {
layerType: layerTypes.REFERENCELINE,
accessors: [],
}),
[layerTypes.ANNOTATIONS]: ({
layerId,
indexPatternId,
}: {
layerId: string;
indexPatternId: string;
}): XYAnnotationLayerConfig => ({
[layerTypes.ANNOTATIONS]: ({ layerId }: { layerId: string }): XYAnnotationLayerConfig => ({
layerId,
layerType: layerTypes.ANNOTATIONS,
annotations: [],
Expand All @@ -294,14 +288,12 @@ export function newLayerState({
layerId,
layerType = layerTypes.DATA,
seriesType,
indexPatternId,
}: {
layerId: string;
layerType?: LayerType;
seriesType: SeriesType;
indexPatternId: string;
}) {
return newLayerFn[layerType]({ layerId, seriesType, indexPatternId });
return newLayerFn[layerType]({ layerId, seriesType });
}

export function getLayersByType(state: State, byType?: string) {
Expand Down

0 comments on commit 1b64dda

Please sign in to comment.