You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mz...@apache.org on 2019/09/25 20:11:34 UTC

[mesos] branch master updated: Fixed Javascript linting and IE compatibility of the UI roles tree.

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

mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new aed0b87  Fixed Javascript linting and IE compatibility of the UI roles tree.
aed0b87 is described below

commit aed0b871479ecb1ee36df334c46203b75d682a7e
Author: Andrei Sekretenko <as...@mesosphere.io>
AuthorDate: Wed Sep 25 13:11:08 2019 -0700

    Fixed Javascript linting and IE compatibility of the UI roles tree.
    
    Review: https://reviews.apache.org/r/71541/
---
 src/webui/app/app.js | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/webui/app/app.js b/src/webui/app/app.js
index 24fab09..3456050 100644
--- a/src/webui/app/app.js
+++ b/src/webui/app/app.js
@@ -277,11 +277,11 @@
       function buildTree(roles) {
         var root = {};
 
-        for (var path of roles) {
-          const tokens = path.split('/');
+        for (var roleIndex = 0; roleIndex < roles.length; roleIndex += 1) {
+          var tokens = roles[roleIndex].split('/');
           var i = 0;
           var node = root;
-          for (i = 0; i < tokens.length && (tokens[i] in node); ++i) {
+          for (i = 0; i < tokens.length && (tokens[i] in node); i += 1) {
             node = node[tokens[i]];
           }
 
@@ -289,24 +289,25 @@
             node['.'] = {};
           }
 
-          for (; i < tokens.length; ++i) {
+          for (; i < tokens.length; i += 1) {
             node[tokens[i]] = {};
             node = node[tokens[i]];
           }
         }
 
         return root;
-      };
+      }
 
       function prepareTree(path, name, node) {
-        const prefix = path ? path + '/' : '';
+        var prefix = path ? path + '/' : '';
         return {
-          "children": Object.keys(node).sort().map(
-              k => prepareTree(prefix + k, k, node[k])),
+          "children": Object.keys(node).sort().map(function(k) {
+              return prepareTree(prefix + k, k, node[k]);
+            }),
           "name": name,
           "path": path
           }
-      };
+      }
 
       return {
         restrict: 'E',