Skip to content
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

Merged
merged 2 commits into from
Feb 25, 2015

Conversation

lukasolson
Copy link
Member

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.

controller: function ($scope) {
controller: function ($scope, $route) {
$scope.setIndexPattern = function (indexPattern) {
$scope.state.index = indexPattern;
Copy link
Member Author

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?

Copy link
Contributor

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.

@rashidkpc rashidkpc modified the milestone: 4.1.0 Feb 18, 2015
@w33ble
Copy link
Contributor

w33ble commented Feb 23, 2015

2 UI things:

  1. Use of a gear icon seems wrong - this isn't a config or setting, it's a selection. Maybe something directional, transitioning from pointing left when closed to down when open?
  2. If you only have 1 index pattern, the interface makes no sense and should probably be disabled:

screenshot 2015-02-23 12 33 55

@w33ble w33ble assigned lukasolson and unassigned w33ble Feb 23, 2015
@w33ble w33ble removed the review label Feb 23, 2015
@lukasolson lukasolson assigned w33ble and unassigned lukasolson Feb 23, 2015
@w33ble
Copy link
Contributor

w33ble commented Feb 25, 2015

🎳 LGTM

w33ble added a commit that referenced this pull request Feb 25, 2015
Move index pattern selector into index pattern header in discover
@w33ble w33ble merged commit c8b197d into elastic:master Feb 25, 2015
@lukasolson lukasolson deleted the issues/3024 branch February 11, 2016 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put index config by index name
3 participants