-
Notifications
You must be signed in to change notification settings - Fork 14
Use kibiUtils.getValuesAtPath in favor of _.get #106
Conversation
This adds the feature to get arrays from the es result document, by reusing kibiUtils.getValuesAtPath with .split('.'). This feature might be implemented on a higher level of abstraction, to get rid of params.labelFieldSequence statements altogether.
Can one of the admins verify this patch? |
jenkins test it |
Failing: Kibi Timeline Kibi Timeline TimelineHelper pluckLabel should return the label of an event kibana-style |
Thanks for the patch. The parameter |
@scampi I prefer to keep When confirmed, we can move to only use labelFieldSequence uniformly. Initialisation: kibi_timeline_vis/public/kibi_timeline_vis_controller.js Lines 80 to 86 in 220ad17
Usage: kibi_timeline_vis/public/lib/helpers/timeline_helper.js Lines 28 to 32 in 4545908
|
781b573 fixes case where there is not split on dot, forces array creation. |
You meant Kibana ? If so, sorry I misread this. In kibana the support for objects in arrays has been improved and so it shouldn't be needed to use the |
jenkins test it |
Sorry for the late commits, I've updated the build artifact and added test coverage for Kibana. I had issues running the tests, so please let Jenkins do a check. |
jenkins test it |
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.
Please remove the zip
file from the PR
field = _.get(hit._source, params.labelField); | ||
} else { // create kibi path property from ES path by splitting on . | ||
const kibanaSplit = params.labelField.split('.'); | ||
const kibanaSequence = Array.isArray(kibanaSplit) ? kibanaSplit : Array.of(kibanaSplit); |
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.
I don't understand why this is needed. The split
always returns an array.
Left kibanaSequence as const to clarify code
jenkins test it |
corrected tests
Accepted |
jenkins test it |
Sorry to bother, any updates on the status? |
This adds the feature to get arrays from the es result document, by reusing kibiUtils.getValuesAtPath with .split('.'). This feature might be implemented on a higher level of abstraction, to get rid of params.labelFieldSequence statements altogether.