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
4b7eae3f94
commit
086b81b74e
1 changed files with 15 additions and 2 deletions
|
@ -154,7 +154,19 @@ uiModules.get('apps/management')
|
|||
}
|
||||
|
||||
return Promise.map(docs, function (doc) {
|
||||
const service = find($scope.services, {type: doc._type}).service;
|
||||
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 () {
|
||||
|
@ -163,7 +175,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