You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by ku...@apache.org on 2017/09/11 02:18:12 UTC

zeppelin git commit: [ZEPPELIN-2919] fix: Fallback to table when vis is not available

Repository: zeppelin
Updated Branches:
  refs/heads/master f46244d32 -> 38ee0c4ba


[ZEPPELIN-2919] fix: Fallback to table when vis is not available

### What is this PR for?

fallback to table when vis is not available.

The erroneous situation can happen when

- user enabled helium visualization
- and open the visualization in paragraph
- and disabled the helium visualization
- and open again the paragraph.
- then you will see the empty paragraph because the specific visualization is now not available

### What type of PR is it?
[Bug Fix]

### What is the Jira issue?

[ZEPPELIN-2919](https://issues.apache.org/jira/browse/ZEPPELIN-2919)

### How should this be tested?

- user enabled helium visualization
- and open the visualization in paragraph
- and disabled the helium visualization
- and open again the paragraph with **refresh**

### Screenshots (if appropriate)

#### Before

![2919_before](https://user-images.githubusercontent.com/4968473/30196276-66a182da-949a-11e7-8208-6bb4e4643833.gif)

#### After

![2919_after](https://user-images.githubusercontent.com/4968473/30196278-68cced10-949a-11e7-8527-1c233f5fbbc1.gif)

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

Author: 1ambda <1a...@gmail.com>

Closes #2572 from 1ambda/ZEPPELIN-2919/fallback-to-table-when-vis-is-not-available and squashes the following commits:

e9ca08d3d [1ambda] fix: Fallback to table when helium is not avaiable


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

Branch: refs/heads/master
Commit: 38ee0c4ba4581c63c1bdeb53ac3c8d001b8e7dfd
Parents: f46244d
Author: 1ambda <1a...@gmail.com>
Authored: Fri Sep 8 13:19:35 2017 +0900
Committer: 1ambda <1a...@gmail.com>
Committed: Mon Sep 11 11:18:07 2017 +0900

----------------------------------------------------------------------
 .../src/app/notebook/paragraph/result/result.controller.js  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/38ee0c4b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
index 5c26c51..646d09d 100644
--- a/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
@@ -529,8 +529,13 @@ function ResultCtrl ($scope, $rootScope, $route, $window, $routeParams, $locatio
 
     if (!graphMode) { graphMode = 'table' }
 
-    const builtInViz = builtInVisualizations[graphMode]
-    if (!builtInViz) { return }
+    let builtInViz = builtInVisualizations[graphMode]
+    if (!builtInViz) {
+      /** helium package is not available, fallback to table vis */
+      graphMode = 'table'
+      $scope.graphMode = graphMode /** html depends on this scope value */
+      builtInViz = builtInVisualizations[graphMode]
+    }
 
     // deactive previsouly active visualization
     for (let t in builtInVisualizations) {