mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Show warning when importing a missing type (#10521)
* show warning when importing a missing type * remove template string concatenation
This commit is contained in:
parent
61365e802e
commit
eb9fb9231d
1 changed files with 16 additions and 3 deletions
|
@ -164,8 +164,20 @@ uiModules.get('apps/management')
|
|||
notify.error('The file could not be processed.');
|
||||
}
|
||||
|
||||
return Promise.map(docs, function (doc) {
|
||||
const service = find($scope.services, { type: doc._type }).service;
|
||||
return Promise.map(docs, (doc) => {
|
||||
const { service } = find($scope.services, { type: doc._type }) || {};
|
||||
|
||||
if (!service) {
|
||||
const msg = `Skipped import of "${doc._source.title}" (${doc._id})`;
|
||||
const reason = `Invalid type: "${doc._type}"`;
|
||||
|
||||
notify.warning(`${msg}, ${reason}`, {
|
||||
lifetime: 0,
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return service.get().then(function (obj) {
|
||||
obj.id = doc._id;
|
||||
return obj.applyESResp(doc).then(function () {
|
||||
|
@ -174,7 +186,8 @@ uiModules.get('apps/management')
|
|||
});
|
||||
})
|
||||
.then(refreshIndex)
|
||||
.then(refreshData, notify.error);
|
||||
.then(refreshData)
|
||||
.catch(notify.error);
|
||||
};
|
||||
|
||||
function refreshIndex() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue