From 2f3394e43024ed4ebcaf4cc43922820e0a3b4649 Mon Sep 17 00:00:00 2001 From: Mr-Yellow Date: Thu, 23 Jan 2020 12:10:31 +1100 Subject: [PATCH 1/4] Included an example of array --- demo/app.js | 1 + demo/index.html | 2 ++ 2 files changed, 3 insertions(+) diff --git a/demo/app.js b/demo/app.js index 4296a47..fc70e7c 100644 --- a/demo/app.js +++ b/demo/app.js @@ -36,6 +36,7 @@ app.controller('queryBuilderExampleCtrl', function($http, $scope) { role: {type: 'string', enum: ['user', 'admin', 'root']}, status: {type: 'string', enum: ['pending', 'active', 'deleted']}, lastLogin: {type: 'date'}, + tags: [{type: 'mixed'}], }; $scope.query = { diff --git a/demo/index.html b/demo/index.html index fc508ed..906a29a 100644 --- a/demo/index.html +++ b/demo/index.html @@ -90,6 +90,7 @@

Warning - GitHub data unsupported

Website Company Role + Tags @@ -122,6 +123,7 @@

Warning - GitHub data unsupported

{{row.website}} {{row.company.name}} {{row.role}} + {{row.tags}} From d8e99faca9ea998d5b9235792e294464d709874c Mon Sep 17 00:00:00 2001 From: Mr-Yellow Date: Thu, 23 Jan 2020 12:26:35 +1100 Subject: [PATCH 2/4] Holding back refresh to sync with QB change --- demo/app.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/demo/app.js b/demo/app.js index fc70e7c..a106aac 100644 --- a/demo/app.js +++ b/demo/app.js @@ -19,7 +19,7 @@ app.config(qbTableSettingsProvider => { }); -app.controller('queryBuilderExampleCtrl', function($http, $scope) { +app.controller('queryBuilderExampleCtrl', function($http, $scope, $timeout) { $scope.spec = { _id: {type: 'objectId'}, name: {type: 'string'}, @@ -52,12 +52,14 @@ app.controller('queryBuilderExampleCtrl', function($http, $scope) { $scope.data; $scope.count; $scope.refresh = ()=> { - console.log('REFRESH', $scope.query); - $http.get('api/data', {params: $scope.query}) - .then(res => $scope.data = res.data); + $timeout(()=> { + console.log('REFRESH', JSON.stringify($scope.query)); + $http.get('api/data', {params: $scope.query}) + .then(res => $scope.data = res.data); - $http.get('api/count', {params: $scope.query}) - .then(res => $scope.count = res.data.count); + $http.get('api/count', {params: $scope.query}) + .then(res => $scope.count = res.data.count); + }); } $scope.$on('queryBuilder.change', $scope.refresh); From 70bc67a2718d914e131c2af2ace7da21e98f14f4 Mon Sep 17 00:00:00 2001 From: Mr-Yellow Date: Thu, 23 Jan 2020 12:30:29 +1100 Subject: [PATCH 3/4] Included tags in demo query --- demo/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/app.js b/demo/app.js index a106aac..2d42e35 100644 --- a/demo/app.js +++ b/demo/app.js @@ -45,6 +45,7 @@ app.controller('queryBuilderExampleCtrl', function($http, $scope, $timeout) { status: {$nin: ['deleted']}, sort: 'username', limit: 10, + tags: 'foo', }; From 46d47c95d63739012712494b278eec57e22a34a1 Mon Sep 17 00:00:00 2001 From: Mr-Yellow Date: Thu, 23 Jan 2020 12:35:33 +1100 Subject: [PATCH 4/4] Included tags in demo data --- demo/testData.js | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/testData.js b/demo/testData.js index dba5406..04f9d38 100644 --- a/demo/testData.js +++ b/demo/testData.js @@ -33,4 +33,5 @@ module.exports = [...Array(100)].map((i, offset) => ({ lastLogin: Math.random() > 0.5 ? faker.date.past() : faker.date.recent(), + tags: ['foo', 'bar'], }));