-
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
[Discover] Fix broken setting of bucketInterval #62939
[Discover] Fix broken setting of bucketInterval #62939
Conversation
@@ -675,17 +675,6 @@ function discoverController( | |||
} | |||
}); | |||
|
|||
$scope.$watch('vis.aggs', function() { |
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.
The watcher didn't work due to the Visualizations API changes, decided it's even not needed and removed it in favor of a simpler solution
@@ -891,6 +880,9 @@ function discoverController( | |||
tabifiedData, | |||
getDimensions($scope.vis.data.aggs.aggs, $scope.timeRange) | |||
); | |||
if ($scope.vis.data.aggs.aggs[1]) { | |||
$scope.bucketInterval = $scope.vis.data.aggs.aggs[1].buckets.getInterval(); | |||
} |
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.
dear @ppisljar, this API changed. This works, but I wonder if there's a better way to do it. Before it was done this way:
const buckets = $scope.vis.data.aggs.byTypeName('buckets');
if (buckets && buckets.length === 1) {
$scope.bucketInterval = buckets[0].buckets.getInterval();
}
@elasticmachine merge upstream |
…-08-discover-fix-broken-bucket-interval
…l' of github.com:kertal/kibana into kertal-pr-2020-04-08-discover-fix-broken-bucket-interval
@@ -66,34 +66,34 @@ export default function({ getService, getPageObjects }) { | |||
}); | |||
|
|||
it('should visualize monthly data with different day intervals', async () => { | |||
//Nov 1, 2017 @ 01:00:00.000 - Mar 21, 2018 @ 02:00:00.000 |
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.
all the input time ranges in this tests where invalid, fixed that
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
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.
Tested with time based and time less index pattern, works as expected in all scenarios. Thanks a lot for the functional test! I strongly prefer the new solution.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Fix broken setting of bucketInterval, remove $watch * Fix and adapt functional tests
* Fix broken setting of bucketInterval, remove $watch * Fix and adapt functional tests
* master: (29 commits) Add test:jest_integration npm script (elastic#62938) [data.search.aggs] Remove service getters from agg types (AggConfig part) (elastic#62548) [Discover] Fix broken setting of bucketInterval (elastic#62939) Disable adding conditions when in alert management context. (elastic#63514) [Alerting] fixes to allow pre-configured actions to be executed (elastic#63432) adding useMemo (elastic#63504) [Maps] fix double fetch when filter pill is added (elastic#63024) [Lens] Fix missing formatting bug in "break down by" (elastic#63288) [SIEM] [Cases] Removed double pasted line (elastic#63507) [Reporting] Improve functional test steps (elastic#63259) [SIEM][CASE] Tests for server's configuration API (elastic#63099) [SIEM] [Cases] Case container unit tests (elastic#63376) [ML] Improving parsing of large uploaded files (elastic#62970) [ML] Listing global calendars on the job management page (elastic#63124) [Ingest][Endpoint] Add Ingest rest api response types for use in Endpoint (elastic#63373) Add help text to form fields (elastic#63165) [ML] Converts utils Mocha tests to Jest (elastic#63132) [Metrics UI] Refactor With* containers to hooks (elastic#59503) [NP] Migrate logstash server side code to NP (elastic#63135) Clicking cancel in saved query save modal doesn't close it (elastic#62774) ...
* Fix broken setting of bucketInterval, remove $watch * Fix and adapt functional tests
Summary
When a manual interval is chosen in Discover histogram which is too small for the current time range, it's scaled up, and the user gets notified by a text. This was broken, due to changes in the Visualizations API, and a watcher was never triggered because of this. This PR restores displaying this information.
Fixes #62753
How to test
Checklist