Replaces List with Widget backend and changes list access to be layer based
This commit is contained in:
@@ -17,7 +17,7 @@ var TablesCacheEntry = require('../cache/model/database_tables_entry');
|
||||
* @param {TileBackend} tileBackend
|
||||
* @param {PreviewBackend} previewBackend
|
||||
* @param {AttributesBackend} attributesBackend
|
||||
* @param {ListBackend} listBackend
|
||||
* @param {WidgetBackend} widgetBackend
|
||||
* @param {SurrogateKeysCache} surrogateKeysCache
|
||||
* @param {UserLimitsApi} userLimitsApi
|
||||
* @param {QueryTablesApi} queryTablesApi
|
||||
@@ -25,14 +25,14 @@ var TablesCacheEntry = require('../cache/model/database_tables_entry');
|
||||
* @constructor
|
||||
*/
|
||||
function LayergroupController(authApi, pgConnection, mapStore, tileBackend, previewBackend, attributesBackend,
|
||||
listBackend, surrogateKeysCache, userLimitsApi, queryTablesApi, layergroupAffectedTables) {
|
||||
widgetBackend, surrogateKeysCache, userLimitsApi, queryTablesApi, layergroupAffectedTables) {
|
||||
BaseController.call(this, authApi, pgConnection);
|
||||
|
||||
this.mapStore = mapStore;
|
||||
this.tileBackend = tileBackend;
|
||||
this.previewBackend = previewBackend;
|
||||
this.attributesBackend = attributesBackend;
|
||||
this.listBackend = listBackend;
|
||||
this.widgetBackend = widgetBackend;
|
||||
this.surrogateKeysCache = surrogateKeysCache;
|
||||
this.userLimitsApi = userLimitsApi;
|
||||
this.queryTablesApi = queryTablesApi;
|
||||
@@ -70,7 +70,7 @@ LayergroupController.prototype.register = function(app) {
|
||||
this.bbox.bind(this));
|
||||
|
||||
app.get(app.base_url_mapconfig +
|
||||
'/:token/list/:listName', cors(), userMiddleware,
|
||||
'/:token/:layer/list/:listName', cors(), userMiddleware,
|
||||
this.list.bind(this));
|
||||
|
||||
};
|
||||
@@ -88,7 +88,7 @@ LayergroupController.prototype.list = function(req, res) {
|
||||
var mapConfigProvider = new MapStoreMapConfigProvider(
|
||||
self.mapStore, req.context.user, self.userLimitsApi, req.params
|
||||
);
|
||||
self.listBackend.getList(mapConfigProvider, req.params, this);
|
||||
self.widgetBackend.getList(mapConfigProvider, req.params, this);
|
||||
},
|
||||
function finish(err, tile, stats) {
|
||||
req.profiler.add(stats || {});
|
||||
|
||||
@@ -161,7 +161,7 @@ module.exports = function(serverOptions) {
|
||||
tileBackend,
|
||||
previewBackend,
|
||||
attributesBackend,
|
||||
new windshaft.backend.List(),
|
||||
new windshaft.backend.Widget(),
|
||||
surrogateKeysCache,
|
||||
userLimitsApi,
|
||||
queryTablesApi,
|
||||
|
||||
@@ -35,9 +35,12 @@ describe('lists', function() {
|
||||
cartocss: '#layer { marker-fill: red; marker-width: 32; marker-allow-overlap: true; }',
|
||||
cartocss_version: '2.3.0'
|
||||
},
|
||||
lists: {
|
||||
widgets: {
|
||||
names: {
|
||||
columns: ['name']
|
||||
type: 'list',
|
||||
options: {
|
||||
columns: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,7 +83,7 @@ describe('lists', function() {
|
||||
|
||||
assert.response(server,
|
||||
{
|
||||
url: '/api/v1/map/' + layergroupId + '/list/names',
|
||||
url: '/api/v1/map/' + layergroupId + '/0/list/names',
|
||||
method: 'GET',
|
||||
headers: {
|
||||
host: 'localhost'
|
||||
|
||||
Reference in New Issue
Block a user