You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2017/03/18 20:29:10 UTC

zeppelin git commit: [ZEPPELIN-2266] Parse helium description as HTML

Repository: zeppelin
Updated Branches:
  refs/heads/master 37b6b02d1 -> 7f6dc8624


[ZEPPELIN-2266] Parse helium description as HTML

### What is this PR for?

Parse helium description as HTML for detailed, beautiful explanation

```
  "description": "The Ultimate Line Chart for Apache Zeppelin using <a href src=\"https://www.amcharts.com\">amcharts</a>",
```

- we can use icon, image, emoji, svg, and so on :)

I attached screenshots for comparison.

### What type of PR is it?
[Improvement]

### Todos

NONE

### What is the Jira issue?

[ZEPPELIN-2266]()

### How should this be tested?

1. Create new file `ultimate-line-chart.json` in `$ZEPPELIN_HOME/helium`
2. Fill the file with

```
{
  "type" : "VISUALIZATION",
  "name": "ultimate-line-chart",
  "description": "The Ultimate Line Chart for Apache Zeppelin using <a href src=\"https://www.amcharts.com\">amcharts</a>",
  "artifact" : "/Users/1ambda/github/1ambda/zeppelin-ultimate-line-chart",
  "icon": "<img width=\"21\" height=\"21\" class=\"icon icons8-Line-Chart\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGyklEQVRoQ+2Yf0xVdRTAz/l+73sgqEBD1Er80abRKoGnmy7TZ2urRPRlv1yJPhP6w2zhQhLsx3POX+CGbdUqaDxFWzVNCLBaW5BpmmJDp5GbJbZpFC6hpw+4797vad+Lz15Fj3sfNKTxHf9w3/ec7/mcc+4553sR/icL/yccMARyo0VyKCJDEfmbB5aU5bsQYBkQNHNFXe9dvr0tEicNaGpJCAXZB5PH3Wq/1N7eedn3+/nyp7fePuhAskrX1KeMHz9n2uQUULUAfFj/BagUmP1+TslXVmEGNCJLy/K9iXFxWfelOVjL5d/gwIlGACD51wgIXk3Al+89Uywf9roGFCSrNG8358piIQSTlkbZbM9e7VK/Vhi4CdCJAFMBoJkIKhFE/c6cbVVPvrMm1c7ZbiJI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FNZ6oodF502f5jCuBceOHYcOv/8iIn5OiPU6QONfIuSpixeq30MgAdErIYz3JZJ4LHr50z2arhuNjnNlz74NDzwWiR4pk1FQ84qNs/UOh8NQcbzh24Au6PGggWb1WgbJLKx1c2TvOKal2/pysJRdUFgrr8vbOWPndSHGy2cK53s/2vCg5QnAMkh3KgzLnz4tfVh3KjTo/qsdb9VszVxl1nuyD+hd/nIEmEsIudWbMrx9TVXLIJkFNXmMseLExEQBAOJSaysjAha8VNVsyQx7S5QVSiHYR0DtOqI7NP/NOqKnfZZAgqmgE73KASZJhRridiZEPCLzIMIcou5bYhAo1NNBeSDawaJic2U
 j64vxobKmQTILa8uR4OFgKvRkwPy11c5QIIUzpguabVQVxi+SrseGk+8LVK8gRj6r/hIJoSE4zaSCAQTsLa6wKQ5HumFfQ8O3FNDFC/u3ZJT0xeB/kw0LIiGE6q8jgAQdwGUGInjQP4pCw/GrHf6Ol6o3zzf12cgq7L+CXJtr9hER8qhYp9V8Njo2E98lJiVxadSlX3/VUbA7+tpATUVEVhS7PaZZjsgKUB0RnuBRMS6rEMHDuisUGd+vZFGwEtGIIiJTiLTOIyTEFKmAIXYIIT78ePP8fv/+ZNVAs/uN1FpQUOMdPnLE4rvuvDOqra0dmpqagNljEiKNhNnD+3OfAZJZUFt/y603z7lt0kTQNB0OHz4CGkDaf5kK/QlhlPdukP0uxuCDsWPH2H2+K51Xrlz5qWrjPCPNBsu6XrUkDCC5EaCZ2WM8gymtrkdksHg9nJ29dvbBAjkEcqNFaigiN1pE/gBhOClg98yr4QAAAABJRU5ErkJggg==\" >",
  "license": "amcharts (https://www.amcharts.com/licenses/javascript-charts-free-license/)"
}
```

### Screenshots (if appropriate)

#### Before

<img width="664" alt="before" src="https://cloud.githubusercontent.com/assets/4968473/23982648/110d1820-0a52-11e7-9268-147012320552.png">

#### After

<img width="828" alt="after" src="https://cloud.githubusercontent.com/assets/4968473/23982649/141ef98e-0a52-11e7-9932-87f18faa8153.png">

### 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 #2143 from 1ambda/ZEPPELIN-2266/helium-description-as-html and squashes the following commits:

c870898 [1ambda] fix: Restore newline
727c38d [1ambda] feat: Helium description as HTML


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

Branch: refs/heads/master
Commit: 7f6dc862449e4ae770f850fd3b6fee88180d923f
Parents: 37b6b02
Author: 1ambda <1a...@gmail.com>
Authored: Thu Mar 16 16:00:53 2017 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Sat Mar 18 13:29:08 2017 -0700

----------------------------------------------------------------------
 zeppelin-web/src/app/helium/helium.controller.js | 4 ++++
 zeppelin-web/src/app/helium/helium.html          | 4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7f6dc862/zeppelin-web/src/app/helium/helium.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/helium/helium.controller.js b/zeppelin-web/src/app/helium/helium.controller.js
index 3819133..1130075 100644
--- a/zeppelin-web/src/app/helium/helium.controller.js
+++ b/zeppelin-web/src/app/helium/helium.controller.js
@@ -309,5 +309,9 @@ export default function HeliumCtrl($scope, $rootScope, $sce,
     });
   };
 
+  $scope.getDescriptionText = function(pkgSearchResult) {
+    return $sce.trustAsHtml(pkgSearchResult.pkg.description);
+  };
+
   init();
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7f6dc862/zeppelin-web/src/app/helium/helium.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/helium/helium.html b/zeppelin-web/src/app/helium/helium.html
index 923a6e4..2310a92 100644
--- a/zeppelin-web/src/app/helium/helium.html
+++ b/zeppelin-web/src/app/helium/helium.html
@@ -135,9 +135,7 @@ limitations under the License.
           </a>
         </li>
       </ul>
-      <div class="heliumPackageDescription">
-        {{pkgSearchResult.pkg.description}}
-      </div>
+      <div class="heliumPackageDescription" ng-bind-html="getDescriptionText(pkgSearchResult)" />
       <div ng-if="pkgSearchResult.pkg.type === 'SPELL' && pkgSearchResult.pkg.spell"
            class="spellInfo">
         <div>