Skip to content

Commit

Permalink
dependency cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Jun 5, 2020
1 parent ec2f0c6 commit ebc56d8
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Constructs a new instance of the `IndexPattern` class
<b>Signature:</b>

```typescript
constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: any, fieldFormats: FieldFormatMethods, onNotification: OnNotification, onError: OnError);
constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: any, fieldFormats: FieldFormatsStartCommon, onNotification: OnNotification, onError: OnError);
```

## Parameters
Expand All @@ -21,7 +21,7 @@ constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObj
| savedObjectsClient | <code>SavedObjectsClientContract</code> | |
| apiClient | <code>IIndexPatternsApiClient</code> | |
| patternCache | <code>any</code> | |
| fieldFormats | <code>FieldFormatMethods</code> | |
| fieldFormats | <code>FieldFormatsStartCommon</code> | |
| onNotification | <code>OnNotification</code> | |
| onError | <code>OnError</code> | |

6 changes: 3 additions & 3 deletions src/plugins/data/common/index_patterns/fields/field.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { Field } from './field';
import { IndexPattern } from '../index_patterns';
import { FieldFormatMethods } from '../types';
import { FieldFormatsStartCommon } from '../../field_formats';
import { KBN_FIELD_TYPES } from '../../../common';

describe('Field', function () {
Expand All @@ -33,7 +33,7 @@ describe('Field', function () {
{ ...fieldValues, ...values },
false,
{
fieldFormats: {} as FieldFormatMethods,
fieldFormats: {} as FieldFormatsStartCommon,
onNotification: () => {},
}
);
Expand Down Expand Up @@ -214,7 +214,7 @@ describe('Field', function () {

it('exports the property to JSON', () => {
const field = new Field({ fieldFormatMap: { name: {} } } as IndexPattern, fieldValues, false, {
fieldFormats: {} as FieldFormatMethods,
fieldFormats: {} as FieldFormatsStartCommon,
onNotification: () => {},
});
expect(flatten(field)).toMatchSnapshot();
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/index_patterns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

export * from './fields';
export * from './types';
export * from './index_patterns';
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ import { Field, IIndexPatternFieldList, getIndexPatternFieldListCreator } from '
import { createFieldsFetcher } from './_fields_fetcher';
import { formatHitProvider } from './format_hit';
import { flattenHitWrapper } from './flatten_hit';
import { IIndexPatternsApiClient } from '.';
import { TypeMeta } from '.';
import { IIndexPatternsApiClient, TypeMeta } from '.';
import { OnNotification, OnError } from '../types';
import { FieldFormatsStartCommon } from '../../field_formats';

Expand Down Expand Up @@ -530,7 +529,6 @@ export class IndexPattern implements IIndexPattern {
// we still want to notify the user that there is a problem
// but we do not want to potentially make any pages unusable
// so do not rethrow the error here
// const { toasts } = getNotifications();

if (err instanceof IndexPatternMissingIndices) {
this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {
CoreStart,
} from 'src/core/public';

import { createIndexPatternCache } from '.';
import { createIndexPatternCache } from './_pattern_cache';
import { IndexPattern } from './index_pattern';
import { IndexPatternsApiClient, GetFieldsOptions } from '.';
import { IndexPatternsApiClient, GetFieldsOptions } from './index_patterns_api_client';
import {
createEnsureDefaultIndexPattern,
EnsureDefaultIndexPattern,
Expand Down
20 changes: 0 additions & 20 deletions src/plugins/data/public/index_patterns/fields/index.ts

This file was deleted.

12 changes: 7 additions & 5 deletions src/plugins/data/public/index_patterns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ export {
validateIndexPattern,
getFromSavedObject,
isDefault,
} from './lib';
export { flattenHitWrapper, formatHitProvider, onRedirectNoIndexPattern } from './index_patterns';
getTitle,
} from '../../common/index_patterns/lib';
export { onRedirectNoIndexPattern } from './index_patterns';

export { getIndexPatternFieldListCreator, Field, IIndexPatternFieldList } from './fields';
export { getIndexPatternFieldListCreator, Field, IIndexPatternFieldList } from '../../common';

// TODO: figure out how to replace IndexPatterns in get_inner_angular.
export {
flattenHitWrapper,
formatHitProvider,
IndexPatternsService,
IndexPatternsContract,
IndexPattern,
TypeMeta,
AggregationRestrictions,
} from './index_patterns';
} from '../../common/index_patterns';
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@
* under the License.
*/

// export * from './index_patterns_api_client';
export * from '../../../common/index_patterns/index_patterns';
// export { IIndexPattern } from '../../../common/index_patterns';
export * from './redirect_no_index_pattern';
20 changes: 0 additions & 20 deletions src/plugins/data/public/index_patterns/lib/index.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/plugins/data/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ export class DataPublicPlugin implements Plugin<DataPublicPluginSetup, DataPubli
savedObjects.client,
http,
fieldFormats,
(toastInputFields) => {
notifications.toasts.add(toastInputFields);
},
notifications.toasts.add,
notifications.toasts.addError,
onRedirectNoIndexPattern
);
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,10 @@ export type IMetricAggType = MetricAggType;
// @public (undocumented)
export class IndexPattern implements IIndexPattern {
// Warning: (ae-forgotten-export) The symbol "IIndexPatternsApiClient" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FieldFormatMethods" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FieldFormatsStartCommon" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "OnNotification" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "OnError" needs to be exported by the entry point index.d.ts
constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: any, fieldFormats: FieldFormatMethods, onNotification: OnNotification, onError: OnError);
constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: any, fieldFormats: FieldFormatsStartCommon, onNotification: OnNotification, onError: OnError);
// (undocumented)
[key: string]: any;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/public/search/search_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { TStrategyTypes } from './strategy_types';
import { getEsClient, LegacyApiCaller } from './legacy';
import { ES_SEARCH_STRATEGY, DEFAULT_SEARCH_STRATEGY } from '../../common/search';
import { esSearchStrategyProvider } from './es_search';
import { IndexPatternsContract } from '../index_patterns/index_patterns';
import { IndexPatternsContract } from '../index_patterns';
import { QuerySetup } from '../query';
import { GetInternalStartServicesFn } from '../types';
import { SearchInterceptor } from './search_interceptor';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { createSearchSource as createSearchSourceFactory } from './create_search_source';
import { IIndexPattern } from '../../../common/index_patterns';
import { IndexPatternsContract } from '../../index_patterns/index_patterns';
import { IndexPatternsContract } from '../../index_patterns';
import { Filter } from '../../../common/es_query/filters';
import { coreMock } from '../../../../../core/public/mocks';
import { dataPluginMock } from '../../mocks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { migrateLegacyQuery } from '../../../../kibana_legacy/public';
import { SearchSource, SearchSourceDependencies } from './search_source';
import { IndexPatternsContract } from '../../index_patterns/index_patterns';
import { IndexPatternsContract } from '../../index_patterns';
import { SearchSourceFields } from './types';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Required } from '@kbn/utility-types';
import { EuiComboBox, EuiComboBoxProps } from '@elastic/eui';

import { SavedObjectsClientContract, SimpleSavedObject } from '../../../../../core/public';
import { getTitle } from '../../index_patterns/lib';
import { getTitle } from '../../index_patterns';

export type IndexPatternSelectProps = Required<
// Omit<EuiComboBoxProps<any>, 'isLoading' | 'onSearchChange' | 'options' | 'selectedOptions' | 'append' | 'prepend' | 'sortMatchesBy'>,
Expand Down

0 comments on commit ebc56d8

Please sign in to comment.