From 2b1f12e9d546437f85e71cb1d417be808fe8670a Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 2 Oct 2017 19:16:44 +0200 Subject: [PATCH 01/11] Allow to instantiate maps with analyses filters This decouples filters from dataviews. They are more verbose now. Misses validation of filters. --- .../adapter/analysis-mapconfig-adapter.js | 8 ++ test/acceptance/analysis/analyses-filters.js | 84 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 test/acceptance/analysis/analyses-filters.js diff --git a/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js index 8cb63f48..6cd0241d 100644 --- a/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js @@ -58,6 +58,13 @@ AnalysisMapConfigAdapter.prototype.getMapConfig = function(user, requestMapConfi requestMapConfig = appendFiltersToNodes(requestMapConfig, dataviewsFiltersBySourceId); + // Expected format for analyses filters + // filters = {analyses: { + // a1: [{min, max}, {accept, reject}], + // b1: [{range, column, min, max}, {category, column, accept, reject}] + // }} + requestMapConfig = appendFiltersToNodes(requestMapConfig, filters.analyses); + function createAnalysis(analysisDefinition, done) { self.analysisBackend.create(analysisConfiguration, analysisDefinition, function (err, analysis) { if (err) { @@ -200,6 +207,7 @@ function dataviewQuery(node, dataviewName, ownFilter) { function appendFiltersToNodes(requestMapConfig, dataviewsFiltersBySourceId) { var analyses = requestMapConfig.analyses || []; + dataviewsFiltersBySourceId = dataviewsFiltersBySourceId || {}; requestMapConfig.analyses = analyses.map(function(analysisDefinition) { var analysisGraph = new camshaft.reference.AnalysisGraph(analysisDefinition); diff --git a/test/acceptance/analysis/analyses-filters.js b/test/acceptance/analysis/analyses-filters.js new file mode 100644 index 00000000..152b29e6 --- /dev/null +++ b/test/acceptance/analysis/analyses-filters.js @@ -0,0 +1,84 @@ +require('../../support/test_helper'); + +const assert = require('../../support/assert'); +const TestClient = require('../../support/test-client'); + +describe('analysis-layers-dataviews', () => { + + const CARTOCSS = `#layer { + marker-fill-opacity: 1; + marker-line-color: white; + marker-line-width: 0.5; + marker-line-opacity: 1; + marker-placement: point; + marker-type: ellipse; + marker-width: 8; + marker-fill: red; + marker-allow-overlap: true; + }`; + + const mapConfig = { + version: '1.6.0', + layers: [ + { + "type": "cartodb", + "options": { + "source": { + "id": "a1" + }, + "cartocss": CARTOCSS, + "cartocss_version": "2.3.0" + } + } + ], + dataviews: { + pop_max_histogram: { + source: { + id: 'a1' + }, + type: 'histogram', + options: { + column: 'pop_max' + } + } + }, + analyses: [ + { + "id": "a1", + "type": "source", + "params": { + "query": "select * from populated_places_simple_reduced" + } + } + ] + }; + + it('should get a filtered histogram dataview', function(done) { + const testClient = new TestClient(mapConfig, 1234); + + const params = { + filters: { + analyses: { + 'a1': [ + { + type: 'range', + column: 'pop_max', + params: { + min: 2e6 + } + } + ] + } + } + }; + + testClient.getDataview('pop_max_histogram', params, (err, dataview) => { + assert.ok(!err, err); + + assert.equal(dataview.type, 'histogram'); + assert.equal(dataview.bins_start, 2008000); + + testClient.drain(done); + }); + }); +}); From 0c9d60b57397c3651126f7e702cf3f646c966c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 20 Oct 2017 16:19:24 +0200 Subject: [PATCH 02/11] Add support for no_filters params in dataviews --- lib/cartodb/backends/dataview.js | 19 ++- .../analysis/analyses-filters-params.js | 125 ++++++++++++++++++ 2 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 test/acceptance/analysis/analyses-filters-params.js diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index b6037ae6..edb0449b 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -24,7 +24,7 @@ module.exports = DataviewBackend; DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, params, callback) { - var dataviewName = params.dataviewName; + var dataviewName = params.dataviewName; step( function getMapConfig() { mapConfigProvider.getMapConfig(this); @@ -40,9 +40,8 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param var pg = new PSQL(dbParamsFromReqParams(params)); var ownFilter = +params.own_filter; - ownFilter = !!ownFilter; - - var query = (ownFilter) ? dataviewDefinition.sql.own_filter_on : dataviewDefinition.sql.own_filter_off; + // ownFilter = !!ownFilter; + var query = getDaviewQuery(dataviewDefinition, ownFilter); if (params.bbox) { var bboxFilter = new BBoxFilter({column: 'the_geom_webmercator', srid: 3857}, {bbox: params.bbox}); query = bboxFilter.sql(query); @@ -55,7 +54,7 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param ); var dataview = dataviewFactory.getDataview(query, dataviewDefinition); - dataview.getResult(pg, getOverrideParams(params, ownFilter), this); + dataview.getResult(pg, getOverrideParams(params, !!ownFilter), this); }, function returnCallback(err, result) { return callback(err, result); @@ -63,6 +62,16 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param ); }; +function getDaviewQuery(dataviewDefinition, ownFilter) { + if (ownFilter === -1) { + return dataviewDefinition.sql.no_filters; + } else if (ownFilter === 0) { + return dataviewDefinition.sql.own_filter_off; + } else if (ownFilter === 1) { + return dataviewDefinition.sql.own_filter_on; + } +} + function getQueryRewriteData(mapConfig, dataviewDefinition, params) { var sourceId = dataviewDefinition.source.id; // node.id var layer = _.find(mapConfig.obj().layers, function(l) { diff --git a/test/acceptance/analysis/analyses-filters-params.js b/test/acceptance/analysis/analyses-filters-params.js new file mode 100644 index 00000000..adb4d787 --- /dev/null +++ b/test/acceptance/analysis/analyses-filters-params.js @@ -0,0 +1,125 @@ +require('../../support/test_helper'); + +const assert = require('../../support/assert'); +const TestClient = require('../../support/test-client'); + +describe('analysis-filters-params', () => { + + const CARTOCSS = `#layer { + marker-fill-opacity: 1; + marker-line-color: white; + marker-line-width: 0.5; + marker-line-opacity: 1; + marker-placement: point; + marker-type: ellipse; + marker-width: 8; + marker-fill: red; + marker-allow-overlap: true; + }`; + + const mapConfig = { + version: '1.6.0', + layers: [ + { + "type": "cartodb", + "options": { + "source": { + "id": "a1" + }, + "cartocss": CARTOCSS, + "cartocss_version": "2.3.0" + } + } + ], + dataviews: { + pop_max_histogram: { + source: { + id: 'a1' + }, + type: 'histogram', + options: { + column: 'pop_max' + } + }, + pop_min_histogram: { + source: { + id: 'a1' + }, + type: 'histogram', + options: { + column: 'pop_min' + } + } + }, + analyses: [ + { + "id": "a1", + "type": "source", + "params": { + "query": "select * from populated_places_simple_reduced" + } + } + ] + }; + + var params = { + filters: { + dataviews: { + pop_max_histogram: { + min: 2e6 + }, + pop_min_histogram: { + max: 2e6 + } + } + }, + own_filter: -1 + }; + + + it('should get a filtered histogram dataview with all filters', function(done) { + const testClient = new TestClient(mapConfig, 1234); + + params.own_filter = 1; + + testClient.getDataview('pop_max_histogram', params, (err, dataview) => { + assert.ok(!err, err); + + assert.equal(dataview.type, 'histogram'); + assert.equal(dataview.bins_count, 6); + + testClient.drain(done); + }); + }); + + it('should get a filtered histogram dataview with all filters except my own filter', function(done) { + const testClient = new TestClient(mapConfig, 1234); + + params.own_filter = 0; + + testClient.getDataview('pop_max_histogram', params, (err, dataview) => { + assert.ok(!err, err); + + assert.equal(dataview.type, 'histogram'); + assert.equal(dataview.bins_count, 24); + + testClient.drain(done); + }); + }); + + it('should get a filtered histogram dataview without filters', function(done) { + const testClient = new TestClient(mapConfig, 1234); + + params.own_filter = -1; + + testClient.getDataview('pop_max_histogram', params, (err, dataview) => { + assert.ok(!err, err); + + assert.equal(dataview.type, 'histogram'); + assert.equal(dataview.bins_count, 48); + + testClient.drain(done); + }); + }); + +}); From 00f81db57eb7aa3f64914fa77bfda697e549d67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 20 Oct 2017 16:47:56 +0200 Subject: [PATCH 03/11] Fixed default value for own_filter --- lib/cartodb/backends/dataview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index edb0449b..50ff60f1 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -65,10 +65,10 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param function getDaviewQuery(dataviewDefinition, ownFilter) { if (ownFilter === -1) { return dataviewDefinition.sql.no_filters; - } else if (ownFilter === 0) { - return dataviewDefinition.sql.own_filter_off; } else if (ownFilter === 1) { return dataviewDefinition.sql.own_filter_on; + } else { + return dataviewDefinition.sql.own_filter_off; } } From 605be77a04cac622ed0a4cb5f96ff086764df067 Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Tue, 12 Dec 2017 11:54:09 +0100 Subject: [PATCH 04/11] 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 From 43fec743728a5718ce8e23328cd63703ba6fbdc0 Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Tue, 12 Dec 2017 15:12:33 +0100 Subject: [PATCH 05/11] Modify params specs --- test/acceptance/analysis/analyses-filters-params.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/acceptance/analysis/analyses-filters-params.js b/test/acceptance/analysis/analyses-filters-params.js index adb4d787..04b12d4e 100644 --- a/test/acceptance/analysis/analyses-filters-params.js +++ b/test/acceptance/analysis/analyses-filters-params.js @@ -73,7 +73,7 @@ describe('analysis-filters-params', () => { } } }, - own_filter: -1 + no_filters: 1 }; @@ -110,7 +110,7 @@ describe('analysis-filters-params', () => { it('should get a filtered histogram dataview without filters', function(done) { const testClient = new TestClient(mapConfig, 1234); - params.own_filter = -1; + params.no_filters = 1; testClient.getDataview('pop_max_histogram', params, (err, dataview) => { assert.ok(!err, err); From 50ddfaa968b37bd0b5ff4d2020a9ba0a62dd8066 Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Tue, 12 Dec 2017 15:56:16 +0100 Subject: [PATCH 06/11] Fix broken spec --- test/acceptance/analysis/analyses-filters-params.js | 3 +-- test/support/test-client.js | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/acceptance/analysis/analyses-filters-params.js b/test/acceptance/analysis/analyses-filters-params.js index 04b12d4e..52861a3a 100644 --- a/test/acceptance/analysis/analyses-filters-params.js +++ b/test/acceptance/analysis/analyses-filters-params.js @@ -72,8 +72,7 @@ describe('analysis-filters-params', () => { max: 2e6 } } - }, - no_filters: 1 + } }; diff --git a/test/support/test-client.js b/test/support/test-client.js index 3188d0fc..c56946cd 100644 --- a/test/support/test-client.js +++ b/test/support/test-client.js @@ -411,9 +411,12 @@ TestClient.prototype.getDataview = function(dataviewName, params, callback) { self.keysToDelete['map_cfg|' + LayergroupToken.parse(layergroupId).token] = 0; self.keysToDelete['user:localhost:mapviews:global'] = 5; - var urlParams = { - own_filter: params.hasOwnProperty('own_filter') ? params.own_filter : 1 - }; + var urlParams = {}; + if (params.hasOwnProperty('no_filters')) { + urlParams.no_filters = params.no_filters; + } else { + urlParams.own_filter = params.hasOwnProperty('own_filter') ? params.own_filter : 1 + } ['bbox', 'bins', 'start', 'end', 'aggregation', 'offset', 'categories'].forEach(function(extraParam) { if (params.hasOwnProperty(extraParam)) { From 53bc14bc9e40ef4f26c60c3c424e7b086af32421 Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Tue, 12 Dec 2017 16:02:39 +0100 Subject: [PATCH 07/11] Add missing contributors --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 00331d94..205e5b34 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "Sandro Santilli ", "Carlos MatallĂ­n ", "Daniel Garcia Aubert ", - "Mario de Frutos " + "Mario de Frutos ", + "Ivan Malagon ", + "Simon Martin " ], "dependencies": { "body-parser": "^1.18.2", From 811f2bdae3f53c531676b5c705fd88520be529d4 Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Tue, 12 Dec 2017 16:04:25 +0100 Subject: [PATCH 08/11] Fix linter problem --- test/support/test-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/support/test-client.js b/test/support/test-client.js index c56946cd..c0525c64 100644 --- a/test/support/test-client.js +++ b/test/support/test-client.js @@ -415,7 +415,7 @@ TestClient.prototype.getDataview = function(dataviewName, params, callback) { if (params.hasOwnProperty('no_filters')) { urlParams.no_filters = params.no_filters; } else { - urlParams.own_filter = params.hasOwnProperty('own_filter') ? params.own_filter : 1 + urlParams.own_filter = params.hasOwnProperty('own_filter') ? params.own_filter : 1; } ['bbox', 'bins', 'start', 'end', 'aggregation', 'offset', 'categories'].forEach(function(extraParam) { From 02ac25181e58084937bc46509f640775c8e6e97f Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Wed, 13 Dec 2017 09:45:35 +0100 Subject: [PATCH 09/11] Return error if no_filters and own_filter are present --- lib/cartodb/backends/dataview.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index d398f913..c110f328 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -37,11 +37,19 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param throw new Error("Dataview '" + dataviewName + "' does not exists"); } - var pg = new PSQL(dbParamsFromReqParams(params)); - var ownFilter = +params.own_filter; - var noFilters = !!params.no_filters; - var query = getDaviewQuery(dataviewDefinition, ownFilter, noFilters); + var noFilters = +params.no_filters; + if (Number.isFinite(ownFilter) && Number.isFinite(noFilters)) { + err = new Error(); + err.message = 'Both own_filter and no_filters cannot be sent in the same request'; + err.type = 'dataview'; + err.http_status = 400; + return callback(err); + } + + var pg = new PSQL(dbParamsFromReqParams(params)); + + var query = getDataviewQuery(dataviewDefinition, ownFilter, noFilters); if (params.bbox) { var bboxFilter = new BBoxFilter({column: 'the_geom_webmercator', srid: 3857}, {bbox: params.bbox}); query = bboxFilter.sql(query); @@ -62,7 +70,7 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param ); }; -function getDaviewQuery(dataviewDefinition, ownFilter, noFilters) { +function getDataviewQuery(dataviewDefinition, ownFilter, noFilters) { if (noFilters) { return dataviewDefinition.sql.no_filters; } else if (ownFilter === 1) { From 1664975dd124093489ff30370012b3cf30ad8dc7 Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Wed, 13 Dec 2017 10:43:43 +0100 Subject: [PATCH 10/11] Add spec --- .../analysis/analyses-filters-params.js | 44 +++++++++++++++---- .../analysis/analysis-layers-dataviews.js | 3 +- test/acceptance/dataviews/overviews.js | 9 ++-- test/support/test-client.js | 5 ++- 4 files changed, 46 insertions(+), 15 deletions(-) diff --git a/test/acceptance/analysis/analyses-filters-params.js b/test/acceptance/analysis/analyses-filters-params.js index 52861a3a..c4a17ae4 100644 --- a/test/acceptance/analysis/analyses-filters-params.js +++ b/test/acceptance/analysis/analyses-filters-params.js @@ -78,10 +78,11 @@ describe('analysis-filters-params', () => { it('should get a filtered histogram dataview with all filters', function(done) { const testClient = new TestClient(mapConfig, 1234); + const testParams = Object.assign({}, params, { + own_filter: 1 + }); - params.own_filter = 1; - - testClient.getDataview('pop_max_histogram', params, (err, dataview) => { + testClient.getDataview('pop_max_histogram', testParams, (err, dataview) => { assert.ok(!err, err); assert.equal(dataview.type, 'histogram'); @@ -93,10 +94,11 @@ describe('analysis-filters-params', () => { it('should get a filtered histogram dataview with all filters except my own filter', function(done) { const testClient = new TestClient(mapConfig, 1234); + const testParams = Object.assign({}, params, { + own_filter: 0 + }); - params.own_filter = 0; - - testClient.getDataview('pop_max_histogram', params, (err, dataview) => { + testClient.getDataview('pop_max_histogram', testParams, (err, dataview) => { assert.ok(!err, err); assert.equal(dataview.type, 'histogram'); @@ -108,10 +110,11 @@ describe('analysis-filters-params', () => { it('should get a filtered histogram dataview without filters', function(done) { const testClient = new TestClient(mapConfig, 1234); + const testParams = Object.assign({}, params, { + no_filters: 1 + }); - params.no_filters = 1; - - testClient.getDataview('pop_max_histogram', params, (err, dataview) => { + testClient.getDataview('pop_max_histogram', testParams, (err, dataview) => { assert.ok(!err, err); assert.equal(dataview.type, 'histogram'); @@ -121,4 +124,27 @@ describe('analysis-filters-params', () => { }); }); + it('should return an error if both no_filters and own_filter params are present', function (done) { + const testClient = new TestClient(mapConfig, 1234); + const expectedError = { + errors: ['Both own_filter and no_filters cannot be sent in the same request'], + errors_with_context: [{ + type: 'dataview', + message: 'Both own_filter and no_filters cannot be sent in the same request' + }] + }; + const testParams = Object.assign({}, params, { + no_filters: 1, + own_filter: 0, + response: { + status: 400 + } + }); + + testClient.getDataview('pop_max_histogram', testParams, (err, dataview) => { + assert.deepEqual(dataview, expectedError); + + testClient.drain(done); + }); + }); }); diff --git a/test/acceptance/analysis/analysis-layers-dataviews.js b/test/acceptance/analysis/analysis-layers-dataviews.js index a328ed09..8e95096a 100644 --- a/test/acceptance/analysis/analysis-layers-dataviews.js +++ b/test/acceptance/analysis/analysis-layers-dataviews.js @@ -109,7 +109,8 @@ describe('analysis-layers-dataviews', function() { min: 2e6 } } - } + }, + own_filter: 1 }; testClient.getDataview('pop_max_histogram', params, function(err, dataview) { diff --git a/test/acceptance/dataviews/overviews.js b/test/acceptance/dataviews/overviews.js index dcff687f..552b9ac6 100644 --- a/test/acceptance/dataviews/overviews.js +++ b/test/acceptance/dataviews/overviews.js @@ -393,7 +393,8 @@ describe('dataviews using tables with overviews', function() { var params = { filters: { dataviews: { test_histogram: { min: 2 } } - } + }, + own_filter: 1 }; var testClient = new TestClient(overviewsMapConfig); testClient.getDataview('test_histogram', params, function (err, histogram) { @@ -412,7 +413,8 @@ describe('dataviews using tables with overviews', function() { var params = { filters: { dataviews: { test_histogram: { max: -1 } } - } + }, + own_filter: 1 }; var testClient = new TestClient(overviewsMapConfig); testClient.getDataview('test_histogram', params, function (err, histogram) { @@ -433,7 +435,8 @@ describe('dataviews using tables with overviews', function() { var params = { filters: { dataviews: { test_histogram_date: { max: -1 } } - } + }, + own_filter: 1 }; var testClient = new TestClient(overviewsMapConfig); testClient.getDataview('test_histogram_date', params, function (err, histogram) { diff --git a/test/support/test-client.js b/test/support/test-client.js index c0525c64..be2560b0 100644 --- a/test/support/test-client.js +++ b/test/support/test-client.js @@ -414,8 +414,9 @@ TestClient.prototype.getDataview = function(dataviewName, params, callback) { var urlParams = {}; if (params.hasOwnProperty('no_filters')) { urlParams.no_filters = params.no_filters; - } else { - urlParams.own_filter = params.hasOwnProperty('own_filter') ? params.own_filter : 1; + } + if (params.hasOwnProperty('own_filter')) { + urlParams.own_filter = params.own_filter; } ['bbox', 'bins', 'start', 'end', 'aggregation', 'offset', 'categories'].forEach(function(extraParam) { From 4b0a4dd675c9530935eca3c36c6a30be5f3d4f8c Mon Sep 17 00:00:00 2001 From: Ivan Malagon Date: Thu, 14 Dec 2017 17:44:46 +0100 Subject: [PATCH 11/11] Update NEWS.md --- NEWS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 7ed40872..30f61882 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,8 @@ Released 2017-mm-dd Announcements: - - Logging all errors + - Logging all errors. + - Histograms: Now they accept a `no_filters` parameter. ## 4.4.0 Released 2017-12-12