ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [1/3] ambari git commit: AMBARI-11626. Views: display name not update on views top menu (alexantonenko)
Date Tue, 02 Jun 2015 14:50:56 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9fa9c756e -> 9e75a7370


AMBARI-11626. Views: display name not update on views top menu (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 9e75a73704d2965bea3de033fe4dcb230dcad895
Parents: abb7028
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Tue Jun 2 17:43:57 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Tue Jun 2 17:50:51 2015 +0300

----------------------------------------------------------------------
 .../controllers/ambariViews/CreateViewInstanceCtrl.js |  3 ++-
 .../scripts/controllers/ambariViews/ViewsEditCtrl.js  |  2 ++
 .../ui/admin-web/app/scripts/controllers/mainCtrl.js  | 14 +++++++++++---
 3 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9e75a737/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
index ddda59e..02b7aa9 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
@@ -135,6 +135,7 @@ angular.module('ambariAdminConsole')
             $location.path('/views/' + $scope.instance.view_name + '/versions/' + $scope.instance.version
+ '/instances/' + $scope.instance.instance_name + '/edit');
           }
             $scope.form.instanceCreateForm.isSaving = false;
+            $scope.$root.$emit('instancesUpdate');
         })
         .catch(function (data) {
           var errorMessage = data.message;
@@ -154,7 +155,7 @@ angular.module('ambariAdminConsole')
               });
 
               if (showGeneralError) {
-                $scope.form.instanceCreateForm.generalValidationError = errorMessage;  
+                $scope.form.instanceCreateForm.generalValidationError = errorMessage;
               }
             } catch (e) {
               console.error('Unable to parse error message:', data.message);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e75a737/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
index e7f80ee..2404dc0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
@@ -196,6 +196,7 @@ angular.module('ambariAdminConsole')
     $scope.cluster = $scope.clusters[0];
   });
 
+
   $scope.saveSettings = function(callback) {
     if( $scope.settingsForm.$valid ){
       var data = {
@@ -241,6 +242,7 @@ angular.module('ambariAdminConsole')
       };
       return View.updateInstance($routeParams.viewId, $routeParams.version, $routeParams.instanceId,
data)
       .success(function() {
+        $scope.$root.$emit('instancesUpdate');
         if( callback ){
           callback();
         } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e75a737/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
index b740a6a..e2b3a50 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
@@ -71,12 +71,20 @@ angular.module('ambariAdminConsole')
   loadAmbariVersion();
 
   $scope.viewInstances = [];
-  View.getAllVisibleInstance().then(function(instances) {
-    $scope.viewInstances = instances;
-  });
+
+  $scope.updateInstances = function () {
+    View.getAllVisibleInstance().then(function(instances) {
+      $scope.viewInstances = instances;
+    });
+  };
 
   $scope.gotoViewsDashboard =function() {
     window.location = '/#/main/views';
   };
 
+  $scope.$root.$on('instancesUpdate', function (event, data) {
+    $scope.updateInstances();
+  });
+
+  $scope.updateInstances();
 }]);


Mime
View raw message