mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -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
103a5bf8ef
commit
40a8d0142c
1 changed files with 15 additions and 2 deletions
|
@ -134,7 +134,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 () {
|
||||
|
@ -143,7 +155,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