Skip to content

Commit

Permalink
update for 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Sep 23, 2017
1 parent dbfceb7 commit 574acb8
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 80 deletions.
10 changes: 6 additions & 4 deletions public/POIs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ const _ = require('lodash');
const L = require('leaflet');
import { markerIcon } from 'plugins/enhanced_tilemap/vislib/markerIcon';
import { toLatLng } from 'plugins/enhanced_tilemap/vislib/geo_point';
import { SearchSourceProvider } from 'ui/courier/data_source/search_source';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
import utils from 'plugins/enhanced_tilemap/utils';

define(function (require) {
return function POIsFactory(Private, savedSearches) {

const SearchSource = Private(require('ui/courier/data_source/search_source'));
const queryFilter = Private(require('ui/filter_bar/query_filter'));
const SearchSource = Private(SearchSourceProvider);
const queryFilter = Private(FilterBarQueryFilterProvider);

/**
* Points of Interest
Expand Down Expand Up @@ -108,7 +110,7 @@ define(function (require) {
},
pointToLayer: function (feature, latlng) {
return L.circleMarker(
latlng,
latlng,
{
radius: 6
});
Expand Down Expand Up @@ -165,4 +167,4 @@ define(function (require) {

return POIs;
}
});
});
11 changes: 7 additions & 4 deletions public/directives/savedSearch.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const _ = require('lodash');
const module = require('ui/modules').get('kibana');
import { backwardsCompatible } from 'plugins/enhanced_tilemap/backwardsCompatible';
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
import { uiModules } from 'ui/modules';

const module = uiModules.get('kibana');

define(function (require) {
module.directive('savedSearch', function (Private, indexPatterns) {
const service = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName.searches;
const service = Private(SavedObjectRegistryProvider).byLoaderPropertiesName.searches;

return {
restrict: 'E',
Expand All @@ -25,7 +28,7 @@ define(function (require) {
};

fetchSavedSearches();

scope.updateIndex = function() {
scope.warn = "";
scope.layer.savedSearchId = scope.savedSearch.value;
Expand Down Expand Up @@ -85,7 +88,7 @@ define(function (require) {
}).map(function (field) {
return field.name;
});

const labelFields = index.fields.filter(function (field) {
let keep = true;
if (field.type === 'boolean' || field.type === 'geo_point' || field.type === 'geo_shape') {
Expand Down
7 changes: 4 additions & 3 deletions public/directives/tooltipFormatter.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
</select>
</div>
<div class="form-group" ng-if="tooltip.type === 'search'">
<input class="form-control"
<p>Saved search tooltip no longer supported. Kibana 5.5 changes broke this feature</p>
<!--<input class="form-control"
placeholder="Filter searches list"
ng-model="tooltip.options.searchFilter"
ng-change="filterSearchList()"
ng-model-options="{debounce:750}">
<select required class="form-control"
ng-model="tooltip.options.searchId"
ng-options="search.id as search.label for search in searchList">
</select>
</select>-->
</div>
<div class="form-group" ng-if="tooltip.type === 'visualization'">
<input class="form-control"
Expand Down Expand Up @@ -54,4 +55,4 @@
Close tooltip on mouseout
</label>
</div>
</div>
</div>
11 changes: 7 additions & 4 deletions public/directives/tooltipFormatter.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const _ = require('lodash');
const module = require('ui/modules').get('kibana');
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
import { uiModules } from 'ui/modules';

const module = uiModules.get('kibana');

define(function (require) {
module.directive('tooltipFormatter', function (Private, indexPatterns) {
const visService = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName.visualizations;
const searchService = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName.searches;
const visService = Private(SavedObjectRegistryProvider).byLoaderPropertiesName.visualizations;
const searchService = Private(SavedObjectRegistryProvider).byLoaderPropertiesName.searches;

return {
restrict: 'E',
Expand Down Expand Up @@ -75,4 +78,4 @@ define(function (require) {
}
}
});
});
});
11 changes: 1 addition & 10 deletions public/tooltip/popupVisualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import 'ui/visualize/visualize.less';
import 'ui/visualize/visualize_legend';
import $ from 'jquery';
import _ from 'lodash';
import RegistryVisTypesProvider from 'ui/registry/vis_types';
import uiModules from 'ui/modules';
import { uiModules } from 'ui/modules';
import visualizeTemplate from 'ui/visualize/visualize.html';
import 'angular-sanitize';

Expand All @@ -18,14 +17,6 @@ import {
uiModules
.get('kibana/directive', ['ngSanitize'])
.directive('popupVisualize', function (Notifier, SavedVis, indexPatterns, Private, config, $timeout) {


let visTypes = Private(RegistryVisTypesProvider);

let notify = new Notifier({
location: 'Visualize'
});

return {
restrict: 'E',
require: '?renderCounter',
Expand Down
11 changes: 9 additions & 2 deletions public/tooltip/searchTooltip.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<doc-table
hits="hits"
index-pattern="indexPattern"
search-source="searchSource"
sorting="sort"
columns="columns"
data-title="title"
data-description="description"
filter="filter"
on-add-column="addColumn"
on-change-sort-order="setSortOrder"
on-move-column="moveColumn"
on-remove-column="removeColumn"
class="panel-content">
</doc-table>
</doc-table>
30 changes: 22 additions & 8 deletions public/tooltip/searchTooltip.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import _ from 'lodash';
import $ from 'jquery';
import utils from 'plugins/enhanced_tilemap/utils';
import { SearchSourceProvider } from 'ui/courier/data_source/search_source';

define(function (require) {
return function SearchTooltipFactory(
$compile, $rootScope, $timeout,
$compile, $rootScope, $timeout,
Private, savedSearches) {

const geoFilter = Private(require('plugins/enhanced_tilemap/vislib/geoFilter'));
const SearchSource = Private(require('ui/courier/data_source/search_source'));
const SearchSource = Private(SearchSourceProvider);

class SearchTooltip {
constructor(searchId, fieldname, geotype, options) {
Expand All @@ -35,10 +36,23 @@ define(function (require) {
const self = this;
savedSearches.get(this.searchId).then(function (savedSearch) {
origSearchSource = savedSearch.searchSource;
self.$tooltipScope.hits = [];
self.$tooltipScope.indexPattern = savedSearch.searchSource._state.index;
self.$tooltipScope.searchSource = savedSearch.searchSource;
self.$tooltipScope.columns = savedSearch.columns;
self.$tooltipScope.sort = savedSearch.sort;
self.$tooltipScope.title = savedSearch.title;
self.$tooltipScope.description = savedSearch.description;
self.$tooltipScope.setSortOrder = () => {
console.log('setSortOrder no supported');
};
self.$tooltipScope.addColumn = () => {
console.log('addColumn no supported');
};
self.$tooltipScope.removeColumn = () => {
console.log('removeColumn no supported');
};
self.$tooltipScope.moveColumn = () => {
console.log('moveColumn no supported');
};
self.$visEl = linkFn(self.$tooltipScope);
});

Expand Down Expand Up @@ -68,7 +82,7 @@ define(function (require) {
});

const $popup = $(map.getContainer()).find('.leaflet-popup-content');

//A lot can happed between calling fetch and getting a response
//Only update popup content if the popup context is still for this fetch
if ($popup
Expand All @@ -83,10 +97,10 @@ define(function (require) {
});

return loadHtml;
}
}
}
}

return SearchTooltip;
};
});
};
});
13 changes: 7 additions & 6 deletions public/tooltip/visTooltip.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import _ from 'lodash';
import $ from 'jquery';
import utils from 'plugins/enhanced_tilemap/utils';
import { SearchSourceProvider } from 'ui/courier/data_source/search_source';

define(function (require) {
return function VisTooltipFactory(
$compile, $rootScope, $timeout,
$compile, $rootScope, $timeout,
getAppState, Private, savedVisualizations) {

const geoFilter = Private(require('plugins/enhanced_tilemap/vislib/geoFilter'));
const SearchSource = Private(require('ui/courier/data_source/search_source'));
const SearchSource = Private(SearchSourceProvider);
const $state = getAppState();
const UI_STATE_ID = 'popupVis';

Expand Down Expand Up @@ -73,7 +74,7 @@ define(function (require) {
});

const $popup = $(map.getContainer()).find('.leaflet-popup-content');

//A lot can happed between calling fetch and getting a response
//Only update popup content if the popup context is still for this fetch
if ($popup
Expand All @@ -86,10 +87,10 @@ define(function (require) {
});

return loadHtml;
}
}
}
}

return VisTooltip;
};
});
};
});
22 changes: 11 additions & 11 deletions public/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import 'plugins/enhanced_tilemap/bower_components/angularjs-slider/dist/rzslider
import 'plugins/enhanced_tilemap/bower_components/angularjs-slider/dist/rzslider.js';
import 'plugins/enhanced_tilemap/bower_components/angularjs-dropdown-multiselect/dist/angularjs-dropdown-multiselect.min';
import _ from 'lodash';
import supports from 'ui/utils/supports';
import AggResponseGeoJsonGeoJsonProvider from 'ui/agg_response/geo_json/geo_json';
import FilterBarPushFilterProvider from 'ui/filter_bar/push_filter';
import VisVisTypeProvider from 'ui/vis/vis_type';
import TemplateVisTypeTemplateVisTypeProvider from 'ui/template_vis_type/template_vis_type';
import VisSchemasProvider from 'ui/vis/schemas';
import { supports } from 'ui/utils/supports';
import { AggResponseGeoJsonProvider } from 'ui/agg_response/geo_json/geo_json';
import { VisVisTypeProvider } from 'ui/vis/vis_type';
import { TemplateVisTypeProvider } from 'ui/template_vis_type/template_vis_type';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { VisSchemasProvider } from 'ui/vis/schemas';

define(function (require) {
require('ui/registry/vis_types').register(EnhancedTileMapVisProvider);
VisTypesRegistryProvider.register(EnhancedTileMapVisProvider);
require('plugins/enhanced_tilemap/vis.less');
require('plugins/enhanced_tilemap/lib/jquery.minicolors/minicolors');
require('plugins/enhanced_tilemap/directives/bands');
Expand All @@ -24,15 +24,15 @@ define(function (require) {

function EnhancedTileMapVisProvider(Private, getAppState, courier, config) {
const VisType = Private(VisVisTypeProvider);
const TemplateVisType = Private(TemplateVisTypeTemplateVisTypeProvider);
const TemplateVisType = Private(TemplateVisTypeProvider);
const Schemas = Private(VisSchemasProvider);
const geoJsonConverter = Private(AggResponseGeoJsonGeoJsonProvider);
const geoJsonConverter = Private(AggResponseGeoJsonProvider);

return new TemplateVisType({
name: 'enhanced_tilemap',
title: 'Enhanced Tile map',
title: 'Enhanced Coordinate Map',
icon: 'fa-map-marker',
description: 'Tile map plugin that provides better performance, complete geospatial query support, and more features than the built in Tile map.',
description: 'Coordinate map plugin that provides better performance, complete geospatial query support, and more features than the built in Coordinate map.',
category: VisType.CATEGORY.MAP,
template: require('plugins/enhanced_tilemap/vis.html'),
params: {
Expand Down
Loading

0 comments on commit 574acb8

Please sign in to comment.