forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover] Set data table row height to auto-fit by default (elastic#…
…164218) - Closes elastic#164285 This PR changes the default value of "rowHeight" setting to be "Auto-fit". <img width="600" alt="Screenshot 2023-08-17 at 19 46 03" src="https://github.com/elastic/kibana/assets/1415710/44cc2cc6-8bbd-41a9-b34c-94a189edbd7b"> When testing, make sure to delete "discover:dataGridRowHeight" from the browser localStorage, refresh the page and press "New" in Discover. Partially addresses elastic#131130 (it can still hide "Reset" after page reload) --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
b796f13
commit 0f07497
Showing
11 changed files
with
136 additions
and
19 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
89 changes: 89 additions & 0 deletions
89
test/functional/apps/discover/group2/_data_grid_row_height.ts
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,89 @@ | ||
/* | ||
* 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 browser = getService('browser'); | ||
const esArchiver = getService('esArchiver'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const dataGrid = getService('dataGrid'); | ||
const PageObjects = getPageObjects(['settings', 'common', 'discover', 'header', 'timePicker']); | ||
const defaultSettings = { defaultIndex: 'logstash-*' }; | ||
const security = getService('security'); | ||
|
||
describe('discover data grid row height', function describeIndexTests() { | ||
before(async () => { | ||
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); | ||
await browser.setWindowSize(1200, 2000); | ||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); | ||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); | ||
}); | ||
|
||
after(async () => { | ||
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); | ||
await kibanaServer.uiSettings.replace({}); | ||
await kibanaServer.savedObjects.cleanStandardList(); | ||
}); | ||
|
||
beforeEach(async function () { | ||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); | ||
await kibanaServer.uiSettings.update(defaultSettings); | ||
await PageObjects.common.navigateToApp('discover'); | ||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
}); | ||
|
||
it('should use the default row height', async () => { | ||
const rows = await dataGrid.getDocTableRows(); | ||
expect(rows.length).to.be.above(0); | ||
|
||
await dataGrid.clickGridSettings(); | ||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); | ||
}); | ||
|
||
it('should allow to change row height and reset it', async () => { | ||
await dataGrid.clickGridSettings(); | ||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); | ||
|
||
await dataGrid.changeRowHeightValue('Single'); | ||
|
||
// toggle the popover | ||
await dataGrid.clickGridSettings(); | ||
await dataGrid.clickGridSettings(); | ||
|
||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Single'); | ||
|
||
await dataGrid.resetRowHeightValue(); | ||
|
||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); | ||
|
||
await dataGrid.changeRowHeightValue('Custom'); | ||
|
||
await dataGrid.resetRowHeightValue(); | ||
|
||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); | ||
}); | ||
|
||
it('should persist the selection after reloading the page', async () => { | ||
await dataGrid.clickGridSettings(); | ||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Auto fit'); | ||
|
||
await dataGrid.changeRowHeightValue('Single'); | ||
|
||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Single'); | ||
|
||
await browser.refresh(); | ||
|
||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
await dataGrid.clickGridSettings(); | ||
|
||
expect(await dataGrid.getCurrentRowHeightValue()).to.be('Single'); | ||
}); | ||
}); | ||
} |
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