From 414a5e2be07c983846ae3603965a17defae50b25 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 6 Jan 2016 12:56:57 -0500 Subject: [PATCH] Putting list views and form views on same page for remaining CRUD pages --- awx/ui/client/src/app.js | 40 +++++++++---------- awx/ui/client/src/controllers/Credentials.js | 19 +++++---- awx/ui/client/src/controllers/JobTemplates.js | 22 +++++----- .../client/src/controllers/Organizations.js | 18 +++++---- awx/ui/client/src/controllers/Teams.js | 19 +++++---- awx/ui/client/src/controllers/Users.js | 17 ++++---- .../src/inventory-scripts/add/add.route.js | 6 +-- .../src/inventory-scripts/edit/edit.route.js | 4 +- .../inventory-scripts/list/list.controller.js | 4 +- .../inventory-scripts/list/list.partial.html | 1 + .../src/inventory-scripts/list/list.route.js | 2 +- awx/ui/client/src/partials/credentials.html | 1 + awx/ui/client/src/partials/job_templates.html | 3 +- awx/ui/client/src/partials/organizations.html | 1 + awx/ui/client/src/partials/teams.html | 1 + awx/ui/client/src/partials/users.html | 1 + .../src/setup-menu/setup-menu.partial.html | 2 +- 17 files changed, 92 insertions(+), 69 deletions(-) diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 3af813dd8c..25e034ab4b 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -371,8 +371,8 @@ var tower = angular.module('Tower', [ } }). - state('jobTemplateAdd', { - url: '/job_templates/add', + state('jobTemplates.add', { + url: '/add', templateUrl: urlPrefix + 'partials/job_templates.html', controller: JobTemplatesAdd, ncyBreadcrumb: { @@ -386,8 +386,8 @@ var tower = angular.module('Tower', [ } }). - state('jobTemplateEdit', { - url: '/job_templates/:template_id', + state('jobTemplates.edit', { + url: '/:template_id', templateUrl: urlPrefix + 'partials/job_templates.html', controller: JobTemplatesEdit, resolve: { @@ -569,8 +569,8 @@ var tower = angular.module('Tower', [ } }). - state('organizationsAdd', { - url: '/organization/add', + state('organizations.add', { + url: '/add', templateUrl: urlPrefix + 'partials/organizations.html', controller: OrganizationsAdd, ncyBreadcrumb: { @@ -584,8 +584,8 @@ var tower = angular.module('Tower', [ } }). - state('organizationEdit', { - url: '/organizations/:organization_id', + state('organizations.edit', { + url: '/:organization_id', templateUrl: urlPrefix + 'partials/organizations.html', controller: OrganizationsEdit, resolve: { @@ -654,8 +654,8 @@ var tower = angular.module('Tower', [ } }). - state('teamsAdd', { - url: '/teams/add', + state('teams.add', { + url: '/add', templateUrl: urlPrefix + 'partials/teams.html', controller: TeamsAdd, ncyBreadcrumb: { @@ -669,8 +669,8 @@ var tower = angular.module('Tower', [ } }). - state('teamEdit', { - url: '/teams/:team_id', + state('teams.edit', { + url: '/:team_id', templateUrl: urlPrefix + 'partials/teams.html', controller: TeamsEdit, resolve: { @@ -783,8 +783,8 @@ var tower = angular.module('Tower', [ } }). - state('credentialAdd', { - url: '/credentials/add', + state('credentials.add', { + url: '/add', templateUrl: urlPrefix + 'partials/credentials.html', controller: CredentialsAdd, ncyBreadcrumb: { @@ -798,8 +798,8 @@ var tower = angular.module('Tower', [ } }). - state('credentialEdit', { - url: '/credentials/:credential_id', + state('credentials.edit', { + url: '/:credential_id', templateUrl: urlPrefix + 'partials/credentials.html', controller: CredentialsEdit, resolve: { @@ -824,8 +824,8 @@ var tower = angular.module('Tower', [ } }). - state('userAdd', { - url: '/users/add', + state('users.add', { + url: '/add', templateUrl: urlPrefix + 'partials/users.html', controller: UsersAdd, ncyBreadcrumb: { @@ -839,8 +839,8 @@ var tower = angular.module('Tower', [ } }). - state('userEdit', { - url: '/users/:user_id', + state('users.edit', { + url: '/:user_id', templateUrl: urlPrefix + 'partials/users.html', controller: UsersEdit, resolve: { diff --git a/awx/ui/client/src/controllers/Credentials.js b/awx/ui/client/src/controllers/Credentials.js index 2dc3ba4109..6124d92cdb 100644 --- a/awx/ui/client/src/controllers/Credentials.js +++ b/awx/ui/client/src/controllers/Credentials.js @@ -11,9 +11,10 @@ */ -export function CredentialsList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, CredentialList, - GenerateList, Prompt, SearchInit, PaginateInit, ReturnToCaller, - ClearScope, ProcessErrors, GetBasePath, SelectionInit, GetChoices, Wait, Stream) { +export function CredentialsList($scope, $rootScope, $location, $log, + $stateParams, Rest, Alert, CredentialList, GenerateList, Prompt, SearchInit, + PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, + SelectionInit, GetChoices, Wait, Stream, $state) { ClearScope(); @@ -93,11 +94,11 @@ export function CredentialsList($scope, $rootScope, $location, $log, $stateParam }; $scope.addCredential = function () { - $location.path($location.path() + '/add'); + $state.transitionTo('credentials.add'); }; $scope.editCredential = function (id) { - $location.path($location.path() + '/' + id); + $state.transitionTo('credentials.edit', {credential_id: id}); }; $scope.deleteCredential = function (id, name) { @@ -124,9 +125,11 @@ export function CredentialsList($scope, $rootScope, $location, $log, $stateParam }; } -CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'CredentialList', 'generateList', - 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', - 'SelectionInit', 'GetChoices', 'Wait', 'Stream' +CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log', + '$stateParams', 'Rest', 'Alert', 'CredentialList', 'generateList', 'Prompt', + 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', + 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'GetChoices', 'Wait', + 'Stream', '$state' ]; diff --git a/awx/ui/client/src/controllers/JobTemplates.js b/awx/ui/client/src/controllers/JobTemplates.js index 7deda071a1..147c98da1b 100644 --- a/awx/ui/client/src/controllers/JobTemplates.js +++ b/awx/ui/client/src/controllers/JobTemplates.js @@ -11,9 +11,11 @@ */ -export function JobTemplatesList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, JobTemplateList, - GenerateList, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, - GetBasePath, JobTemplateForm, CredentialList, LookUpInit, PlaybookRun, Wait, Stream, CreateDialog, $compile) { +export function JobTemplatesList($scope, $rootScope, $location, $log, + $stateParams, Rest, Alert, JobTemplateList, GenerateList, Prompt, + SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, + GetBasePath, JobTemplateForm, CredentialList, LookUpInit, PlaybookRun, + Wait, Stream, CreateDialog, $compile, $state) { ClearScope(); @@ -63,11 +65,11 @@ export function JobTemplatesList($scope, $rootScope, $location, $log, $statePara }; $scope.addJobTemplate = function () { - $location.path($location.path() + '/add'); + $state.transitionTo('jobTemplates.add'); }; $scope.editJobTemplate = function (id) { - $location.path($location.path() + '/' + id); + $state.transitionTo('jobTemplates.edit', {template_id: id}); }; $scope.deleteJobTemplate = function (id, name) { @@ -235,10 +237,12 @@ export function JobTemplatesList($scope, $rootScope, $location, $log, $statePara }; } -JobTemplatesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'JobTemplateList', - 'generateList', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', - 'ProcessErrors', 'GetBasePath', 'JobTemplateForm', 'CredentialList', 'LookUpInit', - 'PlaybookRun', 'Wait', 'Stream', 'CreateDialog' , '$compile' +JobTemplatesList.$inject = ['$scope', '$rootScope', '$location', '$log', + '$stateParams', 'Rest', 'Alert', 'JobTemplateList', 'generateList', + 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', + 'ProcessErrors', 'GetBasePath', 'JobTemplateForm', 'CredentialList', + 'LookUpInit', 'PlaybookRun', 'Wait', 'Stream', 'CreateDialog' , '$compile', + '$state' ]; export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location, $log, $stateParams, JobTemplateForm, diff --git a/awx/ui/client/src/controllers/Organizations.js b/awx/ui/client/src/controllers/Organizations.js index 0031f60a56..dbf7899b4b 100644 --- a/awx/ui/client/src/controllers/Organizations.js +++ b/awx/ui/client/src/controllers/Organizations.js @@ -11,8 +11,10 @@ */ -export function OrganizationsList($stateParams, $scope, $rootScope, $location, $log, Rest, Alert, Prompt, - GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) { +export function OrganizationsList($stateParams, $scope, $rootScope, $location, + $log, Rest, Alert, Prompt, GenerateList, OrganizationList, SearchInit, + PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, + Stream, $state) { ClearScope(); @@ -59,11 +61,11 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, $ }; $scope.addOrganization = function () { - $location.path($location.path() + '/add'); + $state.transitionTo('organizations.add'); }; $scope.editOrganization = function (id) { - $location.path($location.path() + '/' + id); + $state.transitionTo('organizations.edit', {organization_id: id}); }; $scope.deleteOrganization = function (id, name) { @@ -91,9 +93,11 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, $ }; } -OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope', '$location', '$log', 'Rest', 'Alert', 'Prompt', - 'generateList', 'OrganizationList', 'SearchInit', 'PaginateInit', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'Wait', - 'Stream' +OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope', + '$location', '$log', 'Rest', 'Alert', 'Prompt', 'generateList', + 'OrganizationList', 'SearchInit', 'PaginateInit', 'ClearScope', + 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'Wait', + 'Stream', '$state' ]; diff --git a/awx/ui/client/src/controllers/Teams.js b/awx/ui/client/src/controllers/Teams.js index d54bf1be74..fa54f026e2 100644 --- a/awx/ui/client/src/controllers/Teams.js +++ b/awx/ui/client/src/controllers/Teams.js @@ -11,9 +11,10 @@ */ -export function TeamsList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, TeamList, GenerateList, - Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait, - Stream) { +export function TeamsList($scope, $rootScope, $location, $log, $stateParams, + Rest, Alert, TeamList, GenerateList, Prompt, SearchInit, PaginateInit, + ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, + SelectionInit, Wait, Stream, $state) { ClearScope(); @@ -68,11 +69,11 @@ export function TeamsList($scope, $rootScope, $location, $log, $stateParams, Res }; $scope.addTeam = function () { - $location.path($location.path() + '/add'); + $state.transitionTo('teams.add'); }; $scope.editTeam = function (id) { - $location.path($location.path() + '/' + id); + $state.transitionTo('teams.edit', {team_id: id}); }; $scope.deleteTeam = function (id, name) { @@ -105,9 +106,11 @@ export function TeamsList($scope, $rootScope, $location, $log, $stateParams, Res }; } -TeamsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'TeamList', 'generateList', - 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', - 'SetTeamListeners', 'GetBasePath', 'SelectionInit', 'Wait', 'Stream' +TeamsList.$inject = ['$scope', '$rootScope', '$location', '$log', + '$stateParams', 'Rest', 'Alert', 'TeamList', 'generateList', 'Prompt', + 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', + 'ProcessErrors', 'SetTeamListeners', 'GetBasePath', 'SelectionInit', 'Wait', + 'Stream', '$state' ]; diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index d64cdfaa5c..a36944ac41 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -11,8 +11,10 @@ */ -export function UsersList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, UserList, GenerateList, - Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) { +export function UsersList($scope, $rootScope, $location, $log, $stateParams, + Rest, Alert, UserList, GenerateList, Prompt, SearchInit, PaginateInit, + ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, + Wait, Stream, $state) { ClearScope(); @@ -60,11 +62,11 @@ export function UsersList($scope, $rootScope, $location, $log, $stateParams, Res }; $scope.addUser = function () { - $location.path($location.path() + '/add'); + $state.transitionTo('users.add'); }; $scope.editUser = function (id) { - $location.path($location.path() + '/' + id); + $state.transitionTo('users.edit', {user_id: id}); }; $scope.deleteUser = function (id, name) { @@ -95,9 +97,10 @@ export function UsersList($scope, $rootScope, $location, $log, $stateParams, Res }; } -UsersList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'UserList', 'generateList', - 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', - 'SelectionInit', 'Wait', 'Stream' +UsersList.$inject = ['$scope', '$rootScope', '$location', '$log', + '$stateParams', 'Rest', 'Alert', 'UserList', 'generateList', 'Prompt', + 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', + 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'Wait', 'Stream', '$state' ]; diff --git a/awx/ui/client/src/inventory-scripts/add/add.route.js b/awx/ui/client/src/inventory-scripts/add/add.route.js index 0cd9b020b9..8eb1e27bc9 100644 --- a/awx/ui/client/src/inventory-scripts/add/add.route.js +++ b/awx/ui/client/src/inventory-scripts/add/add.route.js @@ -7,8 +7,8 @@ import {templateUrl} from '../../shared/template-url/template-url.factory'; export default { - name: 'inventoryScriptsAdd', - route: '/inventory_scripts/add', + name: 'inventoryScripts.add', + route: '/add', templateUrl: templateUrl('inventory-scripts/add/add'), controller: 'inventoryScriptsAddController', resolve: { @@ -17,7 +17,7 @@ export default { }] }, ncyBreadcrumb: { - parent: 'inventoryScriptsList', + parent: 'inventoryScripts', label: 'CREATE INVENTORY SCRIPT' } }; diff --git a/awx/ui/client/src/inventory-scripts/edit/edit.route.js b/awx/ui/client/src/inventory-scripts/edit/edit.route.js index 9d419045b3..fbd10b2513 100644 --- a/awx/ui/client/src/inventory-scripts/edit/edit.route.js +++ b/awx/ui/client/src/inventory-scripts/edit/edit.route.js @@ -7,8 +7,8 @@ import {templateUrl} from '../../shared/template-url/template-url.factory'; export default { - name: 'inventoryScriptsEdit', - route: '/inventory_scripts/:inventory_script_id', + name: 'inventoryScripts.edit', + route: '/:inventory_script_id', templateUrl: templateUrl('inventory-scripts/edit/edit'), controller: 'inventoryScriptsEditController', params: {inventory_script: null}, diff --git a/awx/ui/client/src/inventory-scripts/list/list.controller.js b/awx/ui/client/src/inventory-scripts/list/list.controller.js index 9d8bb07289..60ab09a991 100644 --- a/awx/ui/client/src/inventory-scripts/list/list.controller.js +++ b/awx/ui/client/src/inventory-scripts/list/list.controller.js @@ -38,7 +38,7 @@ export default scope.search(list.iterator); scope.editCustomInv = function(){ - $state.transitionTo('inventoryScriptsEdit',{ + $state.transitionTo('inventoryScripts.edit',{ inventory_script_id: this.inventory_script.id, inventory_script: this.inventory_script }); @@ -74,7 +74,7 @@ export default }; scope.addCustomInv = function(){ - $state.transitionTo('inventoryScriptsAdd'); + $state.transitionTo('inventoryScripts.add'); }; } diff --git a/awx/ui/client/src/inventory-scripts/list/list.partial.html b/awx/ui/client/src/inventory-scripts/list/list.partial.html index 33085edcb3..9251ef810b 100644 --- a/awx/ui/client/src/inventory-scripts/list/list.partial.html +++ b/awx/ui/client/src/inventory-scripts/list/list.partial.html @@ -1,3 +1,4 @@
+
diff --git a/awx/ui/client/src/inventory-scripts/list/list.route.js b/awx/ui/client/src/inventory-scripts/list/list.route.js index 0a5423f6e3..3c897c1321 100644 --- a/awx/ui/client/src/inventory-scripts/list/list.route.js +++ b/awx/ui/client/src/inventory-scripts/list/list.route.js @@ -7,7 +7,7 @@ import {templateUrl} from '../../shared/template-url/template-url.factory'; export default { - name: 'inventoryScriptsList', + name: 'inventoryScripts', route: '/inventory_scripts', templateUrl: templateUrl('inventory-scripts/list/list'), controller: 'inventoryScriptsListController', diff --git a/awx/ui/client/src/partials/credentials.html b/awx/ui/client/src/partials/credentials.html index 6255311d45..db64ab99c1 100644 --- a/awx/ui/client/src/partials/credentials.html +++ b/awx/ui/client/src/partials/credentials.html @@ -1,3 +1,4 @@
+
diff --git a/awx/ui/client/src/partials/job_templates.html b/awx/ui/client/src/partials/job_templates.html index 296a8ca820..8097ecb546 100644 --- a/awx/ui/client/src/partials/job_templates.html +++ b/awx/ui/client/src/partials/job_templates.html @@ -1,4 +1,5 @@
+
@@ -11,4 +12,4 @@
Please enter a name for this job template copy.
- \ No newline at end of file + diff --git a/awx/ui/client/src/partials/organizations.html b/awx/ui/client/src/partials/organizations.html index 337cfea1ac..6990db761f 100644 --- a/awx/ui/client/src/partials/organizations.html +++ b/awx/ui/client/src/partials/organizations.html @@ -1,3 +1,4 @@
+
diff --git a/awx/ui/client/src/partials/teams.html b/awx/ui/client/src/partials/teams.html index 49f615e893..ec43954940 100644 --- a/awx/ui/client/src/partials/teams.html +++ b/awx/ui/client/src/partials/teams.html @@ -1,3 +1,4 @@
+
diff --git a/awx/ui/client/src/partials/users.html b/awx/ui/client/src/partials/users.html index 2a442ac1d4..c495d5db22 100644 --- a/awx/ui/client/src/partials/users.html +++ b/awx/ui/client/src/partials/users.html @@ -1,3 +1,4 @@
+
diff --git a/awx/ui/client/src/setup-menu/setup-menu.partial.html b/awx/ui/client/src/setup-menu/setup-menu.partial.html index 3415343354..469eed33c3 100644 --- a/awx/ui/client/src/setup-menu/setup-menu.partial.html +++ b/awx/ui/client/src/setup-menu/setup-menu.partial.html @@ -63,7 +63,7 @@ Manage the cleanup of old job history, activity streams, data marked for deletion, and system tracking info. - +