mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[XY] Fixes the threshold visibility (#158917)
## Summary
Closes https://github.com/elastic/kibana/issues/158343
Fixes the broken reference line in aggbased xy charts.
<img width="1715" alt="image"
src="ae48f0b8
-475a-44e2-866a-c56e9da8e8b0">
The problem was the default here, apparently the expressions fail when
the default is an empty string. The expression was failing and as a
result the reference line was never rendered
### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
This commit is contained in:
parent
39a67ec337
commit
a584986721
3 changed files with 8 additions and 1 deletions
|
@ -108,7 +108,6 @@ export const referenceLineFunction: ReferenceLineFn = {
|
|||
forAccessor: {
|
||||
types: ['string'],
|
||||
help: '',
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
fn(table, args) {
|
||||
|
|
|
@ -248,6 +248,12 @@ export class VisualizeChartPageObject extends FtrService {
|
|||
return items.map(({ name }) => name);
|
||||
}
|
||||
|
||||
public async getReferenceLine(selector: string) {
|
||||
const items = (await this.getEsChartDebugState(selector))?.annotations;
|
||||
const referenceLine = items?.filter(({ type }) => type === 'line');
|
||||
return referenceLine;
|
||||
}
|
||||
|
||||
public async getLegendEntries() {
|
||||
const isVisTypePieChart = await this.isNewLibraryChart(partitionVisChartSelector);
|
||||
const isVisTypeHeatmapChart = await this.isNewLibraryChart(heatmapChartSelector);
|
||||
|
|
|
@ -205,6 +205,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await visEditor.clickOptionsTab();
|
||||
await visEditor.toggleShowThresholdLine();
|
||||
await visEditor.clickGo(isNewChartsLibraryEnabled);
|
||||
const line = await visChart.getReferenceLine('xyVisChart');
|
||||
expect(line?.length).to.be(1);
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
|
||||
await visualize.navigateToLensFromAnotherVisulization();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue