Skip to content

Commit

Permalink
Fix visualize a field through discover app (#73652) (#73800)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
sulemanof and elasticmachine committed Jul 31, 2020
1 parent 6de8764 commit 079d346
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function getVisualizeUrl(
params: {
field: field.name,
size: parseInt(aggsTermSize, 10),
orderBy: '2',
orderBy: '1',
},
};
}
Expand All @@ -169,7 +169,7 @@ export function getVisualizeUrl(
query: state.query,
vis: {
type,
aggs: [{ schema: 'metric', type: 'count', id: '2' }, agg],
aggs: [{ schema: 'metric', type: 'count', id: '1' }, agg],
},
} as any),
},
Expand Down
9 changes: 8 additions & 1 deletion test/functional/apps/discover/_field_visualize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const log = getService('log');
const queryBar = getService('queryBar');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'visualize']);
const defaultSettings = {
defaultIndex: 'logstash-*',
};
Expand All @@ -48,6 +48,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.timePicker.setDefaultAbsoluteRange();
});

it('should be able to visualize a field and save the visualization', async () => {
await PageObjects.discover.findFieldByName('type');
log.debug('visualize a type field');
await PageObjects.discover.clickFieldListItemVisualize('type');
await PageObjects.visualize.saveVisualizationExpectSuccess('Top 5 server types');
});

it('should visualize a field in area chart', async () => {
await PageObjects.discover.findFieldByName('phpmemory');
log.debug('visualize a phpmemory field');
Expand Down

0 comments on commit 079d346

Please sign in to comment.