You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/04/12 14:09:52 UTC

[GitHub] [zeppelin] cuspymd commented on a change in pull request #4092: [ZEPPELIN-4506] Check for duplicate note on rename of a notebook

cuspymd commented on a change in pull request #4092:
URL: https://github.com/apache/zeppelin/pull/4092#discussion_r611663144



##########
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:
       Couldn't other errors occur while `renameNote()` is in progress?




-- 
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:
users@infra.apache.org