ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-12297. When in the Tez view, you cannot switch to the Hive view. (Erik via Jaimin)
Date Tue, 07 Jul 2015 23:19:09 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 94bc6aaec -> 62fa3550d


AMBARI-12297. When in the Tez view, you cannot switch to the Hive view. (Erik via Jaimin)


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

Branch: refs/heads/branch-2.1
Commit: 62fa3550d11655e854863027ffe83acad887b464
Parents: 94bc6aa
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Tue Jul 7 16:18:49 2015 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Tue Jul 7 16:18:49 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/routes/views.js | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/62fa3550/ambari-web/app/routes/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/views.js b/ambari-web/app/routes/views.js
index 051d218..08396eb 100644
--- a/ambari-web/app/routes/views.js
+++ b/ambari-web/app/routes/views.js
@@ -39,7 +39,11 @@ module.exports = Em.Route.extend({
       var href = ['/views', params.viewName, params.version, params.instanceName + "/"].join('/');
       var viewPath = this.parseViewPath(window.location.href.slice(window.location.href.indexOf('?')));
       if (viewPath) {
-        href = ['/views', params.viewName, params.version, params.instanceName.slice(0, params.instanceName.lastIndexOf('?'))
+ "/"].join('/');
+        var slicedInstanceName = this._getSlicedInstanceName(params.instanceName);
+        if (slicedInstanceName === params.instanceName) {
+          viewPath = '';
+        }
+        href = ['/views', params.viewName, params.version, slicedInstanceName + "/"].join('/');
         //remove slash from viewPath since href already contains it at the end
         if (viewPath.charAt(0) === '/') viewPath = viewPath.slice(1);
       }
@@ -50,6 +54,22 @@ module.exports = Em.Route.extend({
         router.get('mainController').connectOutlet('mainViewsDetails', content);
       });
     },
+
+    /**
+     * parse the instance name and slice if needed
+     *
+     * @param {string}
+     * @returns {string}
+     * @private
+     */
+    _getSlicedInstanceName: function (instanceName) {
+      if (instanceName.lastIndexOf('?') > -1) {
+        return instanceName.slice(0, instanceName.lastIndexOf('?'));
+      }
+
+      return instanceName;
+    },
+
     /**
      * parse internal view path
      * "viewPath" - used as a key of additional path


Mime
View raw message