Skip to content

Commit

Permalink
typing of index patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Feb 10, 2020
1 parent ad25723 commit 1d1f3ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Field } from '../../../../../../../../../plugins/data/public';
import { IndexPatternField } from '../../../../../../../../../plugins/data/public';
import { RegistryFieldFormatEditorsProvider } from 'ui/registry/field_format_editors';
import { docTitle } from 'ui/doc_title';
import { KbnUrlProvider } from 'ui/url';
Expand All @@ -39,7 +39,7 @@ const renderFieldEditor = (
$scope,
indexPattern,
field,
{ Field, getConfig, $http, fieldFormatEditors, redirectAway }
{ getConfig, $http, fieldFormatEditors, redirectAway }
) => {
$scope.$$postDigest(() => {
const node = document.getElementById(REACT_FIELD_EDITOR_ID);
Expand All @@ -53,7 +53,7 @@ const renderFieldEditor = (
indexPattern={indexPattern}
field={field}
helpers={{
Field,
Field: IndexPatternField,
getConfig,
$http,
fieldFormatEditors,
Expand Down Expand Up @@ -135,7 +135,7 @@ uiRoutes
return;
}
} else if (this.mode === 'create') {
this.field = new Field(this.indexPattern, {
this.field = new IndexPatternField(this.indexPattern, {
scripted: true,
type: 'number',
});
Expand All @@ -158,7 +158,6 @@ uiRoutes
docTitle.change([fieldName, this.indexPattern.title]);

renderFieldEditor($scope, this.indexPattern, this.field, {
Field,
getConfig,
$http,
fieldFormatEditors,
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ export {
FieldFormatId,
} from '../common';
export { autocomplete } from './autocomplete';

export {
indexPatterns,
IndexPatternsContract,
IndexPattern,
IndexPatternField,
Field as IndexPatternField,
TypeMeta as IndexPatternTypeMeta,
AggregationRestrictions as IndexPatternAggRestrictions,
} from './index_patterns';

export * from './search';
export * from './query';
export * from './ui';
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/data/public/index_patterns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ export const indexPatterns = {
isDefault,
};

import { Field, FieldList } from './fields';

export type IndexPatternField = Field;
export { Field } from './fields';

// TODO: figure out how to replace IndexPatterns in get_inner_angular.
export {
Expand Down

0 comments on commit 1d1f3ae

Please sign in to comment.