dannycranmer commented on a change in pull request #4092: URL: https://github.com/apache/zeppelin/pull/4092#discussion_r611713414
########## File path: zeppelin-web/src/app/notebook/notebook.controller.js ########## @@ -539,11 +539,23 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope, $scope.updateNoteName = function(newName) { const trimmedNewName = newName.trim(); if (trimmedNewName.length > 0 && $scope.note.name !== trimmedNewName) { + $scope.note.oldName = $scope.note.name; $scope.note.name = trimmedNewName; websocketMsgSrv.renameNote($scope.note.id, $scope.note.name, true); } }; + $scope.$on('setNoteMenu', function(event, notes) { + $scope.note.oldName = undefined; + }); + + $scope.$on('errorInfo', function(event, notes) { + if ($scope.note.oldName !== undefined) { + $scope.note.name = $scope.note.oldName; + $scope.note.oldName = undefined; + } + }); Review comment: Yes, I can think of 2 alternatives: - Return a specific error response for the rename action - Push a `NOTES_INFO` update in the error case to update the UI What are you thoughts on the 2 approaches? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org