Skip to content

Commit

Permalink
ui/render_complete πŸ‘‰ src/plugins/kibana_utils (#44743) (#46597)
Browse files Browse the repository at this point in the history
* Moved ui/render_complete to kibana_utils.
  • Loading branch information
mattkime authored Sep 26, 2019
1 parent 67b1f56 commit 8a777fd
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import 'ngreact';
import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
import '../../../../../ui/public/render_complete/directive';

import { DiscoverNoResults } from './no_results';
import { DiscoverUninitialized } from './uninitialized';
import { DiscoverUnsupportedIndexPattern } from './unsupported_index_pattern';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import openRowHtml from './table_row/open.html';
import detailsHtml from './table_row/details.html';
import { uiModules } from 'ui/modules';
import { disableFilter } from '@kbn/es-query';
import { dispatchRenderComplete } from 'ui/render_complete';
import { dispatchRenderComplete } from '../../../../../../../plugins/kibana_utils/public';
import cellTemplateHtml from '../components/table_row/cell.html';
import truncateByHeightTemplateHtml from '../components/table_row/truncate_by_height.html';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import html from './doc_table.html';
import './infinite_scroll';
import './components/table_header';
import './components/table_row';
import { dispatchRenderComplete } from 'ui/render_complete';
import { dispatchRenderComplete } from '../../../../../../plugins/kibana_utils/public';
import { uiModules } from 'ui/modules';
import './components/pager';
import './lib/pager';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/render_complete/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { uiModules } from '../modules';
import { RenderCompleteHelper } from './render_complete_helper';
import { RenderCompleteHelper } from '../../../../plugins/kibana_utils/public';

uiModules
.get('kibana')
Expand Down
1 change: 1 addition & 0 deletions src/legacy/ui/public/vis/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import { EventEmitter } from 'events';
import _ from 'lodash';
import '../render_complete/directive';
import { VisTypesRegistryProvider } from '../registry/vis_types';
import { AggConfigs } from '../agg_types/agg_configs';
import { PersistedState } from '../persisted_state';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/vislib/lib/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { Alerts } from './alerts';
import { Axis } from './axis/axis';
import { ChartGrid as Grid } from './chart_grid';
import { visTypes as chartTypes } from '../visualizations/vis_types';
import { dispatchRenderComplete } from '../../render_complete';
import { dispatchRenderComplete } from '../../../../../plugins/kibana_utils/public';

const markdownIt = new MarkdownIt({
html: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import * as Rx from 'rxjs';
import { debounceTime, filter, share, switchMap, tap } from 'rxjs/operators';

import { PersistedState } from '../../persisted_state';
import { dispatchRenderComplete, dispatchRenderStart } from '../../render_complete';
import {
dispatchRenderComplete,
dispatchRenderStart,
} from '../../../../../plugins/kibana_utils/public';
import { ResizeChecker } from '../../resize_checker';
import { Vis, VisualizationController } from '../../vis';
import { getUpdateStatus } from '../../vis/update_status';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui';
import React from 'react';
import { dispatchRenderComplete } from '../../render_complete';
import { dispatchRenderComplete } from '../../../../../plugins/kibana_utils/public';

interface VisualizationNoResultsProps {
onInit?: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui';
import React from 'react';
import { SearchError } from 'ui/courier';
import { dispatchRenderComplete } from '../../render_complete';
import { dispatchRenderComplete } from '../../../../../plugins/kibana_utils/public';

interface VisualizationRequestErrorProps {
onInit?: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { VisProvider } from '../../../vis';
import { getVisualizeLoader } from '../visualize_loader';
import { EmbeddedVisualizeHandler } from '../embedded_visualize_handler';
import { Inspector } from '../../../inspector/inspector';
import { dispatchRenderComplete } from '../../../render_complete';
import { dispatchRenderComplete } from '../../../../../../plugins/kibana_utils/public';
import { PipelineDataLoader } from '../pipeline_data_loader';
import { PersistedState } from '../../../persisted_state';
import { DataAdapter, RequestAdapter } from '../../../inspector/adapters';
Expand Down Expand Up @@ -154,15 +154,15 @@ describe('visualize loader', () => {

it('should render the visualize element', () => {
const container = newContainer();
loader.embedVisualizationWithSavedObject(container[0], createSavedObject(), { });
loader.embedVisualizationWithSavedObject(container[0], createSavedObject(), {});
expect(container.find('[data-test-subj="visualizationLoader"]').length).to.be(1);
});

it('should not mutate vis.params', () => {
const container = newContainer();
const savedObject = createSavedObject();
const paramsBefore = cloneDeep(vis.params);
loader.embedVisualizationWithSavedObject(container[0], savedObject, { });
loader.embedVisualizationWithSavedObject(container[0], savedObject, {});
const paramsAfter = cloneDeep(vis.params);
expect(paramsBefore).to.eql(paramsAfter);
});
Expand Down Expand Up @@ -332,8 +332,8 @@ describe('visualize loader', () => {
});

it('should allow adding custom inspector adapters via the custom key', () => {
const Foodapter = class {};
const Bardapter = class {};
const Foodapter = class { };
const Bardapter = class { };
const savedObj = createSavedObject();
savedObj.vis.type.inspectorAdapters = {
custom: { foo: Foodapter, bar: Bardapter }
Expand All @@ -344,7 +344,7 @@ describe('visualize loader', () => {
});

it('should not share adapter instances between vis instances', () => {
const Foodapter = class {};
const Foodapter = class { };
const savedObj1 = createSavedObject();
const savedObj2 = createSavedObject();
savedObj1.vis.type.inspectorAdapters = { custom: { foo: Foodapter } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Inspector } from '../../inspector';
import { Adapters } from '../../inspector/types';
import { PersistedState } from '../../persisted_state';
import { IPrivate } from '../../private';
import { RenderCompleteHelper } from '../../render_complete';
import { RenderCompleteHelper } from '../../../../../plugins/kibana_utils/public';
import { AppState } from '../../state_management/app_state';
import { timefilter } from '../../timefilter';
import { Vis } from '../../vis';
Expand Down
1 change: 1 addition & 0 deletions src/plugins/kibana_utils/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@

export * from './store';
export * from './parse';
export * from './render_complete';
export * from './errors';
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* under the License.
*/

import './directive';

const dispatchCustomEvent = (el: HTMLElement, eventName: string) => {
// we're using the native events so that we aren't tied to the jQuery custom events,
// otherwise we have to use jQuery(element).on(...) because jQuery's events sit on top
Expand Down

0 comments on commit 8a777fd

Please sign in to comment.