ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lpus...@apache.org
Subject [11/36] ambari git commit: AMBARI-21360: Ability to delete a view instance from view instance list (sangeetar)
Date Tue, 04 Jul 2017 16:18:34 GMT
AMBARI-21360: Ability to delete a view instance from view instance list (sangeetar)


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

Branch: refs/heads/feature-branch-AMBARI-21307
Commit: a3681c0199f31511170770d454697206cbeeeda3
Parents: 3446283
Author: Sangeeta Ravindran <sangeetar@apache.org>
Authored: Wed Jun 28 09:29:57 2017 -0700
Committer: Sangeeta Ravindran <sangeetar@apache.org>
Committed: Wed Jun 28 09:29:57 2017 -0700

----------------------------------------------------------------------
 AMBARI-21360.patch                              | 45 ++++++++++++++++++++
 .../controllers/ambariViews/ViewsListCtrl.js    | 20 +++++++++
 .../app/views/ambariViews/listTable.html        |  3 ++
 3 files changed, 68 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a3681c01/AMBARI-21360.patch
----------------------------------------------------------------------
diff --git a/AMBARI-21360.patch b/AMBARI-21360.patch
new file mode 100644
index 0000000..c26f3a0
--- /dev/null
+++ b/AMBARI-21360.patch
@@ -0,0 +1,45 @@
+diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
+index c41e5d4..4e7bae3 100644
+--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
++++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
+@@ -132,6 +132,26 @@ angular.module('ambariAdminConsole')
+     }
+   };
+ 
++  $scope.deleteInstance = function(instance) {
++      ConfirmationModal.show(
++        $t('common.delete', {
++          term: $t('views.viewInstance')
++        }),
++        $t('common.deleteConfirmation', {
++          instanceType: $t('views.viewInstance'),
++          instanceName: instance.ViewInstanceInfo.label
++        })
++      ).then(function() {
++        View.deleteInstance(instance.ViewInstanceInfo.view_name, instance.ViewInstanceInfo.version,
instance.ViewInstanceInfo.instance_name)
++          .then(function() {
++            loadViews();
++          })
++          .catch(function(data) {
++            Alert.error($t('views.alerts.cannotDeleteInstance'), data.data.message);
++          });
++      });
++    };
++
+   $scope.reloadViews = function () {
+     loadViews();
+   };
+diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
+index 59c322f..91b9a93 100644
+--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
++++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
+@@ -81,6 +81,9 @@
+                     <td class="col-sm-1">
+                         <a class="instance-link ng-scope ng-binding" href="#/views/{{view.view_name}}/versions/{{instance.ViewInstanceInfo.version}}/instances/{{instance.ViewInstanceInfo.instance_name}}/clone"><i
class="fa fa-copy"></i></a>
+                     </td>
++                    <td class="col-sm-1">
++                        <a class="instance-link ng-scope ng-binding" href ng-click="deleteInstance(instance)"><i
class="fa fa-trash-o"></i></a>
++                    </td>
+                 </tr>
+                 </tbody>
+                 <tfoot>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a3681c01/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
index c41e5d4..4e7bae3 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsListCtrl.js
@@ -132,6 +132,26 @@ angular.module('ambariAdminConsole')
     }
   };
 
+  $scope.deleteInstance = function(instance) {
+      ConfirmationModal.show(
+        $t('common.delete', {
+          term: $t('views.viewInstance')
+        }),
+        $t('common.deleteConfirmation', {
+          instanceType: $t('views.viewInstance'),
+          instanceName: instance.ViewInstanceInfo.label
+        })
+      ).then(function() {
+        View.deleteInstance(instance.ViewInstanceInfo.view_name, instance.ViewInstanceInfo.version,
instance.ViewInstanceInfo.instance_name)
+          .then(function() {
+            loadViews();
+          })
+          .catch(function(data) {
+            Alert.error($t('views.alerts.cannotDeleteInstance'), data.data.message);
+          });
+      });
+    };
+
   $scope.reloadViews = function () {
     loadViews();
   };

http://git-wip-us.apache.org/repos/asf/ambari/blob/a3681c01/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
index 59c322f..91b9a93 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
@@ -81,6 +81,9 @@
                     <td class="col-sm-1">
                         <a class="instance-link ng-scope ng-binding" href="#/views/{{view.view_name}}/versions/{{instance.ViewInstanceInfo.version}}/instances/{{instance.ViewInstanceInfo.instance_name}}/clone"><i
class="fa fa-copy"></i></a>
                     </td>
+                    <td class="col-sm-1">
+                        <a class="instance-link ng-scope ng-binding" href ng-click="deleteInstance(instance)"><i
class="fa fa-trash-o"></i></a>
+                    </td>
                 </tr>
                 </tbody>
                 <tfoot>


Mime
View raw message