From 83c5feb3045b3359416e06d804aefd035e8c5914 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 21 Aug 2015 10:57:02 +0200 Subject: [PATCH] bug #3912: Use commonActions in templates-tab --- .../public/app/tabs/templates-tab/actions.js | 51 ++----------------- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/actions.js b/src/sunstone/public/app/tabs/templates-tab/actions.js index 67cfaeb0e7..6093999ca2 100644 --- a/src/sunstone/public/app/tabs/templates-tab/actions.js +++ b/src/sunstone/public/app/tabs/templates-tab/actions.js @@ -21,7 +21,11 @@ define(function(require) { "Template.list" : _commonActions.list(), "Template.show" : _commonActions.show(), "Template.refresh" : _commonActions.refresh(), - "Template.delete" : _commonActions.delete(), + "Template.delete" : _commonActions.del(), + "Template.chown": _commonActions.multipleAction('chown'), + "Template.chgrp": _commonActions.multipleAction('chgrp'), + "Template.chmod": _commonActions.singleAction('chmod'), + "Template.rename": _commonActions.singleAction('rename'), "Template.create" : { type: "create", call: OpenNebulaTemplate.create, @@ -84,15 +88,6 @@ define(function(require) { Notifier.onError(request, response); } }, - "Template.rename" : { - type: "single", - call: OpenNebulaTemplate.rename, - callback: function(request) { - Sunstone.runAction('Template.show', request.request.data[0][0]); - }, - error: Notifier.onError, - notify: true - }, "Template.instantiate" : { type: "multiple", call: OpenNebulaTemplate.instantiate, @@ -138,42 +133,6 @@ define(function(require) { call: OpenNebulaTemplate.clone, error: Notifier.onError, notify: true - }, - "Template.chown" : { - type: "multiple", - call: OpenNebulaTemplate.chown, - callback: function (req) { - Sunstone.runAction("Template.show", req.request.data[0]); - }, - elements: function() { - return Sunstone.getDataTable(TAB_ID).elements(); - }, - error: Notifier.onError, - notify: true - }, - "Template.chgrp" : { - type: "multiple", - call: OpenNebulaTemplate.chgrp, - callback: function (req) { - Sunstone.runAction("Template.show", req.request.data[0]); - }, - elements: function() { - return Sunstone.getDataTable(TAB_ID).elements(); - }, - error: Notifier.onError, - notify: true - }, - "Template.chmod" : { - type: "single", - call: OpenNebulaTemplate.chmod, - callback: function (req) { - Sunstone.runAction("Template.show", req.request.data[0]); - }, - elements: function() { - return Sunstone.getDataTable(TAB_ID).elements(); - }, - error: Notifier.onError, - notify: true } };