diff --git a/src/plugins/data/common/field_formats/converters/index.ts b/src/plugins/data/common/field_formats/converters/index.ts index f7e50539b44d8..cc9fae7fc9965 100644 --- a/src/plugins/data/common/field_formats/converters/index.ts +++ b/src/plugins/data/common/field_formats/converters/index.ts @@ -19,7 +19,6 @@ export { UrlFormat } from './url'; export { BytesFormat } from './bytes'; -export { DateFormat } from './date_server'; export { DateNanosFormat } from './date_nanos'; export { RelativeDateFormat } from './relative_date'; export { DurationFormat } from './duration'; diff --git a/src/plugins/data/common/types.ts b/src/plugins/data/common/types.ts index bc0d0c323bafa..79689c3020519 100644 --- a/src/plugins/data/common/types.ts +++ b/src/plugins/data/common/types.ts @@ -22,3 +22,4 @@ export * from './timefilter/types'; export * from './query/types'; export * from './kbn_field_types/types'; export * from './index_patterns/types'; +export { TextContextTypeConvert } from './field_formats/types'; diff --git a/src/plugins/data/common/field_formats/converters/date.test.ts b/src/plugins/data/public/field_formats/converters/date.test.ts similarity index 100% rename from src/plugins/data/common/field_formats/converters/date.test.ts rename to src/plugins/data/public/field_formats/converters/date.test.ts diff --git a/src/plugins/data/common/field_formats/converters/date.ts b/src/plugins/data/public/field_formats/converters/date.ts similarity index 92% rename from src/plugins/data/common/field_formats/converters/date.ts rename to src/plugins/data/public/field_formats/converters/date.ts index 06af64d9c17c2..67d3a0ed2e086 100644 --- a/src/plugins/data/common/field_formats/converters/date.ts +++ b/src/plugins/data/public/field_formats/converters/date.ts @@ -19,9 +19,12 @@ import { memoize, noop } from 'lodash'; import moment from 'moment'; -import { KBN_FIELD_TYPES } from '../../kbn_field_types/types'; -import { FieldFormat } from '../field_format'; -import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types'; +import { + FieldFormat, + KBN_FIELD_TYPES, + TextContextTypeConvert, + FIELD_FORMAT_IDS, +} from '../../../common'; export class DateFormat extends FieldFormat { static id = FIELD_FORMAT_IDS.DATE; diff --git a/src/plugins/data/public/field_formats/converters/index.ts b/src/plugins/data/public/field_formats/converters/index.ts new file mode 100644 index 0000000000000..c51111092beca --- /dev/null +++ b/src/plugins/data/public/field_formats/converters/index.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { DateFormat } from './date'; diff --git a/src/plugins/data/public/field_formats_provider/field_formats_service.ts b/src/plugins/data/public/field_formats_provider/field_formats_service.ts index 42abeecc6fda0..d67522507691f 100644 --- a/src/plugins/data/public/field_formats_provider/field_formats_service.ts +++ b/src/plugins/data/public/field_formats_provider/field_formats_service.ts @@ -24,7 +24,6 @@ import { BoolFormat, BytesFormat, ColorFormat, - DateFormat, DateNanosFormat, DurationFormat, IpFormat, @@ -38,6 +37,8 @@ import { UrlFormat, } from '../../common/'; +import { DateFormat } from '../field_formats/converters'; + export class FieldFormatsService { private readonly fieldFormats: FieldFormatRegisty = new FieldFormatRegisty(); diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index a000658a59f6b..e3557f7bb72db 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -49,6 +49,8 @@ export { TimeRange, } from '../common'; +export { DateFormat } from './field_formats/converters'; + /** * Static code to be shared externally * @public @@ -68,7 +70,6 @@ export { BoolFormat, BytesFormat, ColorFormat, - DateFormat, DateNanosFormat, DEFAULT_CONVERTER_COLOR, DurationFormat, diff --git a/src/plugins/data/common/field_formats/converters/date_server.ts b/src/plugins/data/server/field_formats/converters/date_server.ts similarity index 93% rename from src/plugins/data/common/field_formats/converters/date_server.ts rename to src/plugins/data/server/field_formats/converters/date_server.ts index 34278ea9fe641..8a56547379cb9 100644 --- a/src/plugins/data/common/field_formats/converters/date_server.ts +++ b/src/plugins/data/server/field_formats/converters/date_server.ts @@ -19,9 +19,14 @@ import { memoize, noop } from 'lodash'; import moment from 'moment-timezone'; -import { KBN_FIELD_TYPES } from '../../kbn_field_types/types'; -import { FieldFormat, IFieldFormatMetaParams } from '../field_format'; -import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types'; + +import { + FieldFormat, + KBN_FIELD_TYPES, + TextContextTypeConvert, + FIELD_FORMAT_IDS, + IFieldFormatMetaParams, +} from '../../../common'; export class DateFormat extends FieldFormat { static id = FIELD_FORMAT_IDS.DATE; diff --git a/src/plugins/data/server/field_formats/converters/index.ts b/src/plugins/data/server/field_formats/converters/index.ts new file mode 100644 index 0000000000000..f5c69df972869 --- /dev/null +++ b/src/plugins/data/server/field_formats/converters/index.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { DateFormat } from './date_server'; diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index ab908f90fc87b..5fa98e1586f75 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -72,7 +72,6 @@ export { BoolFormat, BytesFormat, ColorFormat, - DateFormat, DateNanosFormat, DEFAULT_CONVERTER_COLOR, DurationFormat, @@ -94,4 +93,6 @@ export { getKbnTypeNames, } from '../common'; +export { DateFormat } from './field_formats/converters'; + export { DataServerPlugin as Plugin, DataPluginSetup as PluginSetup };