Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Commit

Permalink
updating to 6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed May 14, 2018
1 parent e15f863 commit e4d3257
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
18 changes: 6 additions & 12 deletions index.js
@@ -1,24 +1,18 @@
export default function (kibana) {

return new kibana.Plugin({
require: ['kibana'],
uiExports: {
app: {
title: 'Test Visualize',
description: 'This is a sample plugin to test using existing kibana visualizations',
main: 'plugins/kibana_sample_plugin/test_vis_app',
uses: [ // these are needed if you need to show exiting kibana visualizations
'visTypes',
'visResponseHandlers',
'visRequestHandlers',
'visEditorTypes',
'savedObjectTypes',
'spyModes',
'fieldFormats',
],
injectVars: (server) => {
return server.plugins.kibana.injectVars(server);
}
}
},
init(server) {
server.injectUiAppVars('kibana_sample_plugin', async () => {
return await server.getInjectedUiAppVars('kibana');
});
}
});
}
25 changes: 18 additions & 7 deletions public/test_vis_app.js
@@ -1,12 +1,23 @@
require('ui/autoload/all');
require('ui/routes').enable();
require('ui/chrome');

// import the uiExports that we want to "use"
import 'uiExports/visTypes';
import 'uiExports/visResponseHandlers';
import 'uiExports/visRequestHandlers';
import 'uiExports/visEditorTypes';
import 'uiExports/savedObjectTypes';
import 'uiExports/spyModes';
import 'uiExports/fieldFormats';

import './test_vis_app.less';
import './test_vis_app_controller.js';

const app = require('ui/modules').get('apps/kibana_sample_plugin', []);
import chrome from 'ui/chrome';

import uiRoutes from 'ui/routes';
import template from './test_vis_app.html';

const app = require('ui/modules').get('apps/kibana_sample_plugin', ['kibana']);

chrome.setRootTemplate(template);

require('ui/routes').when('/', {
template: require('./test_vis_app.html'),
reloadOnSearch: false,
});
11 changes: 6 additions & 5 deletions public/test_vis_app_controller.js
Expand Up @@ -19,14 +19,14 @@ app.controller('TestVisApp', function ($scope, Private, serviceSettings) {

const visContainer = $('.test-vis-app-visualize');
const timeRange = {
min: 'now-7d/d',
max: 'now'
from: 'now-7d/d',
to: 'now'
};

$scope.$watch('selectedVisualization', (visualizationId) => {
if (!visualizationId) return;
visualizeLoader.embedVisualizationWithId(visContainer, visualizationId, {
timeRange: timeRange
timeRange: timeRange,
});
});

Expand Down Expand Up @@ -72,11 +72,12 @@ app.controller('TestVisApp', function ($scope, Private, serviceSettings) {
}]
};

console.log(layersFromService);
const visConfig2 = {
type: 'region_map',
params: {
selectedLayer: layersFromService[1],
selectedJoinField:layersFromService[1].fields[0]
selectedLayer: layersFromService[0],
selectedJoinField:layersFromService[0].fields[0]
}
};

Expand Down

0 comments on commit e4d3257

Please sign in to comment.