Skip to content

Commit

Permalink
fixing spy
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed May 19, 2017
1 parent aa3ba2e commit fe89eda
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/core_plugins/spy_modes/public/table_spy_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ function VisSpyTableProvider(Notifier, $filter, $rootScope, config, Private) {
link: function tableLinkFn($scope) {
$rootScope.$watchMulti.call($scope, [
'vis',
'esResp'
'visData'
], function () {
if (!$scope.vis || !$scope.esResp) {
if (!$scope.vis || !$scope.visData) {
$scope.table = null;
} else {
if (!$scope.spy.params.spyPerPage) {
$scope.spy.params.spyPerPage = PER_PAGE_DEFAULT;
}

$scope.table = tabifyAggResponse($scope.vis, $scope.esResp, {
$scope.table = tabifyAggResponse($scope.vis, $scope.searchSource.rawResponse, {
canSplit: false,
asAggConfigResults: true,
partialRows: true
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/vis/editors/default/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
</div>

<div class="vis-editor-canvas">
<visualization vis="vis" vis-data="visData" ui-state="uiState" />
<visualization vis="vis" vis-data="visData" ui-state="uiState" search-source="searchSource" />
</div>
3 changes: 2 additions & 1 deletion src/ui/public/vis/editors/default/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ const defaultEditor = function ($rootScope, $compile) {
this.el = el;
}

render(vis, visData) {
render(vis, visData, searchSource) {
let $scope;

const updateScope = function () {
$scope.vis = vis;
$scope.visData = visData;
$scope.uiState = vis.getUiState();
$scope.searchSource = searchSource;
};

if (!this.$scope) {
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/vis/request_handlers/courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const CourierRequestHandlerProvider = function (Private, courier) {

return new Promise((resolve, reject) => {
searchSource.onResults().then(resp => {
searchSource.rawResponse = resp;
resolve(resp);
}).catch(e => reject(e));

Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/visualize/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ uiModules
scope : {
vis: '=',
visData: '=',
uiState: '=?'
uiState: '=?',
searchSource: '='
},
template: visualizationTemplate,
link: function ($scope, $el, attr, renderCounter) {
Expand Down
5 changes: 3 additions & 2 deletions src/ui/public/visualize/visualization_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ uiModules
scope : {
vis: '=',
visData: '=',
uiState: '=?'
uiState: '=?',
searchSource: '='
},
link: function ($scope, element) {
// Clone the _vis instance.
Expand All @@ -27,7 +28,7 @@ uiModules
const editor = new Editor(element);

const renderFunction = _.debounce(() => {
editor.render(vis, $scope.visData);
editor.render(vis, $scope.visData, $scope.searchSource);
$scope.$apply();
}, 200);

Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/visualize/visualize.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
vis-data="visData"
ui-state="uiState"
class="vis-editor-content"
search-source="savedVis.searchSource"
/>
<visualization ng-if="editorMode==false" vis="vis" vis-data="visData" ui-state="uiState" />
<visualization ng-if="editorMode==false" vis="vis" vis-data="visData" ui-state="uiState" search-source="savedVis.searchSource" />

2 changes: 1 addition & 1 deletion src/ui/public/visualize/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ uiModules
link: function ($scope, $el) {
$scope.vis = $scope.savedVis.vis;
$scope.editorMode = $scope.editorMode || false;
$scope.showSpyPanel = $scope.showSpyPanel || false;
$scope.vis.showSpyPanel = $scope.showSpyPanel || false;

const requestHandler = getHandler(requestHandlers, $scope.vis.type.requestHandler);
const responseHandler = getHandler(responseHandlers, $scope.vis.type.responseHandler);
Expand Down

0 comments on commit fe89eda

Please sign in to comment.