Parcourir la source

AMBARI-2654. Click "undo" on Database URL erases the data. (Andrii Babiichuk via yusaku)

Yusaku Sako il y a 12 ans
Parent
commit
37d60ec80d
1 fichiers modifiés avec 4 ajouts et 5 suppressions
  1. 4 5
      ambari-web/app/views/wizard/controls_view.js

+ 4 - 5
ambari-web/app/views/wizard/controls_view.js

@@ -211,8 +211,8 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
 
   onOptionsChange: function () {
     var connectionUrl = this.get('connectionUrl');
-    if (this.get('serviceConfig.serviceName') === 'HIVE') {
-      if (this.get('hostName') && this.get('databaseName') && connectionUrl) {
+    if (connectionUrl) {
+      if (this.get('serviceConfig.serviceName') === 'HIVE') {
         switch (this.get('serviceConfig.value')) {
           case 'New MySQL Database':
           case 'Existing MySQL Database':
@@ -222,9 +222,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
             connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName'));
             break;
         }
-      }
-    } else if (this.get('serviceConfig.serviceName') === 'OOZIE') {
-      if (this.get('hostName') && this.get('databaseName') && connectionUrl) {
+      } else if (this.get('serviceConfig.serviceName') === 'OOZIE') {
         switch (this.get('serviceConfig.value')) {
           case 'New Derby Database':
             connectionUrl.set('value', "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true");
@@ -237,6 +235,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
             break;
         }
       }
+      connectionUrl.set('defaultValue', connectionUrl.get('value'));
     }
   }.observes('databaseName', 'hostName', 'connectionUrl'),