Skip to content

Commit

Permalink
shim visualizations plugin (#50624) (#51801)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored Nov 28, 2019
1 parent 7dc3f4a commit 5167d38
Show file tree
Hide file tree
Showing 112 changed files with 1,509 additions and 1,692 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
} from '../../../../../ui/public/filter_manager/query_filter';

import { buildTabularInspectorData } from '../../../../../ui/public/inspector/build_tabular_inspector_data';
import { calculateObjectHash } from '../../../../../ui/public/vis/lib/calculate_object_hash';
import { calculateObjectHash } from '../../../../visualizations/public';
import { getTime } from '../../../../../ui/public/timefilter';
// @ts-ignore
import { tabifyAggResponse } from '../../../../../ui/public/agg_response/tabify/tabify';
Expand Down
95 changes: 44 additions & 51 deletions src/legacy/core_plugins/input_control_vis/public/register_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,65 +17,58 @@
* under the License.
*/

import { visFactory } from 'ui/vis/vis_factory';
import { VisController } from './vis_controller';
import { ControlsTab } from './components/editor/controls_tab';
import { OptionsTab } from './components/editor/options_tab';
import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message';
import { Status } from 'ui/vis/update_status';
import { i18n } from '@kbn/i18n';
import { setup as visualizations } from '../../visualizations/public/np_ready/public/legacy';
import { Status, defaultFeedbackMessage } from '../../visualizations/public';

function InputControlVisProvider() {

// return the visType object, which kibana will use to display and configure new Vis object of this type.
return visFactory.createBaseVisualization({
name: 'input_control_vis',
title: i18n.translate('inputControl.register.controlsTitle', {
defaultMessage: 'Controls'
}),
icon: 'visControls',
description: i18n.translate('inputControl.register.controlsDescription', {
defaultMessage: 'Create interactive controls for easy dashboard manipulation.'
}),
stage: 'experimental',
requiresUpdateStatus: [Status.PARAMS, Status.TIME],
feedbackMessage: defaultFeedbackMessage,
visualization: VisController,
visConfig: {
defaults: {
controls: [],
updateFiltersOnChange: false,
useTimeFilter: false,
pinFilters: false,
},
},
editor: 'default',
editorConfig: {
optionTabs: [
{
name: 'controls',
title: i18n.translate('inputControl.register.tabs.controlsTitle', {
defaultMessage: 'Controls'
}),
editor: ControlsTab
},
{
name: 'options',
title: i18n.translate('inputControl.register.tabs.optionsTitle', {
defaultMessage: 'Options'
}),
editor: OptionsTab
}
]
export const inputControlVisDefinition = {
name: 'input_control_vis',
title: i18n.translate('inputControl.register.controlsTitle', {
defaultMessage: 'Controls'
}),
icon: 'visControls',
description: i18n.translate('inputControl.register.controlsDescription', {
defaultMessage: 'Create interactive controls for easy dashboard manipulation.'
}),
stage: 'experimental',
requiresUpdateStatus: [Status.PARAMS, Status.TIME],
feedbackMessage: defaultFeedbackMessage,
visualization: VisController,
visConfig: {
defaults: {
controls: [],
updateFiltersOnChange: false,
useTimeFilter: false,
pinFilters: false,
},
requestHandler: 'none',
responseHandler: 'none',
});
}
},
editor: 'default',
editorConfig: {
optionTabs: [
{
name: 'controls',
title: i18n.translate('inputControl.register.tabs.controlsTitle', {
defaultMessage: 'Controls'
}),
editor: ControlsTab
},
{
name: 'options',
title: i18n.translate('inputControl.register.tabs.optionsTitle', {
defaultMessage: 'Options'
}),
editor: OptionsTab
}
]
},
requestHandler: 'none',
responseHandler: 'none',
};

// register the provider with the visTypes registry
visualizations.types.registerVisualization(InputControlVisProvider);
visualizations.types.createBaseVisualization(inputControlVisDefinition);

// export the provider so that the visType can be required with Private()
export default InputControlVisProvider;
Loading

0 comments on commit 5167d38

Please sign in to comment.