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

shim visualizations plugin #50624

Merged
merged 10 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
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