Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Platform Migration Phase I]: update dateHisogramInterval & parseEsInterval imports #42917

Merged
merged 7 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,4 @@ export {
} from './filter/filter_manager';

/** @public static code */
export { dateHistogramInterval } from '../common/date_histogram_interval';
/** @public static code */
export {
isValidEsInterval,
InvalidEsCalendarIntervalError,
InvalidEsIntervalFormatError,
parseEsInterval,
ParsedInterval,
} from '../common/parse_es_interval';
export * from '../common';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

11 changes: 1 addition & 10 deletions src/legacy/core_plugins/data/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,4 @@
*/

/** @public static code */
export { dateHistogramInterval } from '../common/date_histogram_interval';

/** @public static code */
export {
isValidEsInterval,
InvalidEsCalendarIntervalError,
InvalidEsIntervalFormatError,
parseEsInterval,
ParsedInterval,
} from '../common/parse_es_interval';
export * from '../common';
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import moment from 'moment';
import { i18n } from '@kbn/i18n';
import { get } from 'lodash';

import { parseEsInterval } from '../../../../data/public';
import { GTE_INTERVAL_RE } from '../../../common/interval_regexp';
import { parseEsInterval } from '../../../../data/common/parse_es_interval';

export const AUTO_INTERVAL = 'auto';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import _ from 'lodash';
import { dateHistogramInterval } from '../../../../../../data/common';
import { dateHistogramInterval } from '../../../../../../data/server';
import { getBucketSize } from '../../helpers/get_bucket_size';
import { getTimerange } from '../../helpers/get_timerange';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { set } from 'lodash';
import { dateHistogramInterval } from '../../../../../../data/common';
import { dateHistogramInterval } from '../../../../../../data/server';
import { getBucketSize } from '../../helpers/get_bucket_size';
import { offsetTime } from '../../offset_time';
import { getIntervalAndTimefield } from '../../get_interval_and_timefield';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { set } from 'lodash';
import { dateHistogramInterval } from '../../../../../../data/common';
import { dateHistogramInterval } from '../../../../../../data/server';
import { getBucketSize } from '../../helpers/get_bucket_size';
import { isLastValueTimerangeMode } from '../../helpers/get_timerange_mode';
import { getIntervalAndTimefield } from '../../get_interval_and_timefield';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/agg_types/buckets/date_histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { intervalOptions } from './_interval_options';
import { TimeIntervalParamEditor } from '../controls/time_interval';
import { timefilter } from '../../timefilter';
import { DropPartialsParamEditor } from '../controls/drop_partials';
import { dateHistogramInterval } from '../../../../core_plugins/data/common';
import { dateHistogramInterval } from '../../../../core_plugins/data/public';
import { i18n } from '@kbn/i18n';

const config = chrome.getUiSettingsClient();
Expand Down
3 changes: 2 additions & 1 deletion src/legacy/ui/public/time_buckets/calc_es_interval.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/

import dateMath from '@elastic/datemath';
import { parseEsInterval } from 'ui/utils/parse_es_interval';

import { parseEsInterval } from '../../../core_plugins/data/public';

const unitsDesc = dateMath.unitsDesc;
const largeMax = unitsDesc.indexOf('M');
Expand Down
27 changes: 0 additions & 27 deletions src/legacy/ui/public/utils/parse_es_interval.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { AggConfig } from '../..';
import { AggType } from '../../../agg_types';
import { IndexPattern } from '../../../index_patterns';
import { leastCommonMultiple } from '../../../utils/math';
import { parseEsInterval } from '../../../utils/parse_es_interval';
import { parseEsInterval } from '../../../../../core_plugins/data/public';
import { leastCommonInterval } from '../../lib/least_common_interval';
import { EditorConfig, EditorParamConfig, FixedParam, NumericIntervalParam } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/vis/lib/least_common_interval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import dateMath from '@elastic/datemath';
import { leastCommonMultiple } from '../../utils/math';
import { parseEsInterval } from '../../utils/parse_es_interval';
import { parseEsInterval } from '../../../../core_plugins/data/public';

/**
* Finds the lowest common interval between two given ES date histogram intervals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {

import {
parseEsInterval,
} from 'ui/utils/parse_es_interval';
} from '../../../../../../../../../src/legacy/core_plugins/data/public';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=( but we should use relative imports now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know. Was just acknowledging that it's ugly.


import {
dateHistogramDetailsUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
InvalidEsIntervalFormatError,
InvalidEsCalendarIntervalError,
parseEsInterval,
} from 'ui/utils/parse_es_interval';
} from '../../../../../../../../../src/legacy/core_plugins/data/public';

export function validateDateHistogramInterval(dateHistogramInterval) {
if (!dateHistogramInterval || !dateHistogramInterval.trim()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
InvalidEsIntervalFormatError,
InvalidEsCalendarIntervalError,
parseEsInterval,
} from 'ui/utils/parse_es_interval';
} from '../../../../../../../../../src/legacy/core_plugins/data/public';

export function validateRollupDelay(rollupDelay) {
// This field is optional, so if nothing has been provided we can skip validation.
Expand Down