Skip to content
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

Prevents canceling index pattern modal from throwing error #13488

Merged
merged 2 commits into from
Aug 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/ui/public/index_patterns/_index_pattern.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { SavedObjectNotFound, DuplicateField, IndexPatternAlreadyExists, IndexPatternMissingIndices } from 'ui/errors';
import { SavedObjectNotFound, DuplicateField, IndexPatternMissingIndices } from 'ui/errors';
import angular from 'angular';
import { RegistryFieldFormatsProvider } from 'ui/registry/field_formats';
import UtilsMappingSetupProvider from 'ui/utils/mapping_setup';
Expand Down Expand Up @@ -368,18 +368,17 @@ export function IndexPatternProvider(Private, $http, config, kbnIndex, Promise,

return confirmModalPromise(confirmMessage, { confirmButtonText: 'Edit existing pattern' })
.then(() => {
kbnUrl.change('/management/kibana/indices/{{id}}', { id: duplicate.id });
kbnUrl.redirect('/management/kibana/indices/{{id}}', { id: duplicate.id });
return true;
}).catch(() => {
return true;
})
.catch(() => {
throw new IndexPatternAlreadyExists(this.title);
});
});
}

create() {
return this.warnIfDuplicateTitle().then((duplicate) => {
if (duplicate) return;
return this.warnIfDuplicateTitle().then((isDuplicate) => {
if (isDuplicate) return;

const body = this.prepBody();

Expand Down