Repository: zeppelin Updated Branches: refs/heads/master 425abe302 -> 8daf32563
[ZEPPELIN-1963] set cron job executor to current user by default ### What is this PR for? currently when executing cron job, backend doesn't know who initiated cron job (with subsequent save) unless user puts his name. This PR adds user name by default by keeping compatibility with current workflow. ### What type of PR is it? Improvement ### Todos * [x] - add user on front ### What is the Jira issue? [ZEPPELIN-1963](https://issues.apache.org/jira/browse/ZEPPELIN-1963) ### How should this be tested? go and set cron job ### Screenshots (if appropriate)  ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: Khalid Huseynov <khalid...@gmail.com> Closes #1898 from khalidhuseynov/cron-user and squashes the following commits: 30dc440 [Khalid Huseynov] add logged cron executing user Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/8daf3256 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/8daf3256 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/8daf3256 Branch: refs/heads/master Commit: 8daf32563960b16db739e30c8dcd91d60f854917 Parents: 425abe3 Author: Khalid Huseynov <khalid...@gmail.com> Authored: Thu Jan 12 21:32:02 2017 -0800 Committer: Mina Lee <mina...@apache.org> Committed: Tue Jan 17 14:59:59 2017 +0900 ---------------------------------------------------------------------- zeppelin-web/src/app/notebook/notebook.controller.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/8daf3256/zeppelin-web/src/app/notebook/notebook.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js index 248ef8a..ccf64b7 100644 --- a/zeppelin-web/src/app/notebook/notebook.controller.js +++ b/zeppelin-web/src/app/notebook/notebook.controller.js @@ -401,6 +401,13 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope, /** Set cron expression for this note **/ $scope.setCronScheduler = function(cronExpr) { + if (cronExpr) { + if (!$scope.note.config.cronExecutingUser) { + $scope.note.config.cronExecutingUser = $rootScope.ticket.principal; + } + } else { + $scope.note.config.cronExecutingUser = ''; + } $scope.note.config.cron = cronExpr; $scope.setConfig(); }; @@ -1011,4 +1018,3 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope, angular.element(document.getElementById('content')).css('padding-top', actionbarHeight - 20); }); } -