Skip to content

Commit

Permalink
Prepare index_patterns/index_pattern.ts for move - remove ui/notify (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp authored and darnautov committed Oct 14, 2019
1 parent 4fd798f commit 31c9c5b
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { i18n } from '@kbn/i18n';
import { fieldFormats } from 'ui/registry/field_formats';
// @ts-ignore
import { expandShorthand } from 'ui/utils/mapping_setup';
import { toastNotifications } from 'ui/notify';
import { findObjectByTitle } from 'ui/saved_objects';
import { NotificationsSetup, SavedObjectsClientContract } from 'src/core/public';
import { SavedObjectNotFound, DuplicateField } from '../../../../../../plugins/kibana_utils/public';
Expand Down Expand Up @@ -468,7 +467,7 @@ export class IndexPattern implements StaticIndexPattern {
'Unable to write index pattern! Refresh the page to get the most up to date changes for this index pattern.',
} // eslint-disable-line max-len
);
toastNotifications.addDanger(message);
this.notifications.toasts.addDanger(message);
throw err;
}

Expand Down Expand Up @@ -507,11 +506,11 @@ export class IndexPattern implements StaticIndexPattern {
// but we do not want to potentially make any pages unusable
// so do not rethrow the error here
if (err instanceof IndexPatternMissingIndices) {
toastNotifications.addDanger((err as any).message);
this.notifications.toasts.addDanger((err as any).message);
return [];
}

toastNotifications.addError(err, {
this.notifications.toasts.addError(err, {
title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', {
defaultMessage: 'Error fetching fields',
}),
Expand Down

0 comments on commit 31c9c5b

Please sign in to comment.