-
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
Move index pattern selector into index pattern header in discover #3060
Conversation
controller: function ($scope) { | ||
controller: function ($scope, $route) { | ||
$scope.setIndexPattern = function (indexPattern) { | ||
$scope.state.index = indexPattern; |
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.
This relies on $scope.state
being initialized in a parent scope, which, in practice, should always be the case. However, I sort of don't like external dependencies like this. I could just as easily inject AppState
, and initialize $scope.state = new AppState();
at the top of the controller function. Would that be a better alternative?
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.
This is only 1 of 2 directives where the state is passed in, the other bring the filter bar. There, it makes sense as you don't want to have to re-render the whole app to change the filters. Here, the only time you use state is when you re-rendering anyway, so I think it makes sense not to pass it in.
2 UI things:
|
🎳 LGTM |
Move index pattern selector into index pattern header in discover
This PR moves the index pattern selector in discover to the sidebar, where we added an index pattern title recently. It also removes the code associated with the older selector.
Closes #3024.