From b76b07955a9be56c2e36e9d6491ac3311bf636a1 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Tue, 5 Apr 2016 09:44:48 -0400 Subject: [PATCH] Removed directives, moved to controllers and partials. --- .../copy-groups.directive.js | 25 ------------------- ...ontroller.js => copy-groups.controller.js} | 4 +-- ....partial.html => copy-groups.partial.html} | 0 .../copy-hosts.directive.js | 25 ------------------- ...controller.js => copy-hosts.controller.js} | 4 +-- ...e.partial.html => copy-hosts.partial.html} | 0 .../src/inventories/manage/copy/copy.route.js | 22 ++++++++-------- .../src/inventories/manage/copy/main.js | 4 --- 8 files changed, 14 insertions(+), 70 deletions(-) delete mode 100644 awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.js rename awx/ui/client/src/inventories/manage/copy/{copy-groups-directive/copy-groups.directive.controller.js => copy-groups.controller.js} (98%) rename awx/ui/client/src/inventories/manage/copy/{copy-groups-directive/copy-groups.directive.partial.html => copy-groups.partial.html} (100%) delete mode 100644 awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.js rename awx/ui/client/src/inventories/manage/copy/{copy-hosts-directive/copy-hosts.directive.controller.js => copy-hosts.controller.js} (96%) rename awx/ui/client/src/inventories/manage/copy/{copy-hosts-directive/copy-hosts.directive.partial.html => copy-hosts.partial.html} (100%) diff --git a/awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.js b/awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.js deleted file mode 100644 index f71cba7158..0000000000 --- a/awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.js +++ /dev/null @@ -1,25 +0,0 @@ -/************************************************* - * Copyright (c) 2015 Ansible, Inc. - * - * All Rights Reserved - *************************************************/ - -/* jshint unused: vars */ -import copyGroupsDirectiveController from './copy-groups.directive.controller'; - -export default ['templateUrl', - function(templateUrl) { - return { - restrict: 'EA', - scope: true, - replace: true, - templateUrl: templateUrl('inventories/manage/copy/copy-groups-directive/copy-groups.directive'), - link: function(scope, element, attrs) { - - }, - controller: copyGroupsDirectiveController, - controllerAs: 'vm', - bindToController: true - }; - } -]; diff --git a/awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.controller.js b/awx/ui/client/src/inventories/manage/copy/copy-groups.controller.js similarity index 98% rename from awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.controller.js rename to awx/ui/client/src/inventories/manage/copy/copy-groups.controller.js index f0a1149726..480eb38b4e 100644 --- a/awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.controller.js +++ b/awx/ui/client/src/inventories/manage/copy/copy-groups.controller.js @@ -1,4 +1,4 @@ -function copyGroupsDirectiveController($compile, $state, $scope, $location, Rest, ProcessErrors, CreateDialog, +function CopyGroupsCtrl($compile, $state, $scope, $location, Rest, ProcessErrors, CreateDialog, GetBasePath, Wait, GenerateList, GroupList, SearchInit, PaginateInit, GetRootGroups, ParamPass, Store) { var vm = this; var name; @@ -299,5 +299,5 @@ function copyGroupsDirectiveController($compile, $state, $scope, $location, Rest }; export default ['$compile', '$state', '$scope', '$location', 'Rest', 'ProcessErrors', 'CreateDialog', 'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit', - 'PaginateInit', 'GetRootGroups', 'ParamPass', 'Store', copyGroupsDirectiveController + 'PaginateInit', 'GetRootGroups', 'ParamPass', 'Store', CopyGroupsCtrl ]; diff --git a/awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.partial.html b/awx/ui/client/src/inventories/manage/copy/copy-groups.partial.html similarity index 100% rename from awx/ui/client/src/inventories/manage/copy/copy-groups-directive/copy-groups.directive.partial.html rename to awx/ui/client/src/inventories/manage/copy/copy-groups.partial.html diff --git a/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.js b/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.js deleted file mode 100644 index 794a932012..0000000000 --- a/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.js +++ /dev/null @@ -1,25 +0,0 @@ -/************************************************* - * Copyright (c) 2015 Ansible, Inc. - * - * All Rights Reserved - *************************************************/ - -/* jshint unused: vars */ -import copyHostsDirectiveController from './copy-hosts.directive.controller'; - -export default ['templateUrl', - function(templateUrl) { - return { - restrict: 'EA', - scope: true, - replace: true, - templateUrl: templateUrl('inventories/manage/copy/copy-hosts-directive/copy-hosts.directive'), - link: function(scope, element, attrs) { - - }, - controller: copyHostsDirectiveController, - controllerAs: 'vm', - bindToController: true - }; - } -]; diff --git a/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.controller.js b/awx/ui/client/src/inventories/manage/copy/copy-hosts.controller.js similarity index 96% rename from awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.controller.js rename to awx/ui/client/src/inventories/manage/copy/copy-hosts.controller.js index 1da180f880..1102d934c8 100644 --- a/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.controller.js +++ b/awx/ui/client/src/inventories/manage/copy/copy-hosts.controller.js @@ -1,4 +1,4 @@ -function copyHostsDirectiveController($compile, $state, $scope, Rest, ProcessErrors, CreateDialog, GetBasePath, Wait, GenerateList, GroupList, SearchInit, PaginateInit, ParamPass, Store) { +function CopyHostsCtrl($compile, $state, $scope, Rest, ProcessErrors, CreateDialog, GetBasePath, Wait, GenerateList, GroupList, SearchInit, PaginateInit, ParamPass, Store) { var vm = this; var name; @@ -235,5 +235,5 @@ function copyHostsDirectiveController($compile, $state, $scope, Rest, ProcessErr } export default ['$compile', '$state', '$scope', 'Rest', 'ProcessErrors', 'CreateDialog', 'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit', - 'PaginateInit', 'ParamPass', 'Store', copyHostsDirectiveController + 'PaginateInit', 'ParamPass', 'Store', CopyHostsCtrl ]; diff --git a/awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.partial.html b/awx/ui/client/src/inventories/manage/copy/copy-hosts.partial.html similarity index 100% rename from awx/ui/client/src/inventories/manage/copy/copy-hosts-directive/copy-hosts.directive.partial.html rename to awx/ui/client/src/inventories/manage/copy/copy-hosts.partial.html diff --git a/awx/ui/client/src/inventories/manage/copy/copy.route.js b/awx/ui/client/src/inventories/manage/copy/copy.route.js index cd1f58d6cb..abd0e3a00e 100644 --- a/awx/ui/client/src/inventories/manage/copy/copy.route.js +++ b/awx/ui/client/src/inventories/manage/copy/copy.route.js @@ -8,6 +8,8 @@ import { } from '../../../shared/template-url/template-url.factory'; import inventoryManageCopyCtrl from './copy.controller'; +import CopyGroupsCtrl from './copy-groups.controller'; +import CopyHostsCtrl from './copy-hosts.controller'; export default { copy: { @@ -29,33 +31,29 @@ export default { copyGroup: { name: 'inventoryManage.copy.group', route: '/group/:group_id?groups', - template: '
', + templateUrl: templateUrl('inventories/manage/copy/copy-groups'), data: { group_id: 'group_id', }, ncyBreadcrumb: { label: "GROUP" }, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } + controller: CopyGroupsCtrl, + controllerAs: 'vm', + bindToController: true }, copyHost: { name: 'inventoryManage.copy.host', route: '/host/:host_id?groups', - template: '
', + templateUrl: templateUrl('inventories/manage/copy/copy-hosts'), data: { host_id: 'host_id', }, ncyBreadcrumb: { label: "HOST" }, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } + controller: CopyHostsCtrl, + controllerAs: 'vm', + bindToController: true } }; diff --git a/awx/ui/client/src/inventories/manage/copy/main.js b/awx/ui/client/src/inventories/manage/copy/main.js index f6da96f0a0..898d5f9ae1 100644 --- a/awx/ui/client/src/inventories/manage/copy/main.js +++ b/awx/ui/client/src/inventories/manage/copy/main.js @@ -5,13 +5,9 @@ *************************************************/ import route from './copy.route'; -import copyGroupsDirective from './copy-groups-directive/copy-groups.directive'; -import copyHostsDirective from './copy-hosts-directive/copy-hosts.directive'; export default angular.module('inventory-copy', []) - .directive('copyGroups', copyGroupsDirective) - .directive('copyHosts', copyHostsDirective) .run(['$stateExtender', function($stateExtender) { $stateExtender.addState(route.copy); $stateExtender.addState(route.copyGroup);