Skip to content

Commit

Permalink
[Step 2] ui/persisted_state 👉 src/plugins/visualizations (#58501) (#5…
Browse files Browse the repository at this point in the history
…8770)

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
alexwizp and elasticmachine authored Feb 28, 2020
1 parent 37c656a commit 80349f2
Show file tree
Hide file tree
Showing 32 changed files with 289 additions and 680 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
import { buildTabularInspectorData } from './build_tabular_inspector_data';
import { calculateObjectHash } from '../../../../visualizations/public';
import { tabifyAggResponse } from '../../../../../core_plugins/data/public';
import { PersistedState } from '../../../../../ui/public/persisted_state';
import { PersistedState } from '../../../../../../plugins/visualizations/public';
import { Adapters } from '../../../../../../plugins/inspector/public';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getQueryService, getIndexPatterns } from '../../../../../../plugins/data/public/services';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export { State } from 'ui/state_management/state';
export { GlobalStateProvider } from 'ui/state_management/global_state';
// @ts-ignore
export { StateManagementConfigProvider } from 'ui/state_management/config_provider';
export { PersistedState } from 'ui/persisted_state';

export { subscribeWithScope } from 'ui/utils/subscribe_with_scope';
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PersistedState } from '../../../legacy_imports';
import { PersistedState } from '../../../../../../../../plugins/visualizations/public';
import { ReduxLikeStateContainer } from '../../../../../../../../plugins/kibana_utils/public';
import { VisualizeAppState, VisualizeAppStateTransitions } from '../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

import { TimeRange, Query, Filter, DataPublicPluginStart } from 'src/plugins/data/public';
import { IEmbeddableStart } from 'src/plugins/embeddable/public';
import { PersistedState } from 'src/plugins/visualizations/public';
import { LegacyCoreStart } from 'kibana/public';
import { Vis } from 'src/legacy/core_plugins/visualizations/public';
import { VisSavedObject, PersistedState } from '../legacy_imports';
import { VisSavedObject } from '../legacy_imports';

export type PureVisState = ReturnType<Vis['getCurrentState']>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import React, { useMemo, useState, useCallback, KeyboardEventHandler, useEffect
import { get, isEqual } from 'lodash';
import { i18n } from '@kbn/i18n';
import { keyCodes, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui';

import { Vis } from 'src/legacy/core_plugins/visualizations/public';
import { PersistedState, AggGroupNames } from '../../legacy_imports';
import { AggGroupNames } from '../../legacy_imports';
import { DefaultEditorNavBar, OptionTab } from './navbar';
import { DefaultEditorControls } from './controls';
import { setStateParamValue, useEditorReducer, useEditorFormState, discardChanges } from './state';
import { DefaultEditorAggCommonProps } from '../agg_common_props';
import { PersistedState } from '../../../../../../plugins/visualizations/public';

interface DefaultEditorSideBarProps {
isCollapsed: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ export { isValidJson, isValidInterval } from 'ui/agg_types';
export { AggParamOption } from 'ui/agg_types';
export { CidrMask } from 'ui/agg_types';

export { PersistedState } from 'ui/persisted_state';
export * from 'ui/vis/lib';
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
* under the License.
*/

import { IAggConfigs, PersistedState } from './legacy_imports';
import { PersistedState } from '../../../../plugins/visualizations/public';
import { IAggConfigs } from './legacy_imports';
import { Vis } from '../../visualizations/public';

export interface VisOptionsProps<VisParamType = unknown> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

export { PersistedState } from 'ui/persisted_state';
// @ts-ignore
export { defaultFeedbackMessage } from 'ui/vis/default_feedback_message';
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import {
KibanaContext,
Render,
} from '../../../../plugins/expressions/public';
import { PersistedState } from '../../../../plugins/visualizations/public';

// @ts-ignore
import { metricsRequestHandler } from './request_handler';
import { PersistedState } from './legacy_imports';

type Input = KibanaContext | null;
type Output = Promise<Render<RenderValue>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

export { PersistedState } from '../../../ui/public/persisted_state';
export {
AggConfigs,
IAggConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

import { get } from 'lodash';
import React from 'react';

import { PersistedState } from '../../../legacy_imports';
import { PersistedState } from '../../../../../../../plugins/visualizations/public';
import { memoizeLast } from '../legacy/memoize';
import { VisualizationChart } from './visualization_chart';
import { VisualizationNoResults } from './visualization_noresults';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import React from 'react';
import * as Rx from 'rxjs';
import { debounceTime, filter, share, switchMap } from 'rxjs/operators';

import { PersistedState } from '../../../legacy_imports';
import { PersistedState } from '../../../../../../../plugins/visualizations/public';
import { Vis, VisualizationController } from '../vis';
import { getUpdateStatus } from '../legacy/update_status';
import { ResizeChecker } from '../../../../../../../plugins/kibana_utils/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ import {
IExpressionLoaderParams,
ExpressionsStart,
} from '../../../../../../../plugins/expressions/public';
import { PersistedState } from '../../../../../../../plugins/visualizations/public';
import { buildPipeline } from '../legacy/build_pipeline';
import { Vis } from '../vis';
import { getExpressions, getUiActions } from '../services';
import { PersistedState } from '../../../legacy_imports';
import { VisSavedObject } from '../types';

const getKeys = <T extends {}>(o: T): Array<keyof T> => Object.keys(o) as Array<keyof T>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import { EventEmitter } from 'events';
import _ from 'lodash';
import { PersistedState } from '../../../legacy_imports';
import { PersistedState } from '../../../../../../../plugins/visualizations/public';

import { getTypes } from '../services';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@

import { get } from 'lodash';
import { i18n } from '@kbn/i18n';
import { VisResponseValue } from '../../../../../../../plugins/visualizations/public';
import {
VisResponseValue,
PersistedState,
} from '../../../../../../../plugins/visualizations/public';
import {
ExpressionFunctionDefinition,
Render,
} from '../../../../../../../plugins/expressions/public';
import { PersistedState } from '../../../legacy_imports';
import { getTypes, getIndexPatterns, getFilterManager } from '../services';

interface Arguments {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PersistedState } from '../../../legacy_imports';
import { PersistedState } from '../../../../../../../plugins/visualizations/public';
import { calculateObjectHash } from './calculate_object_hash';
import { Vis } from '../vis';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

import { EventEmitter } from 'events';
import _ from 'lodash';
import { AggConfigs, PersistedState } from '../../legacy_imports';
import { PersistedState } from '../../../../../../../src/plugins/visualizations/public';
import { AggConfigs } from '../../legacy_imports';
import { updateVisualizationConfig } from './legacy/vis_update';
import { getTypes } from './services';

Expand Down
7 changes: 4 additions & 3 deletions src/legacy/ui/public/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
/**
* @name Events
*
* @extends SimpleEmitter
* @extends EventEmitter
*/

import _ from 'lodash';
import { EventEmitter } from 'events';
import { fatalError } from './notify';
import { SimpleEmitter } from './utils/simple_emitter';
import { createLegacyClass } from './utils/legacy_class';
import { createDefer } from 'ui/promises';

const location = 'EventEmitter';

export function EventsProvider(Promise) {
createLegacyClass(Events).inherits(SimpleEmitter);
createLegacyClass(Events).inherits(EventEmitter);
function Events() {
Events.Super.call(this);
this._listeners = {};
Expand Down Expand Up @@ -79,6 +79,7 @@ export function EventsProvider(Promise) {
*/
Events.prototype.off = function(name, handler) {
if (!name && !handler) {
this._listeners = {};
return this.removeAllListeners();
}

Expand Down
26 changes: 0 additions & 26 deletions src/legacy/ui/public/persisted_state/errors.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/legacy/ui/public/persisted_state/index.js

This file was deleted.

29 changes: 0 additions & 29 deletions src/legacy/ui/public/persisted_state/persisted_state.d.ts

This file was deleted.

Loading

0 comments on commit 80349f2

Please sign in to comment.