You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by co...@apache.org on 2016/08/23 01:55:21 UTC

zeppelin git commit: ZEPPELIN-1324: Make paragraph code selectable when running

Repository: zeppelin
Updated Branches:
  refs/heads/master 377dc4edf -> d028b3820


ZEPPELIN-1324: Make paragraph code selectable when running

### What is this PR for?
Make paragraph code selectable when running(*PENDING* or *RUNNING* state)

### What type of PR is it?
 Improvement

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1324

### How should this be tested?
Try to select, copy, paste the paragraph code, when paragraph is running

### Questions:
* Does the licenses files need update? NA
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: karuppayya <ka...@gmail.com>
Author: Karup <ka...@outlook.com>

Closes #1328 from karup1990/ZEPPELIN-1324_1 and squashes the following commits:

ec0b090 [karuppayya] Fix js error
15fd7d1 [karuppayya] Address review comments
8d055c9 [Karup] Make paragraph code selectable when it is running


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

Branch: refs/heads/master
Commit: d028b3820f29d2c91ee5ab1b46100a87554df02b
Parents: 377dc4e
Author: karuppayya <ka...@gmail.com>
Authored: Sat Aug 20 10:32:13 2016 +0530
Committer: Damien CORNEAU <co...@gmail.com>
Committed: Tue Aug 23 10:55:09 2016 +0900

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


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d028b382/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index c2bc8e6..aa9686e 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -555,6 +555,7 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
       $scope.editor.setHighlightGutterLine(false);
       $scope.editor.getSession().setUseWrapMode(true);
       $scope.editor.setTheme('ace/theme/chrome');
+      $scope.editor.setReadOnly($scope.isRunning());
       if ($scope.paragraphFocused) {
         $scope.editor.focus();
         $scope.goToEnd();
@@ -2519,6 +2520,7 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
       $scope.paragraph.status = data.paragraph.status;
       $scope.paragraph.result = data.paragraph.result;
       $scope.paragraph.settings = data.paragraph.settings;
+      $scope.editor.setReadOnly($scope.isRunning());
 
       if (!$scope.asIframe) {
         $scope.paragraph.config = data.paragraph.config;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d028b382/zeppelin-web/src/app/notebook/paragraph/paragraph.css
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.css b/zeppelin-web/src/app/notebook/paragraph/paragraph.css
index cb42389..e8edc0b 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.css
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.css
@@ -275,6 +275,10 @@ table.dataTable.table-condensed .sorting_desc:after {
   background: none !important;
 }
 
+.paragraph-disable {
+  opacity : 0.6!important;
+}
+
 .ace_marker-layer .ace_selection {
     z-index: 0 !important;
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d028b382/zeppelin-web/src/app/notebook/paragraph/paragraph.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.html b/zeppelin-web/src/app/notebook/paragraph/paragraph.html
index d54df03..de102e8 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.html
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.html
@@ -38,16 +38,14 @@ limitations under the License.
   <div>
     <div ng-show="!paragraph.config.editorHide && !viewOnly" style="margin-bottom:3px;">
       <div id="{{paragraph.id}}_editor"
-           style="opacity: 1;"
            class="editor"
            ui-ace="{
                      onLoad : aceLoaded,
                      require : ['ace/ext/language_tools']
                    }"
            ng-model="paragraph.text"
-           ng-class="{'disable': paragraph.status == 'RUNNING' || paragraph.status == 'PENDING',
-             'paragraph-text--dirty' : dirtyText !== originalText && dirtyText !== undefined}">
-      </div>
+           ng-class="{'paragraph-disable': paragraph.status == 'RUNNING' || paragraph.status == 'PENDING',
+           'paragraph-text--dirty' : dirtyText !== originalText && dirtyText !== undefined}">      </div>
     </div>
 
     <div ng-include src="'app/notebook/paragraph/paragraph-progressBar.html'"></div>