From cfdc55c675822b68da1ffbf0c75ebbaff22e35e0 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Thu, 28 Jul 2016 15:26:00 +0300 Subject: [PATCH 1/2] Fix: updated result not being saved when changing query text. --- rd_ui/app/scripts/controllers/query_view.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rd_ui/app/scripts/controllers/query_view.js b/rd_ui/app/scripts/controllers/query_view.js index bc137a9970..ab973128c8 100644 --- a/rd_ui/app/scripts/controllers/query_view.js +++ b/rd_ui/app/scripts/controllers/query_view.js @@ -130,9 +130,7 @@ data.id = $scope.query.id; } else { data = _.pick($scope.query, ["schedule", "query", "id", "description", "name", "data_source_id", "options"]); - if ($scope.query.isNew()) { - data['latest_query_data_id'] = $scope.query.latest_query_data_id; - } + data['latest_query_data_id'] = $scope.query.latest_query_data_id; } options = _.extend({}, { From 7270518d6d61f4db48e1fd42282c7254786a4f4a Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Thu, 28 Jul 2016 15:30:05 +0300 Subject: [PATCH 2/2] Simplify the code. --- rd_ui/app/scripts/controllers/query_view.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rd_ui/app/scripts/controllers/query_view.js b/rd_ui/app/scripts/controllers/query_view.js index ab973128c8..75bce42f9e 100644 --- a/rd_ui/app/scripts/controllers/query_view.js +++ b/rd_ui/app/scripts/controllers/query_view.js @@ -129,8 +129,7 @@ } data.id = $scope.query.id; } else { - data = _.pick($scope.query, ["schedule", "query", "id", "description", "name", "data_source_id", "options"]); - data['latest_query_data_id'] = $scope.query.latest_query_data_id; + data = _.pick($scope.query, ["schedule", "query", "id", "description", "name", "data_source_id", "options", "latest_query_data_id"]); } options = _.extend({}, {