From a4683209f4f0e75b6412fe935ac82e0e29670094 Mon Sep 17 00:00:00 2001 From: raitis Date: Thu, 14 Mar 2019 16:10:15 +0200 Subject: [PATCH] Don't always load keyword list for dataset filter fixes #167 --- .../datasource_selector.js | 19 +++++++++--------- .../panelContents/datasourceBrowser.js | 20 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/components/datasource_selector/datasource_selector.js b/components/datasource_selector/datasource_selector.js index 8164fba532..8cb02e466f 100755 --- a/components/datasource_selector/datasource_selector.js +++ b/components/datasource_selector/datasource_selector.js @@ -624,15 +624,16 @@ define(['angular', 'ol', 'map'], $scope.id_selected = id_selected; } - $http({ - method: 'GET', - url: utils.proxify('http://opentransportnet.eu:8082/api/3/action/vocabulary_show?id=36c07014-c461-4f19-b4dc-a38106144e66') - }).then(function successCallback(response) { - $scope.otn_keywords = [{ title: '-' }]; - angular.forEach(response.data.result.tags, function (tag) { - $scope.otn_keywords.push({ title: tag.name }); - }) - }); + if(config.datasources && config.datasources.length > 0) + $http({ + method: 'GET', + url: utils.proxify('http://opentransportnet.eu:8082/api/3/action/vocabulary_show?id=36c07014-c461-4f19-b4dc-a38106144e66') + }).then(function successCallback(response) { + $scope.otn_keywords = [{ title: '-' }]; + angular.forEach(response.data.result.tags, function (tag) { + $scope.otn_keywords.push({ title: tag.name }); + }) + }); /** * @function openMickaAdvancedSearch diff --git a/materialComponents/panelContents/datasourceBrowser.js b/materialComponents/panelContents/datasourceBrowser.js index e7e7589274..0de3997b83 100644 --- a/materialComponents/panelContents/datasourceBrowser.js +++ b/materialComponents/panelContents/datasourceBrowser.js @@ -32,16 +32,16 @@ define(['angular', 'ol', 'angular-material'], } } ); - - $http({ - method: 'GET', - url: utils.proxify('http://opentransportnet.eu:8082/api/3/action/vocabulary_show?id=36c07014-c461-4f19-b4dc-a38106144e66') - }).then(function successCallback(response) { - $scope.otn_keywords = [{ title: '-' }]; - angular.forEach(response.data.result.tags, function (tag) { - $scope.otn_keywords.push({ title: tag.name }); - }) - }); + if(config.datasources && config.datasources.length > 0) + $http({ + method: 'GET', + url: utils.proxify('http://opentransportnet.eu:8082/api/3/action/vocabulary_show?id=36c07014-c461-4f19-b4dc-a38106144e66') + }).then(function successCallback(response) { + $scope.otn_keywords = [{ title: '-' }]; + angular.forEach(response.data.result.tags, function (tag) { + $scope.otn_keywords.push({ title: tag.name }); + }) + }); $scope.changeDS = function(dataset){ $scope.selectedDS = dataset;