-
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] Do not reset formatting when switching between custom ranges and auto histogram #82694
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bfb0cf8
fix: do not reset formatting when switching between custom ranges and…
denismaxim0v e1e9eb2
test for Do not reset formatting when switching between custom ranges…
denismaxim0v 1ab13e4
Merge branch 'master' into elastic#81749
kibanamachine 2459d72
[Lens] test for Do not reset formatting when switching between custom…
denismaxim0v 11ce62b
Merge branch 'elastic#81749' of github.com:denismaxim0v/kibana into e…
denismaxim0v 8c051c8
fix: Do not reset formatting when switching between custom ranges and…
denismaxim0v 1954db8
Merge branch 'master' of github.com:elastic/kibana into elastic#81749
denismaxim0v ba77781
fix: remove unused import
denismaxim0v 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
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
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.
It seems like the only difference between the "default" format of
MyField
and the overwrite on the column are the params. Your test doesn't really validate these params are kept - I commented out lines 763 to 766 and the tests still pass. I suggest not setting the same formatter in the field format map of the index pattern (line 759)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.
Not sure if I understood that completely. Should I switch it to test for params on the same line(759)?
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.
No, I meant setting it to the number formatter there so you can actually check whether the format is persisted.
But I just realized your test is not testing the right thing anyway.
lns-customBucketContainer-remove
is removing one out of multiple ranges, but that's not what should be tested here - this is about switching between custom ranges in general and automatic ranges controlled by granularity.A proper unit test should click the "Remove custom ranges" button, then check whether the state update issued by this still includes the custom format.
Let me know when you have problems adding such a test. I can do it and add it to your PR
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.
So, I have been trying to
But it seems that
Number of calls: 2
and I'm not sure how to handle that