ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-10572. Implement UI changes for Ranger additional DB support. (akovalenko)
Date Fri, 17 Apr 2015 21:10:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b392c6861 -> 0f2a90489


AMBARI-10572. Implement UI changes for Ranger additional DB support. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 0f2a90489fe7da89417f03abd1c6c422c61714c8
Parents: b392c68
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Apr 17 20:31:28 2015 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Sat Apr 18 00:09:51 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/app.js                           |  4 ++
 ambari-web/app/data/HDP2.3/site_properties.js   | 64 ++++++++++++++++++++
 .../configs/stack_config_properties_mapper.js   | 11 +++-
 ambari-web/app/utils/config.js                  |  5 +-
 4 files changed, 80 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f2a9048/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 60bc27c..3e33f91 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -162,6 +162,10 @@ module.exports = Em.Application.create({
     return (this.get('currentStackVersion') || this.get('defaultStackVersion')).replace(regExp,
'');
   }.property('currentStackVersion', 'defaultStackVersion', 'currentStackName'),
 
+  isHadoop23Stack: function () {
+    return (stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.3") >
-1);
+  }.property('currentStackVersionNumber'),
+
   isHadoop22Stack: function () {
     return (stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.2") >
-1);
   }.property('currentStackVersionNumber'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f2a9048/ambari-web/app/data/HDP2.3/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2.3/site_properties.js b/ambari-web/app/data/HDP2.3/site_properties.js
new file mode 100644
index 0000000..4665b2e
--- /dev/null
+++ b/ambari-web/app/data/HDP2.3/site_properties.js
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+var hdp22properties = require('data/HDP2.2/site_properties').configProperties;
+
+var excludedConfigs = [
+    'DB_FLAVOR'
+];
+
+var hdp23properties = hdp22properties.filter(function (item) {
+  return !excludedConfigs.contains(item.name);
+});
+
+hdp23properties.push({
+  "id": "site property",
+  "name": "DB_FLAVOR",
+  "displayName": "DB FLAVOR",
+  "value": "MYSQL",
+  "defaultValue": "MYSQL",
+  "isReconfigurable": true,
+  "options": [
+    {
+      displayName: 'MYSQL'
+    },
+    {
+      displayName: 'ORACLE'
+    },
+    {
+      displayName: 'POSTGRES'
+    },
+    {
+      displayName: 'SQLSERVER'
+    }
+  ],
+  "displayType": "radio button",
+  "radioName": "RANGER DB_FLAVOR",
+  "isOverridable": false,
+  "isVisible": true,
+  "serviceName": "RANGER",
+  "filename": "admin-properties.xml",
+  "category": "DBSettings"
+});
+
+module.exports =
+{
+  "configProperties": hdp23properties
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f2a9048/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
index 377095a..c062bf7 100644
--- a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
+++ b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
@@ -75,9 +75,14 @@ App.stackConfigPropertiesMapper = App.QuickDataMapper.create({
    * @type {Object[]};
    */
   preDefinedSiteProperties: function () {
-    var file = App.get('isHadoop22Stack') ? require('data/HDP2.2/site_properties') : require('data/HDP2/site_properties');
-    return file.configProperties;
-  }.property('App.isHadoop22Stack'),
+    if (App.get('isHadoop23Stack')) {
+      return require('data/HDP2.3/site_properties').configProperties;
+    }
+    if (App.get('isHadoop22Stack')) {
+      return require('data/HDP2.2/site_properties').configProperties;
+    }
+    return require('data/HDP2/site_properties').configProperties;
+  }.property('App.isHadoop22Stack', 'App.isHadoop23Stack'),
 
   /**
    * find UI config with current name and fileName

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f2a9048/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 1b7ae4a..0c5b3da4 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -116,11 +116,14 @@ App.config = Em.Object.create({
       return sitePropertiesForCurrentStack.configProperties;
     }
 
+    if (App.get('isHadoop23Stack')) {
+      return require('data/HDP2.3/site_properties').configProperties;
+    }
     if (App.get('isHadoop22Stack')) {
       return require('data/HDP2.2/site_properties').configProperties;
     }
     return require('data/HDP2/site_properties').configProperties;
-  }.property('App.isHadoop22Stack', 'App.currentStackName'),
+  }.property('App.isHadoop22Stack', 'App.isHadoop23Stack', 'App.currentStackName'),
 
   preDefinedConfigFile: function(file) {
     try {


Mime
View raw message