You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2019/09/10 01:29:15 UTC

[zeppelin] branch master updated: [ZEPPELIN-4298] Fix broken link on credentials page

This is an automated email from the ASF dual-hosted git repository.

zjffdu 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 6450a00  [ZEPPELIN-4298] Fix broken link on credentials page
6450a00 is described below

commit 6450a00b0e5f6a1eb9bcf982b355ee421d06135f
Author: Jay Jin <ja...@gmail.com>
AuthorDate: Tue Sep 3 00:05:43 2019 +0900

    [ZEPPELIN-4298] Fix broken link on credentials page
    
    ### What is this PR for?
    Fix broken link on credentials page
    
    Problem: The doc url changed for the `datasource_authorization.html` changed over the version 0.7
    
    (Under version 0.7)
    https://zeppelin.apache.org/docs/`0.7.3/`security/datasource_authorization.html
    
    (Over version 0.7)
    https://zeppelin.apache.org/docs/`0.8.1/setup/`security/datasource_authorization.html
    https://zeppelin.apache.org/docs/`0.9.0-SNAPSHOT/setup/`security/datasource_authorization.html
    
    ### What type of PR is it?
    Bug Fix
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/ZEPPELIN-4307
    
    ### How should this be tested?
    * First time? Setup Travis CI as described on https://zeppelin.apache.org/contribution/contributions.html#continuous-integration
    * Strongly recommended: add automated unit tests for any new or changed behavior
    * Outline any manual steps to test the PR here.
    
    ### Screenshots (if appropriate)
    ![Sep-03-2019 00-14-43](https://user-images.githubusercontent.com/3839771/64123633-e54de800-cddf-11e9-8047-e3c7ea23cf7b.gif)
    
    ### Questions:
    * Does the licenses files need update? no
    * Is there breaking changes for older versions? no
    * Does this needs documentation? no
    
    Author: Jay Jin <ja...@gmail.com>
    
    Closes #3435 from milooy/master and squashes the following commits:
    
    9606ec004 [Jay Jin] Add '/setup' to doc link on the version over 0.7.0
---
 zeppelin-web/src/app/credential/credential.controller.js | 13 ++++++++++++-
 zeppelin-web/src/app/credential/credential.html          |  2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/zeppelin-web/src/app/credential/credential.controller.js b/zeppelin-web/src/app/credential/credential.controller.js
index cf6c340..7de383e 100644
--- a/zeppelin-web/src/app/credential/credential.controller.js
+++ b/zeppelin-web/src/app/credential/credential.controller.js
@@ -14,7 +14,7 @@
 
 angular.module('zeppelinWebApp').controller('CredentialCtrl', CredentialController);
 
-function CredentialController($scope, $http, baseUrlSrv, ngToast) {
+function CredentialController($scope, $rootScope, $http, baseUrlSrv, ngToast) {
   'ngInject';
 
   ngToast.dismiss();
@@ -198,6 +198,17 @@ function CredentialController($scope, $http, baseUrlSrv, ngToast) {
     }
   }
 
+  $scope.getCredentialDocsLink = function() {
+    const currentVersion = $rootScope.zeppelinVersion;
+    const isVersionOver0Point7 = currentVersion && currentVersion.split('.')[1] > 7;
+    /*
+     * Add '/setup' to doc link on the version over 0.7.0
+     */
+    return `https://zeppelin.apache.org/docs/${currentVersion}${
+      isVersionOver0Point7 ? '/setup' : ''
+    }/security/datasource_authorization.html`;
+  };
+
   let init = function() {
     getAvailableInterpreters();
     getCredentialInfo();
diff --git a/zeppelin-web/src/app/credential/credential.html b/zeppelin-web/src/app/credential/credential.html
index cf283d6..7c9414d 100644
--- a/zeppelin-web/src/app/credential/credential.html
+++ b/zeppelin-web/src/app/credential/credential.html
@@ -21,7 +21,7 @@ limitations under the License.
         <div class="pull-right" style="margin-top:10px;">
           <a style="cursor:pointer;margin-right:10px;text-decoration:none;"
              target="_blank"
-             ng-href="http://zeppelin.apache.org/docs/{{zeppelinVersion}}/security/datasource_authorization.html"
+             ng-href="{{getCredentialDocsLink()}}"
              tooltip-placement="bottom" uib-tooltip="Learn more">
             <i class="icon-question" ng-style="{color: showRepositoryInfo ? '#3071A9' : 'black' }"></i>
           </a>