From 605be77a04cac622ed0a4cb5f96ff086764df067 Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Tue, 12 Dec 2017 11:54:09 +0100 Subject: [PATCH] Add nofilters query param --- lib/cartodb/backends/dataview.js | 8 ++++---- lib/cartodb/controllers/layergroup.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index 50ff60f1..cf32d0f7 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -40,8 +40,8 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param var pg = new PSQL(dbParamsFromReqParams(params)); var ownFilter = +params.own_filter; - // ownFilter = !!ownFilter; - var query = getDaviewQuery(dataviewDefinition, ownFilter); + var noFilters = !!params.no_filters; + var query = getDaviewQuery(dataviewDefinition, ownFilter, noFilters); if (params.bbox) { var bboxFilter = new BBoxFilter({column: 'the_geom_webmercator', srid: 3857}, {bbox: params.bbox}); query = bboxFilter.sql(query); @@ -62,8 +62,8 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param ); }; -function getDaviewQuery(dataviewDefinition, ownFilter) { - if (ownFilter === -1) { +function getDaviewQuery(dataviewDefinition, ownFilter, noFilters) { + if (noFilters) { return dataviewDefinition.sql.no_filters; } else if (ownFilter === 1) { return dataviewDefinition.sql.own_filter_on; diff --git a/lib/cartodb/controllers/layergroup.js b/lib/cartodb/controllers/layergroup.js index a814ee43..7af7ef43 100644 --- a/lib/cartodb/controllers/layergroup.js +++ b/lib/cartodb/controllers/layergroup.js @@ -109,6 +109,7 @@ LayergroupController.prototype.register = function(app) { var allowedDataviewQueryParams = [ 'filters', // json 'own_filter', // 0, 1 + 'no_filters', // 0, 1 'bbox', // w,s,e,n 'start', // number 'end', // number