tbonelee commented on code in PR #4993:
URL: https://github.com/apache/zeppelin/pull/4993#discussion_r2225248507


##########
zeppelin-web/src/app/credential/credential.controller.js:
##########
@@ -199,10 +199,13 @@ function CredentialController($scope, $rootScope, $http, 
baseUrlSrv, ngToast) {
   }
 
   $scope.getCredentialDocsLink = function() {
-    const currentVersion = $rootScope.zeppelinVersion;
-    const isVersionOver0Point7 = currentVersion && 
currentVersion.split('.')[1] > 7;
+    let currentVersion = $rootScope.zeppelinVersion || '0.12.0';
+    currentVersion = currentVersion.replace('-SNAPSHOT', '');

Review Comment:
   How about replacing the `-SNAPSHOT` part if present, and falling back to 
`'latest'` instead?
   Also, I think it's preferrable to avoid  hardcoding version strings like 
`'0.12.0'`.
   ```suggestion
       const currentVersion = $rootScope.zeppelinVersion
         && $rootScope.zeppelinVersion.replace('-SNAPSHOT', '') || 'latest';
   ```



##########
zeppelin-web/src/app/credential/credential.controller.js:
##########
@@ -199,10 +199,13 @@ function CredentialController($scope, $rootScope, $http, 
baseUrlSrv, ngToast) {
   }
 
   $scope.getCredentialDocsLink = function() {
-    const currentVersion = $rootScope.zeppelinVersion;
-    const isVersionOver0Point7 = currentVersion && 
currentVersion.split('.')[1] > 7;
+    let currentVersion = $rootScope.zeppelinVersion || '0.12.0';
+    currentVersion = currentVersion.replace('-SNAPSHOT', '');
+
+    const isVersionOver0Point7 = currentVersion.split('.')[1] > 7;
+
     /*
-     * Add '/setup' to doc link on the version over 0.7.0
+     * Add '/setup' to doc link on the version over 0.7.0, add '/setup' to the 
doc URL

Review Comment:
   The add part seems to repeat the same meaning as the original comment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to