This is an automated email from the ASF dual-hosted git repository.
zjffdu pushed a commit to branch branch-0.10
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/branch-0.10 by this push:
new 5e75c0b [ZEPPELIN-5619] Fix 'import ipynb/json notebook' button bug
5e75c0b is described below
commit 5e75c0b160d43dc5b6effd3ad8d29d30e50c76a8
Author: Heekang Koo <[email protected]>
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 <[email protected]>
Closes #4278 from lovtens/notebook-import-fix and squashes the following
commits:
32d62c90ae [Heekang Koo] Fix import ipynb/json notebook button
(cherry picked from commit de3a88ee1732ece6ca167f3399f759c43c7cb76d)
Signed-off-by: Jeff Zhang <[email protected]>
---
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>