You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by rk...@apache.org on 2018/06/01 12:45:20 UTC

zeppelin git commit: ZEPPELIN-3502 Make notebook dynamic forms title editable

Repository: zeppelin
Updated Branches:
  refs/heads/master b6beda64e -> 663918cd4


ZEPPELIN-3502 Make notebook dynamic forms title editable

Make notebook dynamic forms title editable

Improvement

https://issues.apache.org/jira/browse/ZEPPELIN-3502

Click to edit the title

**Before**
<img width="450" alt="screen shot 2018-05-25 at 4 03 20 pm" src="https://user-images.githubusercontent.com/2031306/40540333-5e4c77b8-6035-11e8-9079-bf7cee3dafaf.png">

**After**
<img width="437" alt="screen shot 2018-05-25 at 4 03 37 pm" src="https://user-images.githubusercontent.com/2031306/40540332-5e23f8b0-6035-11e8-85b6-94ae98bad9f6.png">
<img width="423" alt="screen shot 2018-05-25 at 4 03 43 pm" src="https://user-images.githubusercontent.com/2031306/40540331-5df9f1b4-6035-11e8-8b8b-3351f9cbc864.png">

* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Renjith Kamath <rk...@apache.org>

Closes #2987 from r-kamath/ZEPPELIN-3502 and squashes the following commits:

cf6f1b2c1 [Renjith Kamath] ZEPPELIN-3502 Make notebook dynamic forms title editable

Change-Id: I9b7e78c8a05d852feba5cc7eaeb61f6ac99a3915


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/663918cd
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/663918cd
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/663918cd

Branch: refs/heads/master
Commit: 663918cd4ab852111b9ce99e522103c8674b84ae
Parents: b6beda6
Author: Renjith Kamath <rk...@apache.org>
Authored: Fri May 25 16:01:51 2018 +0530
Committer: Renjith Kamath <rk...@apache.org>
Committed: Fri Jun 1 18:15:11 2018 +0530

----------------------------------------------------------------------
 .../src/app/notebook/notebook.controller.js     |  6 ++++++
 zeppelin-web/src/app/notebook/notebook.css      |  4 ++++
 zeppelin-web/src/app/notebook/notebook.html     | 21 +++++++++++++++++---
 3 files changed, 28 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/663918cd/zeppelin-web/src/app/notebook/notebook.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js
index 448df6e..6082a44 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -36,6 +36,7 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
   $scope.showSetting = false;
   $scope.showRevisionsComparator = false;
   $scope.looknfeelOption = ['default', 'simple', 'report'];
+  $scope.noteFormTitle = null;
   $scope.cronOption = [
     {name: 'None', value: undefined},
     {name: '1m', value: '0 0/1 * * * ?'},
@@ -441,6 +442,11 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
     }
   };
 
+  $scope.setNoteFormTitle = function(noteFormTitle) {
+    $scope.note.config.noteFormTitle = noteFormTitle;
+    $scope.setConfig();
+  };
+
   /** Set cron expression for this note **/
   $scope.setCronScheduler = function(cronExpr) {
     if (cronExpr) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/663918cd/zeppelin-web/src/app/notebook/notebook.css
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.css b/zeppelin-web/src/app/notebook/notebook.css
index fe5da5c..47a7b86 100644
--- a/zeppelin-web/src/app/notebook/notebook.css
+++ b/zeppelin-web/src/app/notebook/notebook.css
@@ -469,3 +469,7 @@
     position: relative;
     top: -16px;
 }
+
+.notebook-form-title {
+  padding: 3px;
+}

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/663918cd/zeppelin-web/src/app/notebook/notebook.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.html b/zeppelin-web/src/app/notebook/notebook.html
index f004e9b..179192b 100644
--- a/zeppelin-web/src/app/notebook/notebook.html
+++ b/zeppelin-web/src/app/notebook/notebook.html
@@ -120,9 +120,24 @@ limitations under the License.
 
   <div class="note-jump"></div>
   <div id="noteForms" ng-if="isShowNoteForms()" class="paragraph-space box">
-    <div>
-      <h4>Note forms</h4>
-    </div>
+      <h4>
+        <div ng-controller="ElasticInputCtrl as input" class="title" style="min-height: 25px;">
+          <input type="text"
+                 pu-elastic-input
+                 style="min-width: 400px; max-width: 80%;"
+                 placeholder="Untitled form"
+                 ng-model="note.config.noteFormTitle"
+                 ng-if="input.showEditor"
+                 ng-escape="input.showEditor = false; note.config.noteFormTitle = oldTitle;"
+                 ng-blur="setNoteFormTitle(note.config.noteFormTitle); input.showEditor = false"
+                 ng-enter="setNoteFormTitle(note.config.noteFormTitle); input.showEditor = false"
+                 focus-if="input.showEditor" />
+          <div ng-show="!input.showEditor" class="notebook-form-title"
+               ng-bind-html="note.config.noteFormTitle || 'Untitled form'"
+               ng-click="input.showEditor = true; oldTitle = note.config.noteFormTitle;">
+          </div>
+        </div>
+      </h4>
     <hr />
     <div>
       <dynamic-forms