Move temporary types in data plugin to common/types. (#50280)

* Move temporary ui imported types in data plugin to common/types.
Remove unnecessary mocks.

* Updated dashboard, discover and visualize mappings - type removal

* Revert "Updated dashboard, discover and visualize mappings - type removal"

This reverts commit 5e931ce62a.
This commit is contained in:
Liza Katz 2019-11-13 17:28:21 +02:00 committed by GitHub
parent f317c25852
commit 4c8afa76d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 13 additions and 26 deletions

View file

@ -18,7 +18,7 @@
*/
import { Filter, FilterMeta } from './meta_filter';
import { IndexPattern, Field } from './types';
import { IndexPattern, Field } from '../../types';
export type ExistsFilterMeta = FilterMeta;

View file

@ -18,7 +18,7 @@
*/
import { buildInlineScriptForPhraseFilter, buildPhraseFilter } from './phrase_filter';
import { IndexPattern } from './types';
import { IndexPattern } from '../../types';
import { getField } from '../__tests__/fields_mock';
describe('Phrase filter builder', () => {

View file

@ -19,7 +19,7 @@
import { get, isPlainObject } from 'lodash';
import { Filter, FilterMeta } from './meta_filter';
import { IndexPattern, Field } from './types';
import { IndexPattern, Field } from '../../types';
export type PhraseFilterMeta = FilterMeta & {
params?: {

View file

@ -18,7 +18,7 @@
*/
import { Filter, FilterMeta } from './meta_filter';
import { Field, IndexPattern } from './types';
import { Field, IndexPattern } from '../../types';
import { getPhraseScript } from './phrase_filter';
export type PhrasesFilterMeta = FilterMeta & {

View file

@ -18,7 +18,7 @@
*/
import { buildQueryFilter } from './query_string_filter';
import { IndexPattern } from './types';
import { IndexPattern } from '../../types';
describe('Phrase filter builder', () => {
let indexPattern: IndexPattern;

View file

@ -18,7 +18,7 @@
*/
import { Filter, FilterMeta } from './meta_filter';
import { IndexPattern } from './types';
import { IndexPattern } from '../../types';
export type QueryStringFilterMeta = FilterMeta;

View file

@ -19,7 +19,7 @@
import { each } from 'lodash';
import { buildRangeFilter, RangeFilter } from './range_filter';
import { IndexPattern, Field } from './types';
import { IndexPattern, Field } from '../../types';
import { getField } from '../__tests__/fields_mock';
describe('Range filter builder', () => {

View file

@ -18,7 +18,7 @@
*/
import { map, reduce, mapValues, get, keys, pick } from 'lodash';
import { Filter, FilterMeta } from './meta_filter';
import { Field, IndexPattern } from './types';
import { Field, IndexPattern } from '../../types';
const OPERANDS_IN_RANGE = 2;

View file

@ -49,9 +49,3 @@ export enum FILTERS {
GEO_BOUNDING_BOX = 'geo_bounding_box',
GEO_POLYGON = 'geo_polygon',
}
// We can't import the real types from the data plugin, so need to either duplicate
// them here or figure out another solution, perhaps housing them in this package
// will be replaces after Fieds / IndexPattern will be moved into new platform
export type Field = any;
export type IndexPattern = any;

View file

@ -27,3 +27,4 @@ export * from './kbn_field_types/types';
// will be replaces after Fieds / IndexPattern will be moved into new platform
export type Field = any;
export type IndexPattern = any;
export type StaticIndexPattern = any;

View file

@ -17,8 +17,8 @@
* under the License.
*/
import { StaticIndexPattern, Field } from 'ui/index_patterns';
import { AutocompleteProviderRegister } from '.';
import { Field, StaticIndexPattern } from '..';
export type AutocompletePublicPluginSetup = Pick<
AutocompleteProviderRegister,

View file

@ -36,12 +36,6 @@ const createMockStorage = () => ({
clear: jest.fn(),
});
jest.mock('ui/chrome', () => {
return {
getBasePath: () => `/some/base/path`,
};
});
const historyName = 'testHistory';
const historyLimit = 10;
const payload = [

View file

@ -16,8 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
// Should be import { Field } from './index_patterns';
export type Field = any;
import { Field } from '..';
export type IGetSuggestions = (index: string, field: Field, query: string, boolFilter?: any) => any;

View file

@ -19,7 +19,6 @@
// TODO: remove when index patterns are moved here.
jest.mock('ui/new_platform');
jest.mock('ui/index_patterns');
import { stubIndexPattern, stubFields } from '../stubs';
import { getSuggestionsProvider } from './value_suggestions';

View file

@ -20,7 +20,8 @@
import { memoize } from 'lodash';
import { UiSettingsClientContract, HttpServiceBase } from 'src/core/public';
import { IGetSuggestions, Field } from './types';
import { IGetSuggestions } from './types';
import { Field } from '..';
export function getSuggestionsProvider(
uiSettings: UiSettingsClientContract,