-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[indexPattern] Added #toDetailedIndexList() #5638
[indexPattern] Added #toDetailedIndexList() #5638
Conversation
@@ -177,18 +177,21 @@ define(function (require) { | |||
return this.intervalName && _.find(intervals, { name: this.intervalName }); | |||
}; | |||
|
|||
self.toIndexList = function (start, stop, sortDirection) { |
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.
Rather than adding complexity to this function by making it polymorphic, how about we move all of this logic into a new toDetailedIndexList
function, and then modify the existing toIndexList
to do something like:
self.toIndexList = function (start, stop, sortDirection) {
return this.toDetailedIndexList()
.then(indices => return _.pluck(indices, 'index'));
};
64ec792
to
6805797
Compare
Can you give a bit of a summary for the best way to test this? I can review the code and such, but I'm not really sure what behaviors I should be testing in kibana itself. |
Or is there a ticket associated with this that describes the issue? |
There isn't actually any issue, and the new method isn't used in Kibana at the time being. This is an API to support new functionality I'm working on. For now only the tests test it. |
df41329
to
2825c8d
Compare
2825c8d
to
e63838d
Compare
Ah, that makes a lot more sense. |
.value(); | ||
// TODO: remove when we get to es 2.2, see elastic/elasticsearch#14404 | ||
let min = field.min_value; | ||
if (typeof min === 'string') min = moment(min).valueOf(); |
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.
Will these definitely always be strings? Or more specifically, is it possible for them to be integer timestamps?
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.
After we upgrade to es 2.2, elasticsearch will always pass back unix timestamps. Until then times are passed back in whatever format they are stored in, and our only option is to attempt to parse that with moment()
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 makes complete sense. I totally had this reversed in my head.
If those constraints will always be strings or moment objects, then I'd say this LGTM. |
LGTM |
…stDetailedResponse [indexPattern] Added #toDetailedIndexList()
indexPattern#toIndexList()
now has adetailedResponse
We need access to the bounds for each index, so this new parameter returns the indices as objects rather than strings, and each object details the index, start, and end for each index.