-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Visualize] Renders no data component if there is no ES data or datav…
…iew (#132223) * [Visualize] Renders no data component if there is no ES data or dataview * Fix types * Adds a functional test * Fix FTs * Fix * Fix no data test * Changes on the dashboard save test * Add a loader before the data being fetched * Add check for default dataview * A small nit * Address PR comments
- Loading branch information
Showing
11 changed files
with
189 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const retry = getService('retry'); | ||
const testSubjects = getService('testSubjects'); | ||
const PageObjects = getPageObjects(['visualize', 'header', 'common']); | ||
const esArchiver = getService('esArchiver'); | ||
const find = getService('find'); | ||
const kibanaServer = getService('kibanaServer'); | ||
|
||
const createDataView = async (dataViewName: string) => { | ||
await testSubjects.setValue('createIndexPatternNameInput', dataViewName, { | ||
clearWithKeyboard: true, | ||
typeCharByChar: true, | ||
}); | ||
await testSubjects.click('saveIndexPatternButton'); | ||
}; | ||
|
||
describe('no data in visualize', function () { | ||
it('should show the integrations component if there is no data', async () => { | ||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); | ||
await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash'); | ||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); | ||
await PageObjects.common.navigateToApp('visualize'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const addIntegrations = await testSubjects.find('kbnOverviewAddIntegrations'); | ||
await addIntegrations.click(); | ||
await PageObjects.common.waitUntilUrlIncludes('integrations/browse'); | ||
}); | ||
|
||
it('should show the no dataview component if no dataviews exist', async function () { | ||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); | ||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); | ||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); | ||
await PageObjects.common.navigateToApp('visualize'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
const button = await testSubjects.find('createDataViewButtonFlyout'); | ||
button.click(); | ||
await retry.waitForWithTimeout('index pattern editor form to be visible', 15000, async () => { | ||
return await (await find.byClassName('indexPatternEditor__form')).isDisplayed(); | ||
}); | ||
|
||
const dataViewToCreate = 'logstash'; | ||
await createDataView(dataViewToCreate); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
await retry.waitForWithTimeout( | ||
'data view selector to include a newly created dataview', | ||
5000, | ||
async () => { | ||
const addNewVizButton = await testSubjects.exists('newItemButton'); | ||
expect(addNewVizButton).to.be(true); | ||
return addNewVizButton; | ||
} | ||
); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters