-
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
Change importer to use saved object class, fix broken select all #4509
Conversation
.then(refreshData, notify.error); | ||
} | ||
}); | ||
return Promise.all(docs.map(function (doc) { |
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.
You can use Promise.map, which uses Promise.all internally
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.
Delicious.
There's an issue with the importing, which may not be related to this PR.
|
This looks good to me, passing on for last looks. @lukasolson do chime in on that import cancel issue though. |
…oaded multiple times
This was due to the fact that we use an |
Change importer to use saved object class, fix broken select all
Closes #3912, #4311, and #4508,
Prior to this, the import functionality would work by reading in the uploaded file then creating a simple bulk request to the .kibana index.
While this seems good and all, it caused issues, such as this: #3882.
What happens behind the scenes, is that when importing, if we don't use the saved object classes, then certain values (such as
hits
andversion
) can get mapped to an incorrect type (long instead of int, etc.).This PR addresses this by utilizing the saved object classes when importing. Basically, how I accomplished this was by taking the
applyESResp
function out and separating it, so that it could be used from outside the loading of an object. When an import happens, we use that function to load the objects as if we were loading them directly from an ES fetch, so all of the magic that usually gets applied can get applied in this step.Also part of this PR is fixing the select all functionality, which was broken because
$scope.currentTab
wasn't being set initially if it was explicit in the URL.