-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lens] update default legend size to medium #130336
Merged
drewdaemon
merged 52 commits into
elastic:main
from
drewdaemon:129474/default-legend-size-to-fixed-migrations-strategy
May 10, 2022
Merged
Changes from 37 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
1bd3e8a
update lens legend default to medium
drewdaemon 348b793
Remove auto option when not currently selected
drewdaemon a6449c6
update legend size settings
drewdaemon 43011c6
Add lens legend migration
drewdaemon a43e87a
Default legend size at expression level
drewdaemon f50405c
hide auto option and update default legend size for agg-based visuali…
drewdaemon bacdef6
update default legend sizes for aggs-based visualizations
drewdaemon 07b6ba4
fn name update
drewdaemon 75e5770
add migration for aggs-based visualizations
drewdaemon cbd7483
Add visualizations as required bundle for editor
drewdaemon f7079d2
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 9e97779
add test for visualize SO migration
drewdaemon 6e87e68
Merge branch '129474/default-legend-size-to-fixed-migrations-strategy…
drewdaemon e252436
test lens saved object migrations
drewdaemon c018293
update unit test
drewdaemon ce369ec
Merge branch 'main' into 129474/default-legend-size-to-fixed-migratio…
kibanamachine 1be5bbf
update baseline screenshot for area chart
drewdaemon 538742a
Merge branch '129474/default-legend-size-to-fixed-migrations-strategy…
drewdaemon 7f879f1
Merge branch 'main' into 129474/default-legend-size-to-fixed-migratio…
kibanamachine 0efec68
wait to hide auto option - lens
drewdaemon 17140fc
Merge branch '129474/default-legend-size-to-fixed-migrations-strategy…
drewdaemon b876e1a
wait to hide auto option - visualize
drewdaemon 8d47281
Merge branch 'main' of github.com:elastic/kibana into 129474/default-…
drewdaemon 0089aa4
remove unused setters
drewdaemon 44ea016
fix some checks
drewdaemon 180c5e7
adjust visual test error margin
drewdaemon ecb8604
Merge branch 'main' into 129474/default-legend-size-to-fixed-migratio…
kibanamachine ea1218e
import default legend size and LegendSizes from visualizations plugin
drewdaemon 0c019bf
Merge branch '129474/default-legend-size-to-fixed-migrations-strategy…
drewdaemon cfbed11
Merge branch 'main' of github.com:elastic/kibana into 129474/default-…
drewdaemon 70d8605
Merge branch 'main' of github.com:elastic/kibana into 129474/default-…
drewdaemon 01ba9b7
fix test
drewdaemon 7c8d259
fix test
drewdaemon befa54f
allow for undefined params in visualization migration function
drewdaemon 127fbd4
fix migration types
drewdaemon 7b44734
more typing fixes
drewdaemon 0e3a30d
Interpret auto as auto instead of 0
drewdaemon 922b5a9
update baseline snapshot
drewdaemon 3a3cf3a
Using strings for legend sizes
drewdaemon 43a69e9
Merge branch 'main' of github.com:elastic/kibana into 129474/default-…
drewdaemon bf828cb
move legendSize default and pixel translation to expression layer
drewdaemon 8c28bbc
update aggs-based
drewdaemon c4f118d
update some unit tests
drewdaemon 58b4dcd
remove unused import
drewdaemon eb4588f
Merge branch 'main' of github.com:elastic/kibana into 129474/default-…
drewdaemon 3332ce1
remove unused imports
drewdaemon 701a66c
update snaps
drewdaemon cd85c83
update translation path
drewdaemon cee8d53
restore i18n string
drewdaemon 9ee0704
remove unnecessary optional chaining operators
drewdaemon bc69ec8
Merge branch 'main' into 129474/default-legend-size-to-fixed-migratio…
kibanamachine d612e4d
Merge branch 'main' into 129474/default-legend-size-to-fixed-migratio…
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...ion_partition_vis/common/expression_functions/__snapshots__/pie_vis_function.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
83 changes: 83 additions & 0 deletions
83
src/plugins/vis_default_editor/public/components/options/legend_size_settings.test.tsx
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,83 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { LegendSizeSettings } from './legend_size_settings'; | ||
import { LegendSizes, DEFAULT_LEGEND_SIZE } from '@kbn/visualizations-plugin/public'; | ||
import { EuiSuperSelect } from '@elastic/eui'; | ||
import { shallow } from 'enzyme'; | ||
|
||
describe('legend size settings', () => { | ||
it('select is disabled if not vertical legend', () => { | ||
const instance = shallow( | ||
<LegendSizeSettings | ||
legendSize={undefined} | ||
onLegendSizeChange={() => {}} | ||
isVerticalLegend={false} | ||
showAutoOption={true} | ||
/> | ||
); | ||
|
||
expect(instance.find(EuiSuperSelect).props().disabled).toBeTruthy(); | ||
}); | ||
|
||
it('reflects current setting in select', () => { | ||
const CURRENT_SIZE = LegendSizes.SMALL; | ||
|
||
const instance = shallow( | ||
<LegendSizeSettings | ||
legendSize={Number(CURRENT_SIZE)} | ||
onLegendSizeChange={() => {}} | ||
isVerticalLegend={true} | ||
showAutoOption={true} | ||
/> | ||
); | ||
|
||
expect(instance.find(EuiSuperSelect).props().valueOfSelected).toBe(CURRENT_SIZE.toString()); | ||
}); | ||
|
||
it('allows user to select a new option', () => { | ||
const onSizeChange = jest.fn(); | ||
|
||
const instance = shallow( | ||
<LegendSizeSettings | ||
legendSize={Number(LegendSizes.SMALL)} | ||
onLegendSizeChange={onSizeChange} | ||
isVerticalLegend={true} | ||
showAutoOption={true} | ||
/> | ||
); | ||
|
||
const onChange = instance.find(EuiSuperSelect).props().onChange; | ||
|
||
onChange(LegendSizes.EXTRA_LARGE); | ||
onChange(DEFAULT_LEGEND_SIZE); | ||
|
||
expect(onSizeChange).toHaveBeenNthCalledWith(1, Number(LegendSizes.EXTRA_LARGE)); | ||
expect(onSizeChange).toHaveBeenNthCalledWith(2, undefined); | ||
}); | ||
|
||
it('hides "auto" option if visualization not using it', () => { | ||
const getOptions = (showAutoOption: boolean) => | ||
shallow( | ||
<LegendSizeSettings | ||
legendSize={LegendSizes.LARGE} | ||
onLegendSizeChange={() => {}} | ||
isVerticalLegend={true} | ||
showAutoOption={showAutoOption} | ||
/> | ||
) | ||
.find(EuiSuperSelect) | ||
.props().options; | ||
|
||
const autoOption = expect.objectContaining({ value: LegendSizes.AUTO.toString() }); | ||
|
||
expect(getOptions(true)).toContainEqual(autoOption); | ||
expect(getOptions(false)).not.toContainEqual(autoOption); | ||
}); | ||
}); |
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
3 changes: 3 additions & 0 deletions
3
src/plugins/vis_types/pie/public/__snapshots__/to_ast.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
src/plugins/vis_types/xy/public/__snapshots__/to_ast.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
visualizations
as a required bundle is the salient change here