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-13303. Ranger smart config: User Info Tab should change visibility of configs dynamically. (jaimin)
Date Sat, 03 Oct 2015 00:50:17 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 78635b4c1 -> 9e0ca3eab


AMBARI-13303. Ranger smart config: User Info Tab should change visibility of configs dynamically.
(jaimin)


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

Branch: refs/heads/branch-2.1
Commit: 9e0ca3eab274402d919bdf603379e991150be49a
Parents: 78635b4
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Fri Oct 2 17:49:46 2015 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Fri Oct 2 17:49:46 2015 -0700

----------------------------------------------------------------------
 .../ambari/server/state/theme/Subsection.java   |  11 +
 .../RANGER/configuration/ranger-admin-site.xml  |   2 +-
 .../RANGER/configuration/ranger-ugsync-site.xml |  24 +-
 .../HDP/2.3/services/RANGER/themes/theme.json   | 264 +++++++++++++++----
 ambari-web/app/mappers/configs/themes_mapper.js |   1 +
 .../app/models/configs/theme/sub_section.js     |   8 +-
 .../configs/service_config_layout_tab.hbs       |   4 +-
 .../configs/widgets/config_widget_view.js       |   7 +-
 8 files changed, 243 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
index c9f9019..5748dca 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
@@ -172,6 +172,8 @@ public class Subsection {
     private String name;
     @JsonProperty("display-name")
     private String displayName;
+    @JsonProperty("depends-on")
+    private List<ConfigCondition> dependsOn;
 
     public String getName() {
       return name;
@@ -188,5 +190,14 @@ public class Subsection {
     public void setDisplayName(String displayName) {
       this.displayName = displayName;
     }
+
+    public List<ConfigCondition> getDependsOn() {
+      return dependsOn;
+    }
+
+    public void setDependsOn(List<ConfigCondition> dependsOn) {
+      this.dependsOn = dependsOn;
+    }
+
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
index eb8dc38..96d6147 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
@@ -269,7 +269,7 @@
 
   <property>
     <name>ranger.ldap.ad.domain</name>
-    <display-name>Domain Name</display-name>
+    <display-name>Domain Name (AD specific)</display-name>
     <value>localhost</value>
     <description>AD domain, only used if Authentication method is AD</description>
     <description></description>

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
index c73c592..39dfe43 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
@@ -120,18 +120,12 @@
     <name>ranger.usersync.unix.group.file</name>
     <display-name>Group File</display-name>
     <value></value>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
   </property>
 
   <property>
     <name>ranger.usersync.unix.password.file</name>
     <display-name>Password File</display-name>
     <value></value>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
   </property>
 
   <property>
@@ -151,10 +145,6 @@
       <overridable>false</overridable>
       <entries>
         <entry>
-          <value></value>
-          <label>NONE</label>
-        </entry>
-        <entry>
           <value>org.apache.ranger.unixusersync.process.UnixUserGroupBuilder</value>
           <label>UNIX</label>
         </entry>
@@ -164,11 +154,7 @@
         </entry>
         <entry>
           <value>org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder</value>
-          <label>LDAP</label>
-        </entry>
-        <entry>
-          <value>org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder</value>
-          <label>AD</label>
+          <label>LDAP/AD</label>
         </entry>
       </entries>
       <selection-cardinality>1</selection-cardinality>
@@ -209,9 +195,6 @@
     <value></value>
     <property-type>PASSWORD</property-type>
     <description>Password for the account that can search for users.</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
   </property>
 
   <property>
@@ -317,7 +300,7 @@
 
   <property>
     <name>ranger.usersync.group.searchenabled</name>
-    <display-name>Enable Group Sync (Group Search Filter)</display-name>
+    <display-name>Enable Group Sync</display-name>
     <value>false</value>
     <description>"# do we want to do ldapsearch to find groups instead of relying on
user entry attributes
 # valid values: true, false
@@ -373,9 +356,6 @@
 # overrides value specified in ranger.usersync.ldap.searchBase,  ranger.usersync.ldap.user.searchbase
 # if a value is not specified, takes the value of  ranger.usersync.ldap.searchBase
 # if  ranger.usersync.ldap.searchBase is also not specified, takes the value of ranger.usersync.ldap.user.searchbase"</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
index b398a3b..c4f7d59 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
@@ -127,29 +127,108 @@
                   "display-name": "Ranger User Info",
                   "row-index": "0",
                   "column-index": "0",
-                  "row-span": "1",
+                  "row-span": "2",
                   "column-span": "1",
                   "section-columns": "1",
-                  "section-rows": "1",
+                  "section-rows": "2",
                   "subsections": [
                     {
                       "name": "subsection-ranger-user-row1-col1",
                       "row-index": "0",
                       "column-index": "0",
                       "row-span": "1",
+                      "column-span": "1"
+                    },
+                    {
+                      "name": "subsection-ranger-user-row2-col1",
+                      "row-index": "1",
+                      "column-index": "0",
+                      "row-span": "1",
                       "column-span": "1",
                       "subsection-tabs": [
                         {
                           "name": "ldap-common-configs",
-                          "display-name": "Common Configs"
+                          "display-name": "Common Configs",
+                          "depends-on": [
+                            {
+                              "configs": [
+                                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+                              ],
+                              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class}
=== org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder",
+                              "then": {
+                                "property_value_attributes": {
+                                  "visible": true
+                                }
+                              },
+                              "else": {
+                                "property_value_attributes": {
+                                  "visible": false
+                                }
+                              }
+                            }
+                          ]
                         },
                         {
                           "name": "ldap-user-configs",
-                          "display-name": "User Configs"
+                          "display-name": "User Configs",
+                          "depends-on": [
+                            {
+                              "configs": [
+                                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+                              ],
+                              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class}
=== org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder",
+                              "then": {
+                                "property_value_attributes": {
+                                  "visible": true
+                                }
+                              },
+                              "else": {
+                                "property_value_attributes": {
+                                  "visible": false
+                                }
+                              }
+                            }
+                          ]
                         },
                         {
                           "name": "ldap-group-configs",
-                          "display-name": "Group Configs"
+                          "display-name": "Group Configs",
+                          "depends-on": [
+                            {
+                              "configs": [
+                                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+                              ],
+                              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class}
=== org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder",
+                              "then": {
+                                "property_value_attributes": {
+                                  "visible": true
+                                }
+                              },
+                              "else": {
+                                "property_value_attributes": {
+                                  "visible": false
+                                }
+                              }
+                            }
+                          ]
+                        }
+                      ],
+                      "depends-on": [
+                        {
+                          "configs": [
+                            "ranger-ugsync-site/ranger.usersync.enabled"
+                          ],
+                          "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+                          "then": {
+                            "property_value_attributes": {
+                              "visible": true
+                            }
+                          },
+                          "else": {
+                            "property_value_attributes": {
+                              "visible": false
+                            }
+                          }
                         }
                       ]
                     }
@@ -237,48 +316,142 @@
           }
         },
         {
-          "config": "ranger-ugsync-site/ranger.usersync.source.impl.class",
+          "config": "ranger-ugsync-site/ranger.usersync.enabled",
           "subsection-name": "subsection-ranger-user-row1-col1"
         },
+        {
+          "config": "ranger-ugsync-site/ranger.usersync.source.impl.class",
+          "subsection-name": "subsection-ranger-user-row2-col1"
+        },
 
         {
           "config": "ranger-ugsync-site/ranger.usersync.unix.minUserId",
-          "subsection-name": "subsection-ranger-user-row1-col1"
+          "subsection-name": "subsection-ranger-user-row2-col1",
+          "depends-on": [
+            {
+              "configs":[
+                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+              ],
+              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.UnixUserGroupBuilder",
+              "then": {
+                "property_value_attributes": {
+                  "visible": true
+                }
+              },
+              "else": {
+                "property_value_attributes": {
+                  "visible": false
+                }
+              }
+            }
+          ]
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.unix.password.file",
-          "subsection-name": "subsection-ranger-user-row1-col1"
+          "subsection-name": "subsection-ranger-user-row2-col1",
+          "depends-on": [
+            {
+              "configs":[
+                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+              ],
+              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.UnixUserGroupBuilder",
+              "then": {
+                "property_value_attributes": {
+                  "visible": true
+                }
+              },
+              "else": {
+                "property_value_attributes": {
+                  "visible": false
+                }
+              }
+            }
+          ]
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.unix.group.file",
-          "subsection-name": "subsection-ranger-user-row1-col1"
+          "subsection-name": "subsection-ranger-user-row2-col1",
+          "depends-on": [
+            {
+              "configs":[
+                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+              ],
+              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.UnixUserGroupBuilder",
+              "then": {
+                "property_value_attributes": {
+                  "visible": true
+                }
+              },
+              "else": {
+                "property_value_attributes": {
+                  "visible": false
+                }
+              }
+            }
+          ]
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.filesource.file",
-          "subsection-name": "subsection-ranger-user-row1-col1"
+          "subsection-name": "subsection-ranger-user-row2-col1",
+          "depends-on": [
+            {
+              "configs":[
+                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+              ],
+              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder",
+              "then": {
+                "property_value_attributes": {
+                  "visible": true
+                }
+              },
+              "else": {
+                "property_value_attributes": {
+                  "visible": false
+                }
+              }
+            }
+          ]
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.filesource.text.delimiter",
-          "subsection-name": "subsection-ranger-user-row1-col1"
+          "subsection-name": "subsection-ranger-user-row2-col1",
+          "depends-on": [
+            {
+              "configs":[
+                "ranger-ugsync-site/ranger.usersync.source.impl.class"
+              ],
+              "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder",
+              "then": {
+                "property_value_attributes": {
+                  "visible": true
+                }
+              },
+              "else": {
+                "property_value_attributes": {
+                  "visible": false
+                }
+              }
+            }
+          ]
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.url",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-common-configs"
         },
         {
           "config": "ranger-admin-site/ranger.ldap.ad.domain",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-common-configs"
         },
         {
           "config": "ranger-env/bind_anonymous",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-common-configs"
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.binddn",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-common-configs",
           "depends-on": [
             {
@@ -302,7 +475,7 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.ldapbindpassword",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-common-configs",
           "depends-on": [
             {
@@ -323,22 +496,21 @@
             }
           ]
         },
-
         {
-          "config": "ranger-ugsync-site/ranger.usersync.enabled",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "config": "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-user-configs"
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.user.nameattribute",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-user-configs",
           "depends-on": [
             {
               "configs":[
-                "ranger-ugsync-site/ranger.usersync.enabled"
+                "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
               ],
-              "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+              "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
               "then": {
                 "property_value_attributes": {
                   "visible": true
@@ -354,14 +526,14 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.user.objectclass",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-user-configs",
           "depends-on": [
             {
               "configs":[
-                "ranger-ugsync-site/ranger.usersync.enabled"
+                "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
               ],
-              "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+              "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
               "then": {
                 "property_value_attributes": {
                   "visible": true
@@ -377,14 +549,14 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.user.searchbase",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-user-configs",
           "depends-on": [
             {
               "configs":[
-                "ranger-ugsync-site/ranger.usersync.enabled"
+                "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
               ],
-              "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+              "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
               "then": {
                 "property_value_attributes": {
                   "visible": true
@@ -400,14 +572,14 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.user.searchfilter",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-user-configs",
           "depends-on": [
             {
               "configs":[
-                "ranger-ugsync-site/ranger.usersync.enabled"
+                "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
               ],
-              "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+              "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
               "then": {
                 "property_value_attributes": {
                   "visible": true
@@ -423,14 +595,14 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.user.searchscope",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-user-configs",
           "depends-on": [
             {
               "configs":[
-                "ranger-ugsync-site/ranger.usersync.enabled"
+                "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
               ],
-              "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+              "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
               "then": {
                 "property_value_attributes": {
                   "visible": true
@@ -446,14 +618,14 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.ldap.user.groupnameattribute",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-user-configs",
           "depends-on": [
             {
               "configs":[
-                "ranger-ugsync-site/ranger.usersync.enabled"
+                "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
               ],
-              "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+              "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
               "then": {
                 "property_value_attributes": {
                   "visible": true
@@ -467,20 +639,14 @@
             }
           ]
         },
-
-        {
-          "config": "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled",
-          "subsection-name": "subsection-ranger-user-row1-col1",
-          "subsection-tab-name": "ldap-group-configs"
-        },
         {
           "config": "ranger-ugsync-site/ranger.usersync.group.searchenabled",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-group-configs"
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.group.memberattributename",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-group-configs",
           "depends-on": [
             {
@@ -503,7 +669,7 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.group.nameattribute",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-group-configs",
           "depends-on": [
             {
@@ -526,7 +692,7 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.group.objectclass",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-group-configs",
           "depends-on": [
             {
@@ -549,7 +715,7 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.group.searchbase",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-group-configs",
           "depends-on": [
             {
@@ -572,7 +738,7 @@
         },
         {
           "config": "ranger-ugsync-site/ranger.usersync.group.searchfilter",
-          "subsection-name": "subsection-ranger-user-row1-col1",
+          "subsection-name": "subsection-ranger-user-row2-col1",
           "subsection-tab-name": "ldap-group-configs",
           "depends-on": [
             {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-web/app/mappers/configs/themes_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/themes_mapper.js b/ambari-web/app/mappers/configs/themes_mapper.js
index c296713..e23b691 100644
--- a/ambari-web/app/mappers/configs/themes_mapper.js
+++ b/ambari-web/app/mappers/configs/themes_mapper.js
@@ -66,6 +66,7 @@ App.themesMapper = App.QuickDataMapper.create({
     "id": "name",
     "name": "name",
     "display_name": "display-name",
+    "depends_on": "depends-on",
     "sub_section_id": "sub_section_id"
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-web/app/models/configs/theme/sub_section.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/theme/sub_section.js b/ambari-web/app/models/configs/theme/sub_section.js
index ba6cc99..937e5ba 100644
--- a/ambari-web/app/models/configs/theme/sub_section.js
+++ b/ambari-web/app/models/configs/theme/sub_section.js
@@ -92,6 +92,10 @@ App.SubSection = DS.Model.extend({
     return this.get('subSectionTabs.length');
   }.property('subSectionTabs.length'),
 
+  showTabs: function() {
+    return this.get('hasTabs')  && this.get('subSectionTabs').someProperty('isVisible');
+  }.property('hasTabs','subSectionTabs.@each.isVisible'),
+
   /**
    * Number of the errors in all configs
    * @type {number}
@@ -99,8 +103,8 @@ App.SubSection = DS.Model.extend({
   errorsCount: function () {
     return this.get('configs').filter(function(config) {
       return !config.get('isValid') || (config.get('overrides') || []).someProperty('isValid',
false);
-    }).length;
-  }.property('configs.@each.isValid', 'configs.@each.overrideErrorTrigger'),
+    }).filterProperty('isVisible').length;
+  }.property('configs.@each.isValid', 'configs.@each.isVisible', 'configs.@each.overrideErrorTrigger'),
 
   /**
    * @type {boolean}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs b/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
index 0afe6ac..c1bb92b 100644
--- a/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
@@ -47,10 +47,10 @@
                                 {{/if}}
                               {{/if}}
                             {{/each}}
-                            {{#if subsection.hasTabs}}
+                            {{#if subsection.showTabs}}
                               <ul class="nav nav-tabs mbm config-tabs">
                                 {{#each subSectionTab in subsection.subSectionTabs}}
-                                  <li rel='tooltip' {{bindAttr class="subSectionTab.isActive:active
subSectionTab.isHiddenByFilter:disabled" data-original-title="tab.tooltipMsg"}}>
+                                  <li rel='tooltip' {{bindAttr class="subSectionTab.isActive:active
subSectionTab.isVisible::disabled" data-original-title="tab.tooltipMsg"}}>
                                     <a href="#" {{action setActiveSubTab subSectionTab
target="view"}}{{bindAttr data-target="subSectionTab.id"}} data-toggle="tab">
                                       {{subSectionTab.displayName}}
                                     </a>

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e0ca3ea/ambari-web/app/views/common/configs/widgets/config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/config_widget_view.js b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
index 30c942b..5fa6430 100644
--- a/ambari-web/app/views/common/configs/widgets/config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
@@ -394,7 +394,10 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
     var serviceName = this.get('config.serviceName');
     var serviceConfigs = this.get('controller.stepConfigs').findProperty('serviceName',serviceName).get('configs');
     configConditions.forEach(function(configCondition){
-      var ifCondition =  configCondition.get("if");
+      var ifStatement =  configCondition.get("if");
+      var splitIfCondition = ifStatement.split('===');
+      var ifCondition =  splitIfCondition[0];
+      var result = splitIfCondition[1] || "true";
       var conditionalConfigName = configCondition.get("configName");
       var conditionalConfigFileName = configCondition.get("fileName");
       var parseIfConditionVal = ifCondition;
@@ -409,7 +412,7 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
         }
       }, this);
 
-      var isConditionTrue =  Boolean(window.eval(parseIfConditionVal));
+      var isConditionTrue =  window.eval(JSON.stringify(parseIfConditionVal.trim())) ===
result.trim();
       var action = isConditionTrue ? configCondition.get("then") : configCondition.get("else");
       var valueAttributes = action.property_value_attributes;
       for (var key in valueAttributes) {


Mime
View raw message