Skip to content

Commit

Permalink
Fix wrong suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Nov 5, 2024
1 parent 6daa2c8 commit cf707f8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
14 changes: 7 additions & 7 deletions packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ type LensToChartMap = {
[K in ValueOf<typeof LensVisualizationType>]: ChartType;
};
const lensTypesToChartTypes: LensToChartMap = {
[LensVisualizationType.XY]: ChartType.XY,
[LensVisualizationType.Metric]: ChartType.Metric,
[LensVisualizationType.LegacyMetric]: ChartType.Metric,
[LensVisualizationType.Pie]: ChartType.Pie,
[LensVisualizationType.Heatmap]: ChartType.Heatmap,
[LensVisualizationType.Gauge]: ChartType.Gauge,
[LensVisualizationType.Datatable]: ChartType.Table,
[LensVisualizationType.lnsXY]: ChartType.XY,
[LensVisualizationType.lnsMetric]: ChartType.Metric,
[LensVisualizationType.lnsLegacyMetric]: ChartType.Metric,
[LensVisualizationType.lnsPie]: ChartType.Pie,
[LensVisualizationType.lnsHeatmap]: ChartType.Heatmap,
[LensVisualizationType.lnsGauge]: ChartType.Gauge,
[LensVisualizationType.lnsDatatable]: ChartType.Table,
};
function isLensVisualizationType(value: string): value is LensVisualizationType {
return value in LensVisualizationType;
Expand Down
14 changes: 7 additions & 7 deletions packages/kbn-visualization-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export enum ChartType {
}

export enum LensVisualizationType {
XY = 'lnsXY',
Metric = 'lnsMetric',
Pie = 'lnsPie',
Heatmap = 'lnsHeatmap',
Gauge = 'lnsGauge',
Datatable = 'lnsDatatable',
LegacyMetric = 'lnsLegacyMetric',
lnsXY = 'lnsXY',
lnsMetric = 'lnsMetric',
lnsPie = 'lnsPie',
lnsHeatmap = 'lnsHeatmap',
lnsGauge = 'lnsGauge',
lnsDatatable = 'lnsDatatable',
lnsLegacyMetric = 'lnsLegacyMetric',
}
6 changes: 5 additions & 1 deletion x-pack/plugins/lens/public/lens_suggestions_api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export function mergeSuggestionWithVisContext({
keptLayerIds: layerIds,
datasourceState,
datasourceId,
} as Suggestion;
columns: suggestion.columns,
changeType: suggestion.changeType,
score: suggestion.score,
previewIcon: suggestion.previewIcon,
};
} catch {
return suggestion;
}
Expand Down

0 comments on commit cf707f8

Please sign in to comment.