This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new de3a88e [ZEPPELIN-5619] Fix 'import ipynb/json notebook' button bug de3a88e is described below commit de3a88ee1732ece6ca167f3399f759c43c7cb76d Author: Heekang Koo <lovef...@gmail.com> AuthorDate: Wed Dec 22 02:02:09 2021 +0900 [ZEPPELIN-5619] Fix 'import ipynb/json notebook' button bug ### What is this PR for? Fixed 'import note - select json/ipynb file' button bug This is my first contribution to open source, so if there is any problem please let me know ### What type of PR is it? Bug Fix ### Todos No ### What is the Jira issue? [[ZEPPELIN-5619]](https://issues.apache.org/jira/browse/ZEPPELIN-5619) ### How should this be tested? 1. Import some local ipynb file(notebook1.ipynb) via ‘Import New Note’ 2. Import another ipynb file(notebook2.ipynb) with the same note name(notebook1). This will make some error message because there exists a zeppelin notebook with the same name(notebook1) in the path 3. Again, import the same ipynb file(notebook2.ipynb) used at step2 without changing note name. Importing notebook process is successfully triggered. ### 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: Heekang Koo <lovef...@gmail.com> Closes #4278 from lovtens/notebook-import-fix and squashes the following commits: 32d62c90ae [Heekang Koo] Fix import ipynb/json notebook button --- zeppelin-web/src/components/note-import/note-import.controller.js | 4 ++++ zeppelin-web/src/components/note-import/note-import.html | 1 + 2 files changed, 5 insertions(+) diff --git a/zeppelin-web/src/components/note-import/note-import.controller.js b/zeppelin-web/src/components/note-import/note-import.controller.js index 45d8279..61e21c8 100644 --- a/zeppelin-web/src/components/note-import/note-import.controller.js +++ b/zeppelin-web/src/components/note-import/note-import.controller.js @@ -43,6 +43,10 @@ function NoteImportCtrl($scope, $timeout, websocketMsgSrv) { angular.element('#noteImportFile').click(); }; + $scope.resetFile = function(element) { + element.value = ''; + }; + $scope.importFile = function(element) { $scope.note.errorText = ''; $scope.note.importFile = element.files[0]; diff --git a/zeppelin-web/src/components/note-import/note-import.html b/zeppelin-web/src/components/note-import/note-import.html index f52ce66..726f449 100644 --- a/zeppelin-web/src/components/note-import/note-import.html +++ b/zeppelin-web/src/components/note-import/note-import.html @@ -47,6 +47,7 @@ limitations under the License. <div style="display: none"> <input class="form-control note-name-input" id="noteImportFile" placeholder="Note name" type="file" + onclick="angular.element(this).scope().resetFile(this)" ng-model="note.importFile" onchange="angular.element(this).scope().importFile(this)" /> </div> </div>