You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by fe...@apache.org on 2019/02/27 05:24:07 UTC
[zeppelin] branch master updated: [ZEPPELIN-4011] Fix note path
This is an automated email from the ASF dual-hosted git repository.
felixcheung 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 6dcc2ab [ZEPPELIN-4011] Fix note path
6dcc2ab is described below
commit 6dcc2ab49c1f3d0c9ad4c8d68b005e37690faa7a
Author: Egor Klimov <kl...@yandex.ru>
AuthorDate: Wed Feb 27 08:24:01 2019 +0300
[ZEPPELIN-4011] Fix note path
### What is this PR for?
Now note may move to the root directory after enabling cron in it. It caused by `Note#setName`
* Bug:
![notepath](https://user-images.githubusercontent.com/6136993/52917693-87542a00-32ff-11e9-9fb1-82d21c0942f8.gif)
* Fix:
![notepath_fix](https://user-images.githubusercontent.com/6136993/52917704-abb00680-32ff-11e9-8f50-0e8908e4edc0.gif)
### What type of PR is it?
Bug Fix
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-4011
### How should this be tested?
* CI pass
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
---
zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
index 403db06..2632e7d 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
@@ -232,7 +232,7 @@ public class Note implements JsonSerializable {
this.path = "/" + name;
}
} else {
- int pos = this.path.indexOf("/");
+ int pos = this.path.lastIndexOf("/");
this.path = this.path.substring(0, pos + 1) + this.name;
}
}