Skip to content

Commit

Permalink
Show indication when query has unsaved changes (FED #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirnissim committed Dec 30, 2013
1 parent db20eeb commit 7e94cc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion rd_ui/app/scripts/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
}
delete $scope.query.latest_query_data;
$scope.query.$save(function (q) {
$scope.pristineQuery = q.query;

if (duplicate) {
growl.addInfoMessage("Query duplicated.", {ttl: 2000});
} else{
Expand Down Expand Up @@ -144,7 +146,8 @@
});

if ($routeParams.queryId != undefined) {
$scope.query = Query.get({id: $routeParams.queryId}, function() {
$scope.query = Query.get({id: $routeParams.queryId}, function(q) {
$scope.pristineQuery = q.query;
$scope.queryResult = $scope.query.getQueryResult();
});
} else {
Expand Down
4 changes: 3 additions & 1 deletion rd_ui/app/views/queryfiddle.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ <h3 class="panel-title">

<div class="btn-group pull-right">
<button type="button" class="btn btn-default" ng-click="duplicateQuery()">Duplicate</button>
<button type="button" class="btn btn-default" ng-disabled="currentUser.name != query.user" ng-click="saveQuery()">Save</button>
<button type="button" class="btn btn-default" ng-disabled="currentUser.name != query.user" ng-click="saveQuery()">Save
<span ng-show="query.query != pristineQuery">&#42;</span>
</button>
<button type="button" class="btn btn-primary" ng-disabled="queryExecuting" ng-click="executeQuery()">Execute</button>
</div>
</div>
Expand Down

0 comments on commit 7e94cc7

Please sign in to comment.