changing all $routeParams with $stateParams

This commit is contained in:
Jared Tabor
2015-12-18 15:12:16 -08:00
parent f61bfa21da
commit ca4687cb99
37 changed files with 289 additions and 344 deletions

View File

@@ -9,7 +9,7 @@
* @name controllers.function:Adhoc * @name controllers.function:Adhoc
* @description This controller controls the adhoc form creation, command launching and navigating to standard out after command has been succesfully ran. * @description This controller controls the adhoc form creation, command launching and navigating to standard out after command has been succesfully ran.
*/ */
function adhocController($q, $scope, $rootScope, $location, $routeParams, function adhocController($q, $scope, $rootScope, $location, $stateParams,
CheckPasswords, PromptForPasswords, CreateLaunchDialog, adhocForm, CheckPasswords, PromptForPasswords, CreateLaunchDialog, adhocForm,
GenerateForm, Rest, ProcessErrors, ClearScope, GetBasePath, GetChoices, GenerateForm, Rest, ProcessErrors, ClearScope, GetBasePath, GetChoices,
KindChange, LookUpInit, CredentialList, Empty, Wait) { KindChange, LookUpInit, CredentialList, Empty, Wait) {
@@ -31,7 +31,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams,
}; };
}; };
var id = $routeParams.inventory_id, var id = $stateParams.inventory_id,
urls = privateFn.setAvailableUrls(), urls = privateFn.setAvailableUrls(),
hostPattern = $rootScope.hostPatterns || "all"; hostPattern = $rootScope.hostPatterns || "all";
@@ -199,7 +199,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams,
// launch the job with the provided form data // launch the job with the provided form data
$scope.launchJob = function () { $scope.launchJob = function () {
var adhocUrl = GetBasePath('inventory') + $routeParams.inventory_id + var adhocUrl = GetBasePath('inventory') + $stateParams.inventory_id +
'/ad_hoc_commands/', fld, data={}, html; '/ad_hoc_commands/', fld, data={}, html;
html = '<form class="ng-valid ng-valid-required" ' + html = '<form class="ng-valid ng-valid-required" ' +
@@ -243,7 +243,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams,
} }
// Launch the adhoc job // Launch the adhoc job
Rest.setUrl(GetBasePath('inventory') + Rest.setUrl(GetBasePath('inventory') +
$routeParams.inventory_id + '/ad_hoc_commands/'); $stateParams.inventory_id + '/ad_hoc_commands/');
Rest.post(data) Rest.post(data)
.success(function (data) { .success(function (data) {
Wait('stop'); Wait('stop');
@@ -310,7 +310,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams,
} }
export default ['$q', '$scope', '$rootScope', '$location', '$routeParams', export default ['$q', '$scope', '$rootScope', '$location', '$stateParams',
'CheckPasswords', 'PromptForPasswords', 'CreateLaunchDialog', 'adhocForm', 'CheckPasswords', 'PromptForPasswords', 'CreateLaunchDialog', 'adhocForm',
'GenerateForm', 'Rest', 'ProcessErrors', 'ClearScope', 'GetBasePath', 'GenerateForm', 'Rest', 'ProcessErrors', 'ClearScope', 'GetBasePath',
'GetChoices', 'KindChange', 'LookUpInit', 'CredentialList', 'Empty', 'Wait', 'GetChoices', 'KindChange', 'LookUpInit', 'CredentialList', 'Empty', 'Wait',

View File

@@ -194,65 +194,11 @@ var tower = angular.module('Tower', [
.config(['$pendolyticsProvider', function($pendolyticsProvider) { .config(['$pendolyticsProvider', function($pendolyticsProvider) {
$pendolyticsProvider.doNotAutoStart(); $pendolyticsProvider.doNotAutoStart();
}]) }])
// .config(['$stateProvider', '$urlRouterProvider',
// function($stateProvider, $urlRouterProvider){
//
// $urlRouterProvider.otherwise("/home");
//
// $stateProvider
// .state('signIn', {
// url: '/login',
// templateUrl: urlPrefix + 'login/loginBackDrop.partial.html',
// controller: ['$rootScope', 'Authorization', function($rootScope, Authorization) {
// if (Authorization.isUserLoggedIn()) {
// Authorization.logout();
// }
// $(".LoginModal-dialog").remove();
// }]
// })
// .state('signOut', {
// url: '/logout',
// templateUrl: urlPrefix + 'partials/blank.html',
// controller: ['Authorization', '$location', function(Authorization, $location) {
// Authorization.logout();
// // $state.go('signIn');
// $location.url('/login');
// }]
// })
// .state('dashboard', {
// url: "/home",
// templateUrl: urlPrefix + "partials/home.html",
// controller: Home,
// resolve: {
// graphData: ['$q', 'jobStatusGraphData', 'FeaturesService', function($q, jobStatusGraphData, FeaturesService) {
// return $q.all({
// jobStatus: jobStatusGraphData.get("month", "all"),
// features: FeaturesService.get()
// });
// }]
// }
// })
// .state('inventories', {
// url: "/inventories",
// templateUrl: urlPrefix + "partials/inventories.html",
// controller: InventoriesList
// })
// .state('inventories.add', {
// url: "/add",
// templateUrl: urlPrefix + "partials/inventory-add.html",
// controller: InventoriesAdd
// })
// .state('inventoriesManage', {
// url: "/inventories/:inventory_id/manage?groups",
// templateUrl: urlPrefix + 'partials/inventory-manage.html',
// controller: InventoriesManage
// });
// }
// ])
.config(['$stateProvider', '$urlRouterProvider', .config(['$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) { function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/home"); $urlRouterProvider.otherwise("/home");
$stateProvider. $stateProvider.
state('jobs', { state('jobs', {
url: '/jobs', url: '/jobs',
@@ -515,7 +461,7 @@ var tower = angular.module('Tower', [
}). }).
state('inventoryManage', { state('inventoryManage', {
url: '/inventories/:inventory_id/manage', url: '/inventories/:inventory_id/manage?groups',
templateUrl: urlPrefix + 'partials/inventory-manage.html', templateUrl: urlPrefix + 'partials/inventory-manage.html',
controller: InventoriesManage, controller: InventoriesManage,
resolve: { resolve: {
@@ -848,7 +794,7 @@ var tower = angular.module('Tower', [
}). }).
state('dashboardHosts', { state('dashboardHosts', {
url: '/home/hosts', url: '/home/hosts?has_active_failures',
templateUrl: urlPrefix + 'partials/subhome.html', templateUrl: urlPrefix + 'partials/subhome.html',
controller: HomeHosts, controller: HomeHosts,
resolve: { resolve: {

View File

@@ -3,7 +3,7 @@
* *
* All Rights Reserved * All Rights Reserved
*************************************************/ *************************************************/
/** /**
* @ngdoc overview * @ngdoc overview
* @name controllers * @name controllers
@@ -21,14 +21,14 @@
*/ */
export function AdminsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, AdminList, GenerateList, LoadBreadCrumbs, export function AdminsList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, AdminList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, GetBasePath, SelectionInit) { Prompt, SearchInit, PaginateInit, ReturnToCaller, GetBasePath, SelectionInit) {
var list = AdminList, var list = AdminList,
defaultUrl = GetBasePath('organizations') + $routeParams.organization_id + '/users/', defaultUrl = GetBasePath('organizations') + $stateParams.organization_id + '/users/',
generator = GenerateList, generator = GenerateList,
mode = 'select', mode = 'select',
url = GetBasePath('organizations') + $routeParams.organization_id + '/admins/'; url = GetBasePath('organizations') + $stateParams.organization_id + '/admins/';
generator.inject(AdminList, { mode: mode, scope: $scope, breadCrumbs: true }); generator.inject(AdminList, { mode: mode, scope: $scope, breadCrumbs: true });
@@ -43,6 +43,6 @@ export function AdminsList($scope, $rootScope, $location, $log, $routeParams, Re
LoadBreadCrumbs(); LoadBreadCrumbs();
} }
AdminsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'AdminList', 'generateList', AdminsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'AdminList', 'generateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'GetBasePath', 'SelectionInit' 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'GetBasePath', 'SelectionInit'
]; ];

View File

@@ -11,7 +11,7 @@
*/ */
export function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList, export function CredentialsList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, CredentialList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath, SelectionInit, GetChoices, Wait, Stream) { ClearScope, ProcessErrors, GetBasePath, SelectionInit, GetChoices, Wait, Stream) {
@@ -26,12 +26,12 @@ export function CredentialsList($scope, $rootScope, $location, $log, $routeParam
mode = (base === 'credentials') ? 'edit' : 'select', mode = (base === 'credentials') ? 'edit' : 'select',
url; url;
view.inject(list, { mode: mode, scope: $scope, breadCrumbs:(($routeParams.user_id || $routeParams.team_id) ? true : false) }); view.inject(list, { mode: mode, scope: $scope, breadCrumbs:(($stateParams.user_id || $stateParams.team_id) ? true : false) });
$scope.selected = []; $scope.selected = [];
$scope.credentialLoading = true; $scope.credentialLoading = true;
url = GetBasePath(base) + ( (base === 'users') ? $routeParams.user_id + '/credentials/' : $routeParams.team_id + '/credentials/' ); url = GetBasePath(base) + ( (base === 'users') ? $stateParams.user_id + '/credentials/' : $stateParams.team_id + '/credentials/' );
if (mode === 'select') { if (mode === 'select') {
SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 }); SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 });
@@ -124,13 +124,13 @@ export function CredentialsList($scope, $rootScope, $location, $log, $routeParam
}; };
} }
CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'CredentialList', 'generateList', CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'CredentialList', 'generateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath',
'SelectionInit', 'GetChoices', 'Wait', 'Stream' 'SelectionInit', 'GetChoices', 'Wait', 'Stream'
]; ];
export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm, GenerateForm, Rest, Alert, export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, CredentialForm, GenerateForm, Rest, Alert,
ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, SearchInit, PaginateInit, LookUpInit, UserList, TeamList, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, SearchInit, PaginateInit, LookUpInit, UserList, TeamList,
GetBasePath, GetChoices, Empty, KindChange, OwnerChange, FormSave) { GetBasePath, GetChoices, Empty, KindChange, OwnerChange, FormSave) {
@@ -165,7 +165,7 @@ export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $r
LookUpInit({ LookUpInit({
scope: $scope, scope: $scope,
form: form, form: form,
current_item: (!Empty($routeParams.user_id)) ? $routeParams.user_id : null, current_item: (!Empty($stateParams.user_id)) ? $stateParams.user_id : null,
list: UserList, list: UserList,
field: 'user', field: 'user',
input_type: 'radio', input_type: 'radio',
@@ -175,19 +175,19 @@ export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $r
LookUpInit({ LookUpInit({
scope: $scope, scope: $scope,
form: form, form: form,
current_item: (!Empty($routeParams.team_id)) ? $routeParams.team_id : null, current_item: (!Empty($stateParams.team_id)) ? $stateParams.team_id : null,
list: TeamList, list: TeamList,
field: 'team', field: 'team',
input_type: 'radio', input_type: 'radio',
autopopulateLookup: false autopopulateLookup: false
}); });
if (!Empty($routeParams.user_id)) { if (!Empty($stateParams.user_id)) {
// Get the username based on incoming route // Get the username based on incoming route
$scope.owner = 'user'; $scope.owner = 'user';
$scope.user = $routeParams.user_id; $scope.user = $stateParams.user_id;
OwnerChange({ scope: $scope }); OwnerChange({ scope: $scope });
url = GetBasePath('users') + $routeParams.user_id + '/'; url = GetBasePath('users') + $stateParams.user_id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.get() Rest.get()
.success(function (data) { .success(function (data) {
@@ -196,12 +196,12 @@ export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $r
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user. GET status: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user. GET status: ' + status });
}); });
} else if (!Empty($routeParams.team_id)) { } else if (!Empty($stateParams.team_id)) {
// Get the username based on incoming route // Get the username based on incoming route
$scope.owner = 'team'; $scope.owner = 'team';
$scope.team = $routeParams.team_id; $scope.team = $stateParams.team_id;
OwnerChange({ scope: $scope }); OwnerChange({ scope: $scope });
url = GetBasePath('teams') + $routeParams.team_id + '/'; url = GetBasePath('teams') + $stateParams.team_id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.get() Rest.get()
.success(function (data) { .success(function (data) {
@@ -293,13 +293,13 @@ export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $r
} }
CredentialsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'CredentialForm', 'GenerateForm', CredentialsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'CredentialForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'SearchInit', 'PaginateInit', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'SearchInit', 'PaginateInit',
'LookUpInit', 'UserList', 'TeamList', 'GetBasePath', 'GetChoices', 'Empty', 'KindChange', 'OwnerChange', 'FormSave' 'LookUpInit', 'UserList', 'TeamList', 'GetBasePath', 'GetChoices', 'Empty', 'KindChange', 'OwnerChange', 'FormSave'
]; ];
export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm, GenerateForm, Rest, Alert, export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, CredentialForm, GenerateForm, Rest, Alert,
ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt, GetBasePath, GetChoices, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt, GetBasePath, GetChoices,
KindChange, UserList, TeamList, LookUpInit, Empty, OwnerChange, FormSave, Stream, Wait) { KindChange, UserList, TeamList, LookUpInit, Empty, OwnerChange, FormSave, Stream, Wait) {
@@ -310,7 +310,7 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $
form = CredentialForm, form = CredentialForm,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}, master = {},
id = $routeParams.credential_id; id = $stateParams.credential_id;
generator.inject(form, { mode: 'edit', related: true, scope: $scope }); generator.inject(form, { mode: 'edit', related: true, scope: $scope });
generator.reset(); generator.reset();
@@ -473,7 +473,7 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to retrieve Credential: ' + $routeParams.id + '. GET status: ' + status }); msg: 'Failed to retrieve Credential: ' + $stateParams.id + '. GET status: ' + status });
}); });
}); });
@@ -530,13 +530,13 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $
// Related set: Add button // Related set: Add button
$scope.add = function (set) { $scope.add = function (set) {
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
$location.path('/' + base + '/' + $routeParams.id + '/' + set + '/add'); $location.path('/' + base + '/' + $stateParams.id + '/' + set + '/add');
}; };
// Related set: Edit button // Related set: Edit button
$scope.edit = function (set, id) { $scope.edit = function (set, id) {
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
$location.path('/' + base + '/' + $routeParams.id + '/' + set + '/' + id); $location.path('/' + base + '/' + $stateParams.id + '/' + set + '/' + id);
}; };
// Related set: Delete button // Related set: Delete button
@@ -611,7 +611,7 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $
} }
CredentialsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'CredentialForm', CredentialsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'CredentialForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit',
'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'GetChoices', 'KindChange', 'UserList', 'TeamList', 'LookUpInit', 'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'GetChoices', 'KindChange', 'UserList', 'TeamList', 'LookUpInit',
'Empty', 'OwnerChange', 'FormSave', 'Stream', 'Wait' 'Empty', 'OwnerChange', 'FormSave', 'Stream', 'Wait'

View File

@@ -21,7 +21,7 @@
* *
*/ */
export function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, export function Home($scope, $compile, $stateParams, $rootScope, $location, $log, Wait,
ClearScope, Stream, Rest, GetBasePath, ProcessErrors, $window, graphData){ ClearScope, Stream, Rest, GetBasePath, ProcessErrors, $window, graphData){
ClearScope('home'); ClearScope('home');
@@ -144,7 +144,7 @@ export function Home($scope, $compile, $routeParams, $rootScope, $location, $log
$scope.refresh(); $scope.refresh();
} }
Home.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location', '$log','Wait', Home.$inject = ['$scope', '$compile', '$stateParams', '$rootScope', '$location', '$log','Wait',
'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', '$window', 'graphData' 'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', '$window', 'graphData'
]; ];
@@ -156,7 +156,7 @@ Home.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location',
* @description This controls the 'home/groups' page that is loaded from the dashboard * @description This controls the 'home/groups' page that is loaded from the dashboard
* *
*/ */
export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $location, $routeParams, LogViewer, HomeGroupList, GenerateList, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $location, $stateParams, LogViewer, HomeGroupList, GenerateList, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
GetBasePath, SearchInit, PaginateInit, FormatDate, GetHostsStatusMsg, GetSyncStatusMsg, ViewUpdateStatus, Stream, GroupsEdit, Wait, GetBasePath, SearchInit, PaginateInit, FormatDate, GetHostsStatusMsg, GetSyncStatusMsg, ViewUpdateStatus, Stream, GroupsEdit, Wait,
Alert, Rest, Empty, InventoryUpdate, Find, GroupsCancelUpdate, Store) { Alert, Rest, Empty, InventoryUpdate, Find, GroupsCancelUpdate, Store) {
@@ -257,31 +257,31 @@ export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $locatio
}); });
// Process search params // Process search params
if ($routeParams.name) { if ($stateParams.name) {
scope[list.iterator + 'InputDisable'] = false; scope[list.iterator + 'InputDisable'] = false;
scope[list.iterator + 'SearchValue'] = $routeParams.name; scope[list.iterator + 'SearchValue'] = $stateParams.name;
scope[list.iterator + 'SearchField'] = 'name'; scope[list.iterator + 'SearchField'] = 'name';
scope[list.iterator + 'SearchFieldLabel'] = list.fields.name.label; scope[list.iterator + 'SearchFieldLabel'] = list.fields.name.label;
scope[list.iterator + 'SearchSelectValue'] = null; scope[list.iterator + 'SearchSelectValue'] = null;
} }
if ($routeParams.id) { if ($stateParams.id) {
scope[list.iterator + 'InputDisable'] = false; scope[list.iterator + 'InputDisable'] = false;
scope[list.iterator + 'SearchValue'] = $routeParams.id; scope[list.iterator + 'SearchValue'] = $stateParams.id;
scope[list.iterator + 'SearchField'] = 'id'; scope[list.iterator + 'SearchField'] = 'id';
scope[list.iterator + 'SearchFieldLabel'] = list.fields.id.label; scope[list.iterator + 'SearchFieldLabel'] = list.fields.id.label;
scope[list.iterator + 'SearchSelectValue'] = null; scope[list.iterator + 'SearchSelectValue'] = null;
} }
if ($routeParams.has_active_failures) { if ($stateParams.has_active_failures) {
scope[list.iterator + 'InputDisable'] = true; scope[list.iterator + 'InputDisable'] = true;
scope[list.iterator + 'SearchValue'] = $routeParams.has_active_failures; scope[list.iterator + 'SearchValue'] = $stateParams.has_active_failures;
scope[list.iterator + 'SearchField'] = 'has_active_failures'; scope[list.iterator + 'SearchField'] = 'has_active_failures';
scope[list.iterator + 'SearchFieldLabel'] = list.fields.has_active_failures.label; scope[list.iterator + 'SearchFieldLabel'] = list.fields.has_active_failures.label;
scope[list.iterator + 'SearchSelectValue'] = ($routeParams.has_active_failures === 'true') ? { value: 1 } : { value: 0 }; scope[list.iterator + 'SearchSelectValue'] = ($stateParams.has_active_failures === 'true') ? { value: 1 } : { value: 0 };
} }
if ($routeParams.status && !$routeParams.source) { if ($stateParams.status && !$stateParams.source) {
scope[list.iterator + 'SearchField'] = 'last_update_failed'; scope[list.iterator + 'SearchField'] = 'last_update_failed';
scope[list.iterator + 'SearchFieldLabel'] = list.fields.last_update_failed.label; scope[list.iterator + 'SearchFieldLabel'] = list.fields.last_update_failed.label;
scope[list.iterator + 'SelectShow'] = false; scope[list.iterator + 'SelectShow'] = false;
@@ -292,31 +292,31 @@ export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $locatio
//scope[list.iterator + 'SearchSelectOpts'] = list.fields.status.searchOptions; //scope[list.iterator + 'SearchSelectOpts'] = list.fields.status.searchOptions;
//scope[list.iterator + 'SearchFieldLabel'] = list.fields.status.label.replace(/<br\>/g, ' '); //scope[list.iterator + 'SearchFieldLabel'] = list.fields.status.label.replace(/<br\>/g, ' ');
//for (opt in list.fields.status.searchOptions) { //for (opt in list.fields.status.searchOptions) {
// if (list.fields.status.searchOptions[opt].value === $routeParams.status) { // if (list.fields.status.searchOptions[opt].value === $stateParams.status) {
// scope[list.iterator + 'SearchSelectValue'] = list.fields.status.searchOptions[opt]; // scope[list.iterator + 'SearchSelectValue'] = list.fields.status.searchOptions[opt];
// break; // break;
// } // }
//} //}
} }
if ($routeParams.source) { if ($stateParams.source) {
scope[list.iterator + 'SearchField'] = 'source'; scope[list.iterator + 'SearchField'] = 'source';
scope[list.iterator + 'SelectShow'] = true; scope[list.iterator + 'SelectShow'] = true;
scope[list.iterator + 'SearchSelectOpts'] = list.fields.source.searchOptions; scope[list.iterator + 'SearchSelectOpts'] = list.fields.source.searchOptions;
scope[list.iterator + 'SearchFieldLabel'] = list.fields.source.label.replace(/<br\>/g, ' '); scope[list.iterator + 'SearchFieldLabel'] = list.fields.source.label.replace(/<br\>/g, ' ');
for (opt in list.fields.source.searchOptions) { for (opt in list.fields.source.searchOptions) {
if (list.fields.source.searchOptions[opt].value === $routeParams.source) { if (list.fields.source.searchOptions[opt].value === $stateParams.source) {
scope[list.iterator + 'SearchSelectValue'] = list.fields.source.searchOptions[opt]; scope[list.iterator + 'SearchSelectValue'] = list.fields.source.searchOptions[opt];
break; break;
} }
} }
if ($routeParams.status) { if ($stateParams.status) {
scope[list.iterator + 'ExtraParms'] = 'inventory_source__status__icontains=' + $routeParams.status; scope[list.iterator + 'ExtraParms'] = 'inventory_source__status__icontains=' + $stateParams.status;
} }
} }
if ($routeParams.has_external_source) { if ($stateParams.has_external_source) {
scope[list.iterator + 'SearchField'] = 'has_external_source'; scope[list.iterator + 'SearchField'] = 'has_external_source';
scope[list.iterator + 'SearchValue'] = list.fields.has_external_source.searchValue; scope[list.iterator + 'SearchValue'] = list.fields.has_external_source.searchValue;
scope[list.iterator + 'InputDisable'] = true; scope[list.iterator + 'InputDisable'] = true;
@@ -324,9 +324,9 @@ export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $locatio
scope[list.iterator + 'SearchFieldLabel'] = list.fields.has_external_source.label; scope[list.iterator + 'SearchFieldLabel'] = list.fields.has_external_source.label;
} }
if ($routeParams.inventory_source__id) { if ($stateParams.inventory_source__id) {
scope[list.iterator + 'SearchField'] = 'inventory_source'; scope[list.iterator + 'SearchField'] = 'inventory_source';
scope[list.iterator + 'SearchValue'] = $routeParams.inventory_source__id; scope[list.iterator + 'SearchValue'] = $stateParams.inventory_source__id;
scope[list.iterator + 'SearchFieldLabel'] = 'Source ID'; scope[list.iterator + 'SearchFieldLabel'] = 'Source ID';
} }
@@ -579,7 +579,7 @@ export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $locatio
} }
HomeGroups.$inject = ['$rootScope', '$log', '$scope', '$filter', '$compile', '$location', '$routeParams', 'LogViewer', 'HomeGroupList', 'generateList', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', HomeGroups.$inject = ['$rootScope', '$log', '$scope', '$filter', '$compile', '$location', '$stateParams', 'LogViewer', 'HomeGroupList', 'generateList', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller',
'ClearScope', 'GetBasePath', 'SearchInit', 'PaginateInit', 'FormatDate', 'GetHostsStatusMsg', 'GetSyncStatusMsg', 'ViewUpdateStatus', 'ClearScope', 'GetBasePath', 'SearchInit', 'PaginateInit', 'FormatDate', 'GetHostsStatusMsg', 'GetSyncStatusMsg', 'ViewUpdateStatus',
'Stream', 'GroupsEdit', 'Wait', 'Alert', 'Rest', 'Empty', 'InventoryUpdate', 'Find', 'GroupsCancelUpdate', 'Store', 'Socket' 'Stream', 'GroupsEdit', 'Wait', 'Alert', 'Rest', 'Empty', 'InventoryUpdate', 'Find', 'GroupsCancelUpdate', 'Store', 'Socket'
]; ];
@@ -592,7 +592,7 @@ HomeGroups.$inject = ['$rootScope', '$log', '$scope', '$filter', '$compile', '$l
* *
*/ */
export function HomeHosts($scope, $location, $routeParams, HomeHostList, GenerateList, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, export function HomeHosts($scope, $location, $stateParams, HomeHostList, GenerateList, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
GetBasePath, SearchInit, PaginateInit, FormatDate, SetStatus, ToggleHostEnabled, HostsEdit, Stream, Find, ShowJobSummary, ViewJob) { GetBasePath, SearchInit, PaginateInit, FormatDate, SetStatus, ToggleHostEnabled, HostsEdit, Stream, Find, ShowJobSummary, ViewJob) {
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
@@ -633,27 +633,27 @@ export function HomeHosts($scope, $location, $routeParams, HomeHostList, Generat
}); });
// Process search params // Process search params
if ($routeParams.name) { if ($stateParams.name) {
$scope[HomeHostList.iterator + 'InputDisable'] = false; $scope[HomeHostList.iterator + 'InputDisable'] = false;
$scope[HomeHostList.iterator + 'SearchValue'] = $routeParams.name; $scope[HomeHostList.iterator + 'SearchValue'] = $stateParams.name;
$scope[HomeHostList.iterator + 'SearchField'] = 'name'; $scope[HomeHostList.iterator + 'SearchField'] = 'name';
$scope[HomeHostList.iterator + 'SearchFieldLabel'] = list.fields.name.label; $scope[HomeHostList.iterator + 'SearchFieldLabel'] = list.fields.name.label;
} }
if ($routeParams.id) { if ($stateParams.id) {
$scope[HomeHostList.iterator + 'InputDisable'] = false; $scope[HomeHostList.iterator + 'InputDisable'] = false;
$scope[HomeHostList.iterator + 'SearchValue'] = $routeParams.id; $scope[HomeHostList.iterator + 'SearchValue'] = $stateParams.id;
$scope[HomeHostList.iterator + 'SearchField'] = 'id'; $scope[HomeHostList.iterator + 'SearchField'] = 'id';
$scope[HomeHostList.iterator + 'SearchFieldLabel'] = list.fields.id.label; $scope[HomeHostList.iterator + 'SearchFieldLabel'] = list.fields.id.label;
$scope[HomeHostList.iterator + 'SearchSelectValue'] = null; $scope[HomeHostList.iterator + 'SearchSelectValue'] = null;
} }
if ($routeParams.has_active_failures) { if ($stateParams.has_active_failures) {
$scope[HomeHostList.iterator + 'InputDisable'] = true; $scope[HomeHostList.iterator + 'InputDisable'] = true;
$scope[HomeHostList.iterator + 'SearchValue'] = $routeParams.has_active_failures; $scope[HomeHostList.iterator + 'SearchValue'] = $stateParams.has_active_failures;
$scope[HomeHostList.iterator + 'SearchField'] = 'has_active_failures'; $scope[HomeHostList.iterator + 'SearchField'] = 'has_active_failures';
$scope[HomeHostList.iterator + 'SearchFieldLabel'] = HomeHostList.fields.has_active_failures.label; $scope[HomeHostList.iterator + 'SearchFieldLabel'] = HomeHostList.fields.has_active_failures.label;
$scope[HomeHostList.iterator + 'SearchSelectValue'] = ($routeParams.has_active_failures === 'true') ? { value: 1 } : { value: 0 }; $scope[HomeHostList.iterator + 'SearchSelectValue'] = ($stateParams.has_active_failures === 'true') ? { value: 1 } : { value: 0 };
} }
$scope.search(list.iterator); $scope.search(list.iterator);
@@ -708,7 +708,7 @@ export function HomeHosts($scope, $location, $routeParams, HomeHostList, Generat
} }
HomeHosts.$inject = ['$scope', '$location', '$routeParams', 'HomeHostList', 'generateList', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', HomeHosts.$inject = ['$scope', '$location', '$stateParams', 'HomeHostList', 'generateList', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller',
'ClearScope', 'GetBasePath', 'SearchInit', 'PaginateInit', 'FormatDate', 'SetStatus', 'ToggleHostEnabled', 'HostsEdit', 'Stream', 'ClearScope', 'GetBasePath', 'SearchInit', 'PaginateInit', 'FormatDate', 'SetStatus', 'ToggleHostEnabled', 'HostsEdit', 'Stream',
'Find', 'ShowJobSummary', 'ViewJob' 'Find', 'ShowJobSummary', 'ViewJob'
]; ];

View File

@@ -13,7 +13,7 @@
import '../job-templates/main'; import '../job-templates/main';
export function InventoriesList($scope, $rootScope, $location, $log, export function InventoriesList($scope, $rootScope, $location, $log,
$routeParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList, generateList, $stateParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList, generateList,
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath, Wait, Stream, ClearScope, ProcessErrors, GetBasePath, Wait, Stream,
EditInventoryProperties, Find, Empty, LogViewer, $state) { EditInventoryProperties, Find, Empty, LogViewer, $state) {
@@ -80,42 +80,42 @@ export function InventoriesList($scope, $rootScope, $location, $log,
url: defaultUrl url: defaultUrl
}); });
if ($routeParams.name) { if ($stateParams.name) {
$scope[InventoryList.iterator + 'InputDisable'] = false; $scope[InventoryList.iterator + 'InputDisable'] = false;
$scope[InventoryList.iterator + 'SearchValue'] = $routeParams.name; $scope[InventoryList.iterator + 'SearchValue'] = $stateParams.name;
$scope[InventoryList.iterator + 'SearchField'] = 'name'; $scope[InventoryList.iterator + 'SearchField'] = 'name';
$scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.name.label; $scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.name.label;
$scope[InventoryList.iterator + 'SearchSelectValue'] = null; $scope[InventoryList.iterator + 'SearchSelectValue'] = null;
} }
if ($routeParams.has_active_failures) { if ($stateParams.has_active_failures) {
$scope[InventoryList.iterator + 'InputDisable'] = true; $scope[InventoryList.iterator + 'InputDisable'] = true;
$scope[InventoryList.iterator + 'SearchValue'] = $routeParams.has_active_failures; $scope[InventoryList.iterator + 'SearchValue'] = $stateParams.has_active_failures;
$scope[InventoryList.iterator + 'SearchField'] = 'has_active_failures'; $scope[InventoryList.iterator + 'SearchField'] = 'has_active_failures';
$scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.has_active_failures.label; $scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.has_active_failures.label;
$scope[InventoryList.iterator + 'SearchSelectValue'] = ($routeParams.has_active_failures === 'true') ? { $scope[InventoryList.iterator + 'SearchSelectValue'] = ($stateParams.has_active_failures === 'true') ? {
value: 1 value: 1
} : { } : {
value: 0 value: 0
}; };
} }
if ($routeParams.has_inventory_sources) { if ($stateParams.has_inventory_sources) {
$scope[InventoryList.iterator + 'InputDisable'] = true; $scope[InventoryList.iterator + 'InputDisable'] = true;
$scope[InventoryList.iterator + 'SearchValue'] = $routeParams.has_inventory_sources; $scope[InventoryList.iterator + 'SearchValue'] = $stateParams.has_inventory_sources;
$scope[InventoryList.iterator + 'SearchField'] = 'has_inventory_sources'; $scope[InventoryList.iterator + 'SearchField'] = 'has_inventory_sources';
$scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.has_inventory_sources.label; $scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.has_inventory_sources.label;
$scope[InventoryList.iterator + 'SearchSelectValue'] = ($routeParams.has_inventory_sources === 'true') ? { $scope[InventoryList.iterator + 'SearchSelectValue'] = ($stateParams.has_inventory_sources === 'true') ? {
value: 1 value: 1
} : { } : {
value: 0 value: 0
}; };
} }
if ($routeParams.inventory_sources_with_failures) { if ($stateParams.inventory_sources_with_failures) {
// pass a value of true, however this field actually contains an integer value // pass a value of true, however this field actually contains an integer value
$scope[InventoryList.iterator + 'InputDisable'] = true; $scope[InventoryList.iterator + 'InputDisable'] = true;
$scope[InventoryList.iterator + 'SearchValue'] = $routeParams.inventory_sources_with_failures; $scope[InventoryList.iterator + 'SearchValue'] = $stateParams.inventory_sources_with_failures;
$scope[InventoryList.iterator + 'SearchField'] = 'inventory_sources_with_failures'; $scope[InventoryList.iterator + 'SearchField'] = 'inventory_sources_with_failures';
$scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.inventory_sources_with_failures.label; $scope[InventoryList.iterator + 'SearchFieldLabel'] = InventoryList.fields.inventory_sources_with_failures.label;
$scope[InventoryList.iterator + 'SearchType'] = 'gtzero'; $scope[InventoryList.iterator + 'SearchType'] = 'gtzero';
@@ -368,13 +368,13 @@ export function InventoriesList($scope, $rootScope, $location, $log,
}; };
} }
InventoriesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', '$compile', '$filter', 'sanitizeFilter', 'Rest', 'Alert', 'InventoryList', 'generateList', InventoriesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', '$compile', '$filter', 'sanitizeFilter', 'Rest', 'Alert', 'InventoryList', 'generateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'Wait', 'Stream', 'EditInventoryProperties', 'Find', 'Empty', 'LogViewer', '$state' 'GetBasePath', 'Wait', 'Stream', 'EditInventoryProperties', 'Find', 'Empty', 'LogViewer', '$state'
]; ];
export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest, export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $stateParams, InventoryForm, GenerateForm, Rest,
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit,
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON) { LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON) {
@@ -405,7 +405,7 @@ export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $r
LookUpInit({ LookUpInit({
scope: $scope, scope: $scope,
form: form, form: form,
current_item: ($routeParams.organization_id) ? $routeParams.organization_id : null, current_item: ($stateParams.organization_id) ? $stateParams.organization_id : null,
list: OrganizationList, list: OrganizationList,
field: 'organization', field: 'organization',
input_type: 'radio' input_type: 'radio'
@@ -453,12 +453,12 @@ export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $r
}; };
} }
InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm', InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'InventoryForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit',
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON' 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON'
]; ];
export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest, export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $stateParams, InventoryForm, GenerateForm, Rest,
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit,
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, RelatedSearchInit, RelatedPaginateInit, LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, RelatedSearchInit, RelatedPaginateInit,
Prompt, PlaybookRun, CreateDialog, deleteJobTemplate) { Prompt, PlaybookRun, CreateDialog, deleteJobTemplate) {
@@ -469,7 +469,7 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $
var defaultUrl = GetBasePath('inventory'), var defaultUrl = GetBasePath('inventory'),
form = InventoryForm(), form = InventoryForm(),
generator = GenerateForm, generator = GenerateForm,
inventory_id = $routeParams.inventory_id, inventory_id = $stateParams.inventory_id,
master = {}, master = {},
fld, json_data, data, fld, json_data, data,
relatedSets = {}; relatedSets = {};
@@ -784,7 +784,7 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $
} }
InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm', InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'InventoryForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit',
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'RelatedSearchInit', 'RelatedPaginateInit', 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'RelatedSearchInit', 'RelatedPaginateInit',
'Prompt', 'PlaybookRun', 'CreateDialog', 'deleteJobTemplate' 'Prompt', 'PlaybookRun', 'CreateDialog', 'deleteJobTemplate'
@@ -1049,7 +1049,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
$scope.$emit('InventoryLoaded'); $scope.$emit('InventoryLoaded');
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve inventory: ' + $routeParams.inventory_id + ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve inventory: ' + $stateParams.inventory_id +
' GET returned status: ' + status }); ' GET returned status: ' + status });
}); });
@@ -1139,7 +1139,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
} }
groups.push(group.id); groups.push(group.id);
groups = groups.join(); groups = groups.join();
$state.transitionTo('inventoriesManage', {inventory_id: $state.params.inventory_id, groups: groups}, { notify: false }); $state.transitionTo('inventoryManage', {inventory_id: $state.params.inventory_id, groups: groups}, { notify: false });
$scope.group_breadcrumbs.push(group); $scope.group_breadcrumbs.push(group);
setActiveGroupBreadcrumb(); setActiveGroupBreadcrumb();
loadGroups(group.related.children, group.id); loadGroups(group.related.children, group.id);

View File

@@ -11,13 +11,13 @@
*/ */
export function JobDetailController ($location, $rootScope, $filter, $scope, $compile, $routeParams, $log, ClearScope, Breadcrumbs, LoadBreadCrumbs, GetBasePath, Wait, Rest, export function JobDetailController ($location, $rootScope, $filter, $scope, $compile, $stateParams, $log, ClearScope, Breadcrumbs, LoadBreadCrumbs, GetBasePath, Wait, Rest,
ProcessErrors, SelectPlay, SelectTask, Socket, GetElapsed, DrawGraph, LoadHostSummary, ReloadHostSummaryList, JobIsFinished, SetTaskStyles, DigestEvent, ProcessErrors, SelectPlay, SelectTask, Socket, GetElapsed, DrawGraph, LoadHostSummary, ReloadHostSummaryList, JobIsFinished, SetTaskStyles, DigestEvent,
UpdateDOM, EventViewer, DeleteJob, PlaybookRun, HostEventsViewer, LoadPlays, LoadTasks, LoadHosts, HostsEdit, ParseVariableString, GetChoices, fieldChoices, fieldLabels, EditSchedule) { UpdateDOM, EventViewer, DeleteJob, PlaybookRun, HostEventsViewer, LoadPlays, LoadTasks, LoadHosts, HostsEdit, ParseVariableString, GetChoices, fieldChoices, fieldLabels, EditSchedule) {
ClearScope(); ClearScope();
var job_id = $routeParams.id, var job_id = $stateParams.id,
scope = $scope, scope = $scope,
api_complete = false, api_complete = false,
refresh_count = 0, refresh_count = 0,
@@ -793,7 +793,7 @@ export function JobDetailController ($location, $rootScope, $filter, $scope, $co
}) })
.error(function(data, status) { .error(function(data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve job: ' + $routeParams.id + '. GET returned: ' + status }); msg: 'Failed to retrieve job: ' + $stateParams.id + '. GET returned: ' + status });
}); });
}); });
@@ -1435,7 +1435,7 @@ export function JobDetailController ($location, $rootScope, $filter, $scope, $co
}); });
} }
JobDetailController.$inject = [ '$location', '$rootScope', '$filter', '$scope', '$compile', '$routeParams', '$log', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'GetBasePath', JobDetailController.$inject = [ '$location', '$rootScope', '$filter', '$scope', '$compile', '$stateParams', '$log', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'GetBasePath',
'Wait', 'Rest', 'ProcessErrors', 'SelectPlay', 'SelectTask', 'Socket', 'GetElapsed', 'DrawGraph', 'LoadHostSummary', 'ReloadHostSummaryList', 'Wait', 'Rest', 'ProcessErrors', 'SelectPlay', 'SelectTask', 'Socket', 'GetElapsed', 'DrawGraph', 'LoadHostSummary', 'ReloadHostSummaryList',
'JobIsFinished', 'SetTaskStyles', 'DigestEvent', 'UpdateDOM', 'EventViewer', 'DeleteJob', 'PlaybookRun', 'HostEventsViewer', 'LoadPlays', 'LoadTasks', 'JobIsFinished', 'SetTaskStyles', 'DigestEvent', 'UpdateDOM', 'EventViewer', 'DeleteJob', 'PlaybookRun', 'HostEventsViewer', 'LoadPlays', 'LoadTasks',
'LoadHosts', 'HostsEdit', 'ParseVariableString', 'GetChoices', 'fieldChoices', 'fieldLabels', 'EditSchedule' 'LoadHosts', 'HostsEdit', 'ParseVariableString', 'GetChoices', 'fieldChoices', 'fieldLabels', 'EditSchedule'

View File

@@ -11,19 +11,19 @@
*/ */
export function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobEventList, GenerateList, export function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log, $stateParams, Rest, Alert, JobEventList, GenerateList,
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, LookUpInit, ToggleChildren, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, LookUpInit, ToggleChildren,
FormatDate, EventView, Refresh, Wait) { FormatDate, EventView, Refresh, Wait) {
ClearScope(); ClearScope();
var list = JobEventList, var list = JobEventList,
defaultUrl = GetBasePath('jobs') + $routeParams.id + '/job_events/', //?parent__isnull=1'; defaultUrl = GetBasePath('jobs') + $stateParams.id + '/job_events/', //?parent__isnull=1';
generator = GenerateList, generator = GenerateList,
page; page;
list.base = $location.path(); list.base = $location.path();
$scope.job_id = $routeParams.id; $scope.job_id = $stateParams.id;
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
$scope.selected = []; $scope.selected = [];
$scope.expand = true; //on load, automatically expand all nodes $scope.expand = true; //on load, automatically expand all nodes
@@ -207,7 +207,7 @@ export function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log
url: defaultUrl url: defaultUrl
}); });
page = ($routeParams.page) ? parseInt($routeParams.page,10) - 1 : null; page = ($stateParams.page) ? parseInt($stateParams.page,10) - 1 : null;
PaginateInit({ PaginateInit({
scope: $scope, scope: $scope,
@@ -217,13 +217,13 @@ export function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log
}); });
// Called from Inventories tab, host failed events link: // Called from Inventories tab, host failed events link:
if ($routeParams.host) { if ($stateParams.host) {
$scope[list.iterator + 'SearchField'] = 'host'; $scope[list.iterator + 'SearchField'] = 'host';
$scope[list.iterator + 'SearchValue'] = $routeParams.host; $scope[list.iterator + 'SearchValue'] = $stateParams.host;
$scope[list.iterator + 'SearchFieldLabel'] = list.fields.host.label; $scope[list.iterator + 'SearchFieldLabel'] = list.fields.host.label;
} }
$scope.search(list.iterator, $routeParams.page); $scope.search(list.iterator, $stateParams.page);
$scope.toggle = function (id) { $scope.toggle = function (id) {
ToggleChildren({ ToggleChildren({
@@ -252,19 +252,19 @@ export function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log
}; };
} }
JobEventsList.$inject = ['$sce', '$filter', '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventList', JobEventsList.$inject = ['$sce', '$filter', '$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'JobEventList',
'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'LookUpInit', 'ToggleChildren', 'FormatDate', 'EventView', 'Refresh', 'Wait' 'GetBasePath', 'LookUpInit', 'ToggleChildren', 'FormatDate', 'EventView', 'Refresh', 'Wait'
]; ];
export function JobEventsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, JobEventsForm, GenerateForm, export function JobEventsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, JobEventsForm, GenerateForm,
Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, FormatDate, EventView, Wait) { Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, FormatDate, EventView, Wait) {
ClearScope(); ClearScope();
var form = JobEventsForm, var form = JobEventsForm,
generator = GenerateForm, generator = GenerateForm,
defaultUrl = GetBasePath('base') + 'job_events/' + $routeParams.event_id + '/'; defaultUrl = GetBasePath('base') + 'job_events/' + $stateParams.event_id + '/';
generator.inject(form, { mode: 'edit', related: true, scope: $scope}); generator.inject(form, { mode: 'edit', related: true, scope: $scope});
generator.reset(); generator.reset();
@@ -276,7 +276,7 @@ export function JobEventsEdit($scope, $rootScope, $compile, $location, $log, $ro
.success(function (data) { .success(function (data) {
var cDate, fld, n, rows; var cDate, fld, n, rows;
$scope.event_display = data.event_display.replace(/^\u00a0*/g, ''); $scope.event_display = data.event_display.replace(/^\u00a0*/g, '');
LoadBreadCrumbs({ path: '/jobs/' + $routeParams.job_id + '/job_events/' + $routeParams.event_id, title: $scope.event_display }); LoadBreadCrumbs({ path: '/jobs/' + $stateParams.job_id + '/job_events/' + $stateParams.event_id, title: $scope.event_display });
for (fld in form.fields) { for (fld in form.fields) {
switch (fld) { switch (fld) {
case 'status': case 'status':
@@ -335,14 +335,14 @@ export function JobEventsEdit($scope, $rootScope, $compile, $location, $log, $ro
Wait('stop'); Wait('stop');
}) })
.error(function (data) { .error(function (data) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve host: ' + $routeParams.event_id + ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve host: ' + $stateParams.event_id +
'. GET status: ' + status }); '. GET status: ' + status });
}); });
$scope.navigateBack = function () { $scope.navigateBack = function () {
var url = '/jobs/' + $routeParams.job_id + '/job_events'; var url = '/jobs/' + $stateParams.job_id + '/job_events';
if ($routeParams.page) { if ($stateParams.page) {
url += '?page=' + $routeParams.page; url += '?page=' + $stateParams.page;
} }
$location.url(url); $location.url(url);
}; };
@@ -355,6 +355,6 @@ export function JobEventsEdit($scope, $rootScope, $compile, $location, $log, $ro
} }
JobEventsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobEventsForm', 'GenerateForm', JobEventsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'JobEventsForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'FormatDate', 'EventView', 'Wait' 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'FormatDate', 'EventView', 'Wait'
]; ];

View File

@@ -11,18 +11,18 @@
*/ */
export function JobHostSummaryList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobHostList, GenerateList, export function JobHostSummaryList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, JobHostList, GenerateList,
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Refresh, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Refresh,
JobStatusToolTip) { JobStatusToolTip) {
ClearScope(); ClearScope();
var list = JobHostList, var list = JobHostList,
defaultUrl = GetBasePath('jobs') + $routeParams.id + '/job_host_summaries/', defaultUrl = GetBasePath('jobs') + $stateParams.id + '/job_host_summaries/',
view = GenerateList, view = GenerateList,
inventory; inventory;
$scope.job_id = $routeParams.id; $scope.job_id = $stateParams.id;
$scope.host_id = null; $scope.host_id = null;
// After a refresh, populate any needed summary field values on each row // After a refresh, populate any needed summary field values on each row
@@ -72,9 +72,9 @@ export function JobHostSummaryList($scope, $rootScope, $location, $log, $routePa
}); });
// Called from Inventories tab, host failed events link: // Called from Inventories tab, host failed events link:
if ($routeParams.host_name) { if ($stateParams.host_name) {
$scope[list.iterator + 'SearchField'] = 'host'; $scope[list.iterator + 'SearchField'] = 'host';
$scope[list.iterator + 'SearchValue'] = $routeParams.host_name; $scope[list.iterator + 'SearchValue'] = $stateParams.host_name;
$scope[list.iterator + 'SearchFieldLabel'] = list.fields.host.label; $scope[list.iterator + 'SearchFieldLabel'] = list.fields.host.label;
} }
$scope.search(list.iterator); $scope.search(list.iterator);
@@ -121,7 +121,7 @@ export function JobHostSummaryList($scope, $rootScope, $location, $log, $routePa
} }
JobHostSummaryList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobHostList', JobHostSummaryList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'JobHostList',
'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'Refresh', 'JobStatusToolTip', 'Wait' 'GetBasePath', 'Refresh', 'JobStatusToolTip', 'Wait'
]; ];

View File

@@ -11,11 +11,11 @@
*/ */
export function JobStdoutController ($location, $log, $rootScope, $scope, $compile, $routeParams, ClearScope, GetBasePath, Wait, Rest, ProcessErrors) { export function JobStdoutController ($location, $log, $rootScope, $scope, $compile, $stateParams, ClearScope, GetBasePath, Wait, Rest, ProcessErrors) {
ClearScope(); ClearScope();
var job_id = $routeParams.id, var job_id = $stateParams.id,
api_complete = false, api_complete = false,
stdout_url, stdout_url,
current_range, current_range,
@@ -281,4 +281,4 @@ export function JobStdoutController ($location, $log, $rootScope, $scope, $compi
} }
JobStdoutController.$inject = [ '$location', '$log', '$rootScope', '$scope', '$compile', '$routeParams', 'ClearScope', 'GetBasePath', 'Wait', 'Rest', 'ProcessErrors']; JobStdoutController.$inject = [ '$location', '$log', '$rootScope', '$scope', '$compile', '$stateParams', 'ClearScope', 'GetBasePath', 'Wait', 'Rest', 'ProcessErrors'];

View File

@@ -11,7 +11,7 @@
*/ */
export function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobTemplateList, export function JobTemplatesList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, JobTemplateList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,
GetBasePath, JobTemplateForm, CredentialList, LookUpInit, PlaybookRun, Wait, Stream, CreateDialog, $compile) { GetBasePath, JobTemplateForm, CredentialList, LookUpInit, PlaybookRun, Wait, Stream, CreateDialog, $compile) {
@@ -48,9 +48,9 @@ export function JobTemplatesList($scope, $rootScope, $location, $log, $routePara
}); });
// Called from Inventories tab, host failed events link: // Called from Inventories tab, host failed events link:
if ($routeParams.name) { if ($stateParams.name) {
$scope[list.iterator + 'SearchField'] = 'name'; $scope[list.iterator + 'SearchField'] = 'name';
$scope[list.iterator + 'SearchValue'] = $routeParams.name; $scope[list.iterator + 'SearchValue'] = $stateParams.name;
$scope[list.iterator + 'SearchFieldLabel'] = list.fields.name.label; $scope[list.iterator + 'SearchFieldLabel'] = list.fields.name.label;
} }
@@ -237,13 +237,13 @@ export function JobTemplatesList($scope, $rootScope, $location, $log, $routePara
}; };
} }
JobTemplatesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobTemplateList', JobTemplatesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'JobTemplateList',
'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
'ProcessErrors', 'GetBasePath', 'JobTemplateForm', 'CredentialList', 'LookUpInit', 'ProcessErrors', 'GetBasePath', 'JobTemplateForm', 'CredentialList', 'LookUpInit',
'PlaybookRun', 'Wait', 'Stream', 'CreateDialog' , '$compile' 'PlaybookRun', 'Wait', 'Stream', 'CreateDialog' , '$compile'
]; ];
export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm, export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location, $log, $stateParams, JobTemplateForm,
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath,
InventoryList, CredentialList, ProjectList, LookUpInit, md5Setup, ParseTypeChange, Wait, Empty, ToJSON, InventoryList, CredentialList, ProjectList, LookUpInit, md5Setup, ParseTypeChange, Wait, Empty, ToJSON,
CallbackHelpInit, SurveyControllerInit, Prompt, GetChoices) { CallbackHelpInit, SurveyControllerInit, Prompt, GetChoices) {
@@ -289,7 +289,7 @@ export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location
LookUpInit({ LookUpInit({
scope: $scope, scope: $scope,
form: form, form: form,
current_item: ($routeParams.inventory_id !== undefined) ? $routeParams.inventory_id : null, current_item: ($stateParams.inventory_id !== undefined) ? $stateParams.inventory_id : null,
list: InventoryList, list: InventoryList,
field: 'inventory', field: 'inventory',
input_type: "radio" input_type: "radio"
@@ -353,13 +353,13 @@ export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location
// if you're getting to the form from the scan job section on inventories, // if you're getting to the form from the scan job section on inventories,
// set the job type select to be scan // set the job type select to be scan
if ($routeParams.inventory_id) { if ($stateParams.inventory_id) {
// This means that the job template form was accessed via inventory prop's // This means that the job template form was accessed via inventory prop's
// This also means the job is a scan job. // This also means the job is a scan job.
$scope.job_type.value = 'scan'; $scope.job_type.value = 'scan';
$scope.jobTypeChange(); $scope.jobTypeChange();
$scope.inventory = $routeParams.inventory_id; $scope.inventory = $stateParams.inventory_id;
Rest.setUrl(GetBasePath('inventory') + $routeParams.inventory_id + '/'); Rest.setUrl(GetBasePath('inventory') + $stateParams.inventory_id + '/');
Rest.get() Rest.get()
.success(function (data) { .success(function (data) {
$scope.inventory_name = data.name; $scope.inventory_name = data.name;
@@ -659,14 +659,14 @@ export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location
}; };
} }
JobTemplatesAdd.$inject = ['$filter', '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobTemplateForm', JobTemplatesAdd.$inject = ['$filter', '$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'JobTemplateForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope',
'GetBasePath', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', 'GetBasePath', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit',
'md5Setup', 'ParseTypeChange', 'Wait', 'Empty', 'ToJSON', 'CallbackHelpInit', 'initSurvey', 'Prompt', 'GetChoices' 'md5Setup', 'ParseTypeChange', 'Wait', 'Empty', 'ToJSON', 'CallbackHelpInit', 'initSurvey', 'Prompt', 'GetChoices'
]; ];
export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm, GenerateForm, Rest, export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $location, $log, $stateParams, JobTemplateForm, GenerateForm, Rest,
Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList,
CredentialList, ProjectList, LookUpInit, GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate, CredentialList, ProjectList, LookUpInit, GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate,
Wait, Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, JobsControllerInit, JobsListUpdate, Wait, Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, JobsControllerInit, JobsListUpdate,
@@ -679,7 +679,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio
form = JobTemplateForm(), form = JobTemplateForm(),
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}, master = {},
id = $routeParams.template_id, id = $stateParams.template_id,
relatedSets = {}, relatedSets = {},
checkSCMStatus, getPlaybooks, callback, checkSCMStatus, getPlaybooks, callback,
choicesCount = 0; choicesCount = 0;
@@ -955,7 +955,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to retrieve job template: ' + $routeParams.template_id + '. GET status: ' + status msg: 'Failed to retrieve job template: ' + $stateParams.template_id + '. GET status: ' + status
}); });
}); });
}); });
@@ -1161,7 +1161,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio
// Related set: Add button // Related set: Add button
$scope.add = function (set) { $scope.add = function (set) {
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
$location.path('/' + base + '/' + $routeParams.template_id + '/' + set); $location.path('/' + base + '/' + $stateParams.template_id + '/' + set);
}; };
// Related set: Edit button // Related set: Edit button
@@ -1223,7 +1223,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to retrieve save survey_enabled: ' + $routeParams.template_id + '. GET status: ' + status msg: 'Failed to retrieve save survey_enabled: ' + $stateParams.template_id + '. GET status: ' + status
}); });
}); });
}; };
@@ -1231,7 +1231,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio
} }
JobTemplatesEdit.$inject = ['$filter', '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobTemplateForm', JobTemplatesEdit.$inject = ['$filter', '$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'JobTemplateForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit',
'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit',
'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt', 'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt',

View File

@@ -11,7 +11,7 @@
*/ */
export function JobsListController ($rootScope, $log, $scope, $compile, $routeParams, export function JobsListController ($rootScope, $log, $scope, $compile, $stateParams,
ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope,
LoadJobsScope, AllJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait) { LoadJobsScope, AllJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait) {
@@ -49,14 +49,14 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa
if (AllJobsList.fields.type) { if (AllJobsList.fields.type) {
AllJobsList.fields.type.searchOptions = $scope.type_choices; AllJobsList.fields.type.searchOptions = $scope.type_choices;
} }
if ($routeParams.status) { if ($stateParams.status) {
search_params[AllJobsList.iterator + 'SearchField'] = 'status'; search_params[AllJobsList.iterator + 'SearchField'] = 'status';
search_params[AllJobsList.iterator + 'SelectShow'] = true; search_params[AllJobsList.iterator + 'SelectShow'] = true;
search_params[AllJobsList.iterator + 'SearchSelectOpts'] = AllJobsList.fields.status.searchOptions; search_params[AllJobsList.iterator + 'SearchSelectOpts'] = AllJobsList.fields.status.searchOptions;
search_params[AllJobsList.iterator + 'SearchFieldLabel'] = AllJobsList.fields.status.label.replace(/<br\>/g,' '); search_params[AllJobsList.iterator + 'SearchFieldLabel'] = AllJobsList.fields.status.label.replace(/<br\>/g,' ');
search_params[AllJobsList.iterator + 'SearchType'] = ''; search_params[AllJobsList.iterator + 'SearchType'] = '';
for (opt in AllJobsList.fields.status.searchOptions) { for (opt in AllJobsList.fields.status.searchOptions) {
if (AllJobsList.fields.status.searchOptions[opt].value === $routeParams.status) { if (AllJobsList.fields.status.searchOptions[opt].value === $stateParams.status) {
search_params[AllJobsList.iterator + 'SearchSelectValue'] = AllJobsList.fields.status.searchOptions[opt]; search_params[AllJobsList.iterator + 'SearchSelectValue'] = AllJobsList.fields.status.searchOptions[opt];
break; break;
} }
@@ -185,6 +185,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa
} }
} }
JobsListController.$inject = ['$rootScope', '$log', '$scope', '$compile', '$routeParams', JobsListController.$inject = ['$rootScope', '$log', '$scope', '$compile', '$stateParams',
'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'LoadSchedulesScope', 'LoadJobsScope', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'LoadSchedulesScope', 'LoadJobsScope',
'AllJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait']; 'AllJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait'];

View File

@@ -11,7 +11,7 @@
*/ */
export function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt, export function OrganizationsList($stateParams, $scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt,
GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) { GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {
ClearScope(); ClearScope();
@@ -28,7 +28,7 @@ export function OrganizationsList($routeParams, $scope, $rootScope, $location, $
LoadBreadCrumbs(); LoadBreadCrumbs();
if (mode === 'select') { if (mode === 'select') {
url = GetBasePath('projects') + $routeParams.project_id + '/organizations/'; url = GetBasePath('projects') + $stateParams.project_id + '/organizations/';
SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 }); SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 });
} }
@@ -92,13 +92,13 @@ export function OrganizationsList($routeParams, $scope, $rootScope, $location, $
}; };
} }
OrganizationsList.$inject = ['$routeParams', '$scope', '$rootScope', '$location', '$log', 'Rest', 'Alert', 'LoadBreadCrumbs', 'Prompt', OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope', '$location', '$log', 'Rest', 'Alert', 'LoadBreadCrumbs', 'Prompt',
'generateList', 'OrganizationList', 'SearchInit', 'PaginateInit', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'Wait', 'generateList', 'OrganizationList', 'SearchInit', 'PaginateInit', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'Wait',
'Stream' 'Stream'
]; ];
export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm, export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, OrganizationForm,
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,
ReturnToCaller, Wait) { ReturnToCaller, Wait) {
@@ -119,7 +119,7 @@ export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log,
generator.clearApiErrors(); generator.clearApiErrors();
Wait('start'); Wait('start');
var url = GetBasePath(base); var url = GetBasePath(base);
url += (base !== 'organizations') ? $routeParams.project_id + '/organizations/' : ''; url += (base !== 'organizations') ? $stateParams.project_id + '/organizations/' : '';
Rest.setUrl(url); Rest.setUrl(url);
Rest.post({ name: $scope.name, description: $scope.description }) Rest.post({ name: $scope.name, description: $scope.description })
.success(function (data) { .success(function (data) {
@@ -144,12 +144,12 @@ export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log,
}; };
} }
OrganizationsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'OrganizationForm', OrganizationsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'OrganizationForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'Wait' 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'Wait'
]; ];
export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm, GenerateForm, Rest, export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, OrganizationForm, GenerateForm, Rest,
Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, Wait, Stream) { Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, Wait, Stream) {
ClearScope(); ClearScope();
@@ -160,7 +160,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log,
defaultUrl = GetBasePath('organizations'), defaultUrl = GetBasePath('organizations'),
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}, master = {},
id = $routeParams.organization_id, id = $stateParams.organization_id,
relatedSets = {}; relatedSets = {};
$scope.organization_id = id; $scope.organization_id = id;
@@ -208,7 +208,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log,
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to retrieve organization: ' + $routeParams.id + '. GET status: ' + status }); msg: 'Failed to retrieve organization: ' + $stateParams.id + '. GET status: ' + status });
}); });
@@ -252,7 +252,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log,
// Related set: Add button // Related set: Add button
$scope.add = function (set) { $scope.add = function (set) {
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
$location.path('/' + base + '/' + $routeParams.organization_id + '/' + set); $location.path('/' + base + '/' + $stateParams.organization_id + '/' + set);
}; };
// Related set: Edit button // Related set: Edit button
@@ -267,7 +267,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log,
var action = function () { var action = function () {
Wait('start'); Wait('start');
var url = defaultUrl + $routeParams.organization_id + '/' + set + '/'; var url = defaultUrl + $stateParams.organization_id + '/' + set + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.post({ id: itm_id, disassociate: 1 }) Rest.post({ id: itm_id, disassociate: 1 })
.success(function () { .success(function () {
@@ -290,7 +290,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log,
}; };
} }
OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'OrganizationForm', 'GenerateForm', OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'OrganizationForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath',
'Wait', 'Stream' 'Wait', 'Stream'
]; ];

View File

@@ -19,7 +19,7 @@
* *
* *
*/ */
export function PortalController($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, ClearScope, Stream, Rest, GetBasePath, ProcessErrors, export function PortalController($scope, $compile, $stateParams, $rootScope, $location, $log, Wait, ClearScope, Stream, Rest, GetBasePath, ProcessErrors,
PortalJobsWidget, GenerateList, PortalJobTemplateList, SearchInit, PaginateInit, PlaybookRun){ PortalJobsWidget, GenerateList, PortalJobTemplateList, SearchInit, PaginateInit, PlaybookRun){
ClearScope('portal'); ClearScope('portal');
@@ -138,6 +138,6 @@ export function PortalController($scope, $compile, $routeParams, $rootScope, $lo
} }
PortalController.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location', '$log','Wait', 'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', PortalController.$inject = ['$scope', '$compile', '$stateParams', '$rootScope', '$location', '$log','Wait', 'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors',
'PortalJobsWidget', 'generateList' , 'PortalJobTemplateList', 'SearchInit', 'PaginateInit', 'PlaybookRun' 'PortalJobsWidget', 'generateList' , 'PortalJobTemplateList', 'SearchInit', 'PaginateInit', 'PlaybookRun'
]; ];

View File

@@ -3,7 +3,7 @@
* *
* All Rights Reserved * All Rights Reserved
*************************************************/ *************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Projects * @name controllers.function:Projects
@@ -11,7 +11,7 @@
*/ */
export function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList, GenerateList, LoadBreadCrumbs, export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, ProjectList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate,
Refresh, Wait, Stream, GetChoices, Empty, Find, LogViewer, GetProjectIcon, GetProjectToolTip, $filter) { Refresh, Wait, Stream, GetChoices, Empty, Find, LogViewer, GetProjectIcon, GetProjectToolTip, $filter) {
@@ -24,10 +24,10 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $routeParams,
view = GenerateList, view = GenerateList,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
mode = (base === 'projects') ? 'edit' : 'select', mode = (base === 'projects') ? 'edit' : 'select',
url = (base === 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl, url = (base === 'teams') ? GetBasePath('teams') + $stateParams.team_id + '/projects/' : defaultUrl,
choiceCount = 0; choiceCount = 0;
view.inject(list, { mode: mode, scope: $scope, breadCrumbs:(($routeParams.team_id) ? true : false)}); view.inject(list, { mode: mode, scope: $scope, breadCrumbs:(($stateParams.team_id) ? true : false)});
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
$scope.projectLoading = true; $scope.projectLoading = true;
@@ -116,9 +116,9 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $routeParams,
list.fields.scm_type.searchOptions = $scope.project_scm_type_options; list.fields.scm_type.searchOptions = $scope.project_scm_type_options;
list.fields.status.searchOptions = $scope.project_status_options; list.fields.status.searchOptions = $scope.project_status_options;
if ($routeParams.scm_type && $routeParams.status) { if ($stateParams.scm_type && $stateParams.status) {
// Request coming from home page. User wants all errors for an scm_type // Request coming from home page. User wants all errors for an scm_type
defaultUrl += '?status=' + $routeParams.status; defaultUrl += '?status=' + $stateParams.status;
} }
SearchInit({ SearchInit({
@@ -133,27 +133,27 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $routeParams,
url: defaultUrl url: defaultUrl
}); });
if ($routeParams.scm_type) { if ($stateParams.scm_type) {
$scope[list.iterator + 'SearchType'] = ''; $scope[list.iterator + 'SearchType'] = '';
$scope[list.iterator + 'SearchField'] = 'scm_type'; $scope[list.iterator + 'SearchField'] = 'scm_type';
$scope[list.iterator + 'SelectShow'] = true; $scope[list.iterator + 'SelectShow'] = true;
$scope[list.iterator + 'SearchSelectOpts'] = list.fields.scm_type.searchOptions; $scope[list.iterator + 'SearchSelectOpts'] = list.fields.scm_type.searchOptions;
$scope[list.iterator + 'SearchFieldLabel'] = list.fields.scm_type.label.replace(/<br\>/g, ' '); $scope[list.iterator + 'SearchFieldLabel'] = list.fields.scm_type.label.replace(/<br\>/g, ' ');
for (opt in list.fields.scm_type.searchOptions) { for (opt in list.fields.scm_type.searchOptions) {
if (list.fields.scm_type.searchOptions[opt].value === $routeParams.scm_type) { if (list.fields.scm_type.searchOptions[opt].value === $stateParams.scm_type) {
$scope[list.iterator + 'SearchSelectValue'] = list.fields.scm_type.searchOptions[opt]; $scope[list.iterator + 'SearchSelectValue'] = list.fields.scm_type.searchOptions[opt];
break; break;
} }
} }
} else if ($routeParams.status) { } else if ($stateParams.status) {
$scope[list.iterator + 'SearchType'] = ''; $scope[list.iterator + 'SearchType'] = '';
$scope[list.iterator + 'SearchValue'] = $routeParams.status; $scope[list.iterator + 'SearchValue'] = $stateParams.status;
$scope[list.iterator + 'SearchField'] = 'status'; $scope[list.iterator + 'SearchField'] = 'status';
$scope[list.iterator + 'SelectShow'] = true; $scope[list.iterator + 'SelectShow'] = true;
$scope[list.iterator + 'SearchFieldLabel'] = list.fields.status.label; $scope[list.iterator + 'SearchFieldLabel'] = list.fields.status.label;
$scope[list.iterator + 'SearchSelectOpts'] = list.fields.status.searchOptions; $scope[list.iterator + 'SearchSelectOpts'] = list.fields.status.searchOptions;
for (opt in list.fields.status.searchOptions) { for (opt in list.fields.status.searchOptions) {
if (list.fields.status.searchOptions[opt].value === $routeParams.status) { if (list.fields.status.searchOptions[opt].value === $stateParams.status) {
$scope[list.iterator + 'SearchSelectValue'] = list.fields.status.searchOptions[opt]; $scope[list.iterator + 'SearchSelectValue'] = list.fields.status.searchOptions[opt];
break; break;
} }
@@ -389,14 +389,14 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $routeParams,
}; };
} }
ProjectsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'generateList', ProjectsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'ProjectList', 'generateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath',
'SelectionInit', 'ProjectUpdate', 'Refresh', 'Wait', 'Stream', 'GetChoices', 'Empty', 'Find', 'SelectionInit', 'ProjectUpdate', 'Refresh', 'Wait', 'Stream', 'GetChoices', 'Empty', 'Find',
'LogViewer', 'GetProjectIcon', 'GetProjectToolTip', '$filter' 'LogViewer', 'GetProjectIcon', 'GetProjectToolTip', '$filter'
]; ];
export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors, export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors,
LoadBreadCrumbs, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, OrganizationList, LoadBreadCrumbs, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, OrganizationList,
CredentialList, GetChoices, DebugForm, Wait) { CredentialList, GetChoices, DebugForm, Wait) {
@@ -482,7 +482,7 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $rout
delete data.local_path; delete data.local_path;
} }
url = (base === 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl; url = (base === 'teams') ? GetBasePath('teams') + $stateParams.team_id + '/projects/' : defaultUrl;
Wait('start'); Wait('start');
Rest.setUrl(url); Rest.setUrl(url);
Rest.post(data) Rest.post(data)
@@ -535,14 +535,14 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $rout
}; };
} }
ProjectsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'ProjectsForm', ProjectsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'ProjectsForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
'ReturnToCaller', 'GetProjectPath', 'LookUpInit', 'OrganizationList', 'CredentialList', 'GetChoices', 'ReturnToCaller', 'GetProjectPath', 'LookUpInit', 'OrganizationList', 'CredentialList', 'GetChoices',
'DebugForm', 'Wait' 'DebugForm', 'Wait'
]; ];
export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm, export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, ProjectsForm,
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt,
ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, Authorization, CredentialList, LookUpInit, GetChoices, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, Authorization, CredentialList, LookUpInit, GetChoices,
Empty, DebugForm, Wait, Stream, SchedulesControllerInit, SchedulesListInit, SchedulesList, ProjectUpdate) { Empty, DebugForm, Wait, Stream, SchedulesControllerInit, SchedulesListInit, SchedulesList, ProjectUpdate) {
@@ -552,10 +552,10 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $rou
// Inject dynamic view // Inject dynamic view
var form = ProjectsForm(), var form = ProjectsForm(),
generator = GenerateForm, generator = GenerateForm,
defaultUrl = GetBasePath('projects') + $routeParams.id + '/', defaultUrl = GetBasePath('projects') + $stateParams.id + '/',
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}, i, master = {}, i,
id = $routeParams.id, id = $stateParams.id,
relatedSets = {}; relatedSets = {};
SchedulesList.well = false; SchedulesList.well = false;
@@ -779,7 +779,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $rou
// Related set: Add button // Related set: Add button
$scope.add = function (set) { $scope.add = function (set) {
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
$location.path('/' + base + '/' + $routeParams.id + '/' + set); $location.path('/' + base + '/' + $stateParams.id + '/' + set);
}; };
// Related set: Edit button // Related set: Edit button
@@ -841,7 +841,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $rou
}; };
} }
ProjectsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'ProjectsForm', 'GenerateForm', ProjectsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'ProjectsForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ClearScope', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ClearScope',
'GetBasePath', 'ReturnToCaller', 'GetProjectPath', 'Authorization', 'CredentialList', 'LookUpInit', 'GetChoices', 'Empty', 'GetBasePath', 'ReturnToCaller', 'GetProjectPath', 'Authorization', 'CredentialList', 'LookUpInit', 'GetChoices', 'Empty',
'DebugForm', 'Wait', 'Stream', 'SchedulesControllerInit', 'SchedulesListInit', 'SchedulesList', 'ProjectUpdate' 'DebugForm', 'Wait', 'Stream', 'SchedulesControllerInit', 'SchedulesListInit', 'SchedulesList', 'ProjectUpdate'

View File

@@ -11,7 +11,7 @@
*/ */
export function ScheduleEditController($scope, $compile, $location, $routeParams, SchedulesList, Rest, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, export function ScheduleEditController($scope, $compile, $location, $stateParams, SchedulesList, Rest, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, GetChoices, Stream) { GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, GetChoices, Stream) {
ClearScope(); ClearScope();
@@ -61,7 +61,7 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, Get
} }
$scope.removeChoicesReady = $scope.$on('choicesReady', function() { $scope.removeChoicesReady = $scope.$on('choicesReady', function() {
// Load the parent object // Load the parent object
id = $routeParams.id; id = $stateParams.id;
url = GetBasePath(base) + id + '/'; url = GetBasePath(base) + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.get() Rest.get()
@@ -94,5 +94,5 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, Get
}); });
} }
ScheduleEditController.$inject = [ '$scope', '$compile', '$location', '$routeParams', 'SchedulesList', 'Rest', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', ScheduleEditController.$inject = [ '$scope', '$compile', '$location', '$stateParams', 'SchedulesList', 'Rest', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope',
'GetBasePath', 'Wait', 'Breadcrumbs', 'Find', 'LoadDialogPartial', 'LoadSchedulesScope', 'GetChoices', 'Stream' ]; 'GetBasePath', 'Wait', 'Breadcrumbs', 'Find', 'LoadDialogPartial', 'LoadSchedulesScope', 'GetChoices', 'Stream' ];

View File

@@ -11,7 +11,7 @@
*/ */
export function TeamsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, TeamList, GenerateList, LoadBreadCrumbs, export function TeamsList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, TeamList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait,
Stream) { Stream) {
@@ -107,13 +107,13 @@ export function TeamsList($scope, $rootScope, $location, $log, $routeParams, Res
}; };
} }
TeamsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'TeamList', 'generateList', TeamsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'TeamList', 'generateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'SetTeamListeners', 'GetBasePath', 'SelectionInit', 'Wait', 'Stream' 'SetTeamListeners', 'GetBasePath', 'SelectionInit', 'Wait', 'Stream'
]; ];
export function TeamsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, TeamForm, GenerateForm, export function TeamsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, TeamForm, GenerateForm,
Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList,
OrganizationList, SearchInit, PaginateInit, GetBasePath, LookUpInit, Wait) { OrganizationList, SearchInit, PaginateInit, GetBasePath, LookUpInit, Wait) {
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
@@ -168,13 +168,13 @@ export function TeamsAdd($scope, $rootScope, $compile, $location, $log, $routePa
}; };
} }
TeamsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'TeamForm', 'GenerateForm', TeamsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'TeamForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList',
'OrganizationList', 'SearchInit', 'PaginateInit', 'GetBasePath', 'LookUpInit', 'Wait' 'OrganizationList', 'SearchInit', 'PaginateInit', 'GetBasePath', 'LookUpInit', 'Wait'
]; ];
export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, TeamForm, GenerateForm, Rest, Alert, ProcessErrors, export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, TeamForm, GenerateForm, Rest, Alert, ProcessErrors,
LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt, GetBasePath, CheckAccess, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt, GetBasePath, CheckAccess,
OrganizationList, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) { OrganizationList, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) {
@@ -185,7 +185,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
form = TeamForm, form = TeamForm,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}, master = {},
id = $routeParams.team_id, id = $stateParams.team_id,
relatedSets = {}; relatedSets = {};
$scope.permission_label = {}; $scope.permission_label = {};
@@ -290,7 +290,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
Wait('stop'); Wait('stop');
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to retrieve team: ' + $routeParams.team_id + ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to retrieve team: ' + $stateParams.team_id +
'. GET status: ' + status }); '. GET status: ' + status });
Wait('stop'); Wait('stop');
}); });
@@ -315,7 +315,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
generator.clearApiErrors(); generator.clearApiErrors();
Wait('start'); Wait('start');
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
Rest.setUrl(defaultUrl + $routeParams.team_id + '/'); Rest.setUrl(defaultUrl + $stateParams.team_id + '/');
for (fld in form.fields) { for (fld in form.fields) {
data[fld] = $scope[fld]; data[fld] = $scope[fld];
} }
@@ -334,7 +334,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
.error(function (data, status) { .error(function (data, status) {
Wait('stop'); Wait('stop');
ProcessErrors($scope, data, status, form, { hdr: 'Error!', ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to update team: ' + $routeParams.team_id + '. PUT status: ' + status }); msg: 'Failed to update team: ' + $stateParams.team_id + '. PUT status: ' + status });
}); });
}; };
@@ -352,12 +352,12 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
if (set === 'permissions') { if (set === 'permissions') {
if ($scope.PermissionAddAllowed) { if ($scope.PermissionAddAllowed) {
$location.path('/' + base + '/' + $routeParams.team_id + '/' + set + '/add'); $location.path('/' + base + '/' + $stateParams.team_id + '/' + set + '/add');
} else { } else {
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.'); Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
} }
} else { } else {
$location.path('/' + base + '/' + $routeParams.team_id + '/' + set); $location.path('/' + base + '/' + $stateParams.team_id + '/' + set);
} }
}; };
@@ -365,7 +365,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
$scope.edit = function (set, id) { $scope.edit = function (set, id) {
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
if (set === 'permissions') { if (set === 'permissions') {
$location.path('/' + base + '/' + $routeParams.team_id + '/' + set + '/' + id); $location.path('/' + base + '/' + $stateParams.team_id + '/' + set + '/' + id);
} else { } else {
$location.path('/' + set + '/' + id); $location.path('/' + set + '/' + id);
} }
@@ -395,7 +395,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.'); Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
} }
} else { } else {
url = defaultUrl + $routeParams.team_id + '/' + set + '/'; url = defaultUrl + $stateParams.team_id + '/' + set + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.post({ id: itm_id, disassociate: 1 }) Rest.post({ id: itm_id, disassociate: 1 })
.success(function () { .success(function () {
@@ -418,7 +418,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP
}; };
} }
TeamsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'TeamForm', TeamsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'TeamForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit',
'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath', 'CheckAccess', 'OrganizationList', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect' 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath', 'CheckAccess', 'OrganizationList', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect'
]; ];

View File

@@ -11,7 +11,7 @@
*/ */
export function UsersList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, UserList, GenerateList, LoadBreadCrumbs, export function UsersList($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, UserList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) { Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {
ClearScope(); ClearScope();
@@ -21,10 +21,10 @@ export function UsersList($scope, $rootScope, $location, $log, $routeParams, Res
generator = GenerateList, generator = GenerateList,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
mode = (base === 'users') ? 'edit' : 'select', mode = (base === 'users') ? 'edit' : 'select',
url = (base === 'organizations') ? GetBasePath('organizations') + $routeParams.organization_id + '/users/' : url = (base === 'organizations') ? GetBasePath('organizations') + $stateParams.organization_id + '/users/' :
GetBasePath('teams') + $routeParams.team_id + '/users/'; GetBasePath('teams') + $stateParams.team_id + '/users/';
generator.inject(UserList, { mode: mode, scope: $scope, breadCrumbs:(($routeParams.organization_id || $routeParams.team_id) ? true : false) }); generator.inject(UserList, { mode: mode, scope: $scope, breadCrumbs:(($stateParams.organization_id || $stateParams.team_id) ? true : false) });
$scope.selected = []; $scope.selected = [];
@@ -97,13 +97,13 @@ export function UsersList($scope, $rootScope, $location, $log, $routeParams, Res
}; };
} }
UsersList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'UserList', 'generateList', UsersList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'UserList', 'generateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath',
'SelectionInit', 'Wait', 'Stream' 'SelectionInit', 'Wait', 'Stream'
]; ];
export function UsersAdd($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors, export function UsersAdd($scope, $rootScope, $compile, $location, $log, $stateParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors,
LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath, LookUpInit, OrganizationList, ResetForm, Wait) { LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath, LookUpInit, OrganizationList, ResetForm, Wait) {
ClearScope(); ClearScope();
@@ -130,15 +130,15 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log, $routePa
LookUpInit({ LookUpInit({
scope: $scope, scope: $scope,
form: form, form: form,
current_item: ($routeParams.organization_id !== undefined) ? $routeParams.organization_id : null, current_item: ($stateParams.organization_id !== undefined) ? $stateParams.organization_id : null,
list: OrganizationList, list: OrganizationList,
field: 'organization', field: 'organization',
input_type: 'radio' input_type: 'radio'
}); });
if ($routeParams.organization_id) { if ($stateParams.organization_id) {
$scope.organization = $routeParams.organization_id; $scope.organization = $stateParams.organization_id;
Rest.setUrl(GetBasePath('organizations') + $routeParams.organization_id + '/'); Rest.setUrl(GetBasePath('organizations') + $stateParams.organization_id + '/');
Rest.get() Rest.get()
.success(function (data) { .success(function (data) {
$scope.organization_name = data.name; $scope.organization_name = data.name;
@@ -201,13 +201,13 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log, $routePa
}; };
} }
UsersAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'UserForm', 'GenerateForm', UsersAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'UserForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GetBasePath', 'LookUpInit', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GetBasePath', 'LookUpInit',
'OrganizationList', 'ResetForm', 'Wait' 'OrganizationList', 'ResetForm', 'Wait'
]; ];
export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm, GenerateForm, Rest, Alert, export function UsersEdit($scope, $rootScope, $compile, $location, $log, $stateParams, UserForm, GenerateForm, Rest, Alert,
ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, GetBasePath, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, GetBasePath,
Prompt, CheckAccess, ResetForm, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) { Prompt, CheckAccess, ResetForm, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) {
@@ -218,7 +218,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP
form = UserForm, form = UserForm,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}, master = {},
id = $routeParams.user_id, id = $stateParams.user_id,
relatedSets = {}; relatedSets = {};
$scope.permission_label = {}; $scope.permission_label = {};
@@ -324,7 +324,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' + ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
$routeParams.id + '. GET status: ' + status }); $stateParams.id + '. GET status: ' + status });
}); });
$scope.getPermissionText = function () { $scope.getPermissionText = function () {
@@ -368,7 +368,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP
} }
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update users: ' + $routeParams.id + ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update users: ' + $stateParams.id +
'. PUT status: ' + status }); '. PUT status: ' + status });
}); });
} }
@@ -402,12 +402,12 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
if (set === 'permissions') { if (set === 'permissions') {
if ($scope.PermissionAddAllowed) { if ($scope.PermissionAddAllowed) {
$location.path('/' + base + '/' + $routeParams.user_id + '/' + set + '/add'); $location.path('/' + base + '/' + $stateParams.user_id + '/' + set + '/add');
} else { } else {
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.'); Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
} }
} else { } else {
$location.path('/' + base + '/' + $routeParams.user_id + '/' + set); $location.path('/' + base + '/' + $stateParams.user_id + '/' + set);
} }
}; };
@@ -415,7 +415,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP
$scope.edit = function (set, id) { $scope.edit = function (set, id) {
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
if (set === 'permissions') { if (set === 'permissions') {
$location.path('/users/' + $routeParams.user_id + '/permissions/' + id); $location.path('/users/' + $stateParams.user_id + '/permissions/' + id);
} else { } else {
$location.path('/' + set + '/' + id); $location.path('/' + set + '/' + id);
} }
@@ -445,7 +445,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP
Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.'); Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
} }
} else { } else {
url = defaultUrl + $routeParams.user_id + '/' + set + '/'; url = defaultUrl + $stateParams.user_id + '/' + set + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.post({ Rest.post({
id: itm_id, id: itm_id,
@@ -527,7 +527,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP
}); });
} }
UsersEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'UserForm', 'GenerateForm', UsersEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'UserForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope',
'GetBasePath', 'Prompt', 'CheckAccess', 'ResetForm', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect' 'GetBasePath', 'Prompt', 'CheckAccess', 'ResetForm', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect'
]; ];

View File

@@ -53,11 +53,11 @@ export default
* *
*/ */
// Submit request to run an adhoc comamand // Submit request to run an adhoc comamand
.factory('AdhocRun', ['$location','$routeParams', 'LaunchJob', .factory('AdhocRun', ['$location','$stateParams', 'LaunchJob',
'PromptForPasswords', 'Rest', 'GetBasePath', 'Alert', 'ProcessErrors', 'PromptForPasswords', 'Rest', 'GetBasePath', 'Alert', 'ProcessErrors',
'Wait', 'Empty', 'PromptForCredential', 'PromptForVars', 'Wait', 'Empty', 'PromptForCredential', 'PromptForVars',
'PromptForSurvey' , 'CreateLaunchDialog', 'PromptForSurvey' , 'CreateLaunchDialog',
function ($location, $routeParams, LaunchJob, PromptForPasswords, function ($location, $stateParams, LaunchJob, PromptForPasswords,
Rest, GetBasePath, Alert, ProcessErrors, Wait, Empty, Rest, GetBasePath, Alert, ProcessErrors, Wait, Empty,
PromptForCredential, PromptForVars, PromptForSurvey, PromptForCredential, PromptForVars, PromptForSurvey,
CreateLaunchDialog) { CreateLaunchDialog) {

View File

@@ -13,9 +13,9 @@
export default export default
angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventDataDefinition', 'JobEventsFormDefinition']) angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventDataDefinition', 'JobEventsFormDefinition'])
.factory('EventView', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GenerateForm', .factory('EventView', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'JobEventDataForm', 'Empty', 'JobEventsForm', 'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'JobEventDataForm', 'Empty', 'JobEventsForm',
function ($rootScope, $location, $log, $routeParams, Rest, Alert, GenerateForm, Prompt, ProcessErrors, GetBasePath, function ($rootScope, $location, $log, $stateParams, Rest, Alert, GenerateForm, Prompt, ProcessErrors, GetBasePath,
FormatDate, JobEventDataForm, Empty, JobEventsForm) { FormatDate, JobEventDataForm, Empty, JobEventsForm) {
return function (params) { return function (params) {

View File

@@ -707,11 +707,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
* TODO: Document * TODO: Document
* *
*/ */
.factory('GroupsEdit', ['$filter', '$rootScope', '$location', '$log', '$routeParams', '$compile', 'Rest', 'Alert', 'GroupForm', 'GenerateForm', .factory('GroupsEdit', ['$filter', '$rootScope', '$location', '$log', '$stateParams', '$compile', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate', 'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate',
'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find', 'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find',
'ParseVariableString', 'ToJSON', 'GroupsScheduleListInit', 'SourceForm', 'SetSchedulesInnerDialogSize', 'CreateSelect2', 'ParseVariableString', 'ToJSON', 'GroupsScheduleListInit', 'SourceForm', 'SetSchedulesInnerDialogSize', 'CreateSelect2',
function ($filter, $rootScope, $location, $log, $routeParams, $compile, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors, function ($filter, $rootScope, $location, $log, $stateParams, $compile, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, LookUpInit, Empty, Wait, GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, LookUpInit, Empty, Wait,
GetChoices, UpdateGroup, SourceChange, Find, ParseVariableString, ToJSON, GroupsScheduleListInit, GetChoices, UpdateGroup, SourceChange, Find, ParseVariableString, ToJSON, GroupsScheduleListInit,
SourceForm, SetSchedulesInnerDialogSize, CreateSelect2) { SourceForm, SetSchedulesInnerDialogSize, CreateSelect2) {
@@ -1426,9 +1426,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
* Set's up the process for deleting a group from an inventory page * Set's up the process for deleting a group from an inventory page
* *
*/ */
.factory('GroupsDelete', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GroupForm', 'GenerateForm', .factory('GroupsDelete', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'Wait', 'BuildTree', 'Find', 'CreateDialog', 'Prompt', 'ProcessErrors', 'GetBasePath', 'Wait', 'BuildTree', 'Find', 'CreateDialog',
function ($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors, function ($rootScope, $location, $log, $stateParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
GetBasePath, Wait, BuildTree, Find, CreateDialog) { GetBasePath, Wait, BuildTree, Find, CreateDialog) {
return function (params) { return function (params) {
@@ -1994,9 +1994,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
* TODO: Document * TODO: Document
* *
*/ */
.factory('ShowUpdateStatus', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GenerateForm', .factory('ShowUpdateStatus', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'InventoryStatusForm', 'Wait', 'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'InventoryStatusForm', 'Wait',
function ($rootScope, $location, $log, $routeParams, Rest, Alert, GenerateForm, Prompt, ProcessErrors, GetBasePath, function ($rootScope, $location, $log, $stateParams, Rest, Alert, GenerateForm, Prompt, ProcessErrors, GetBasePath,
FormatDate, InventoryStatusForm, Wait) { FormatDate, InventoryStatusForm, Wait) {
return function (params) { return function (params) {

View File

@@ -170,9 +170,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
}; };
}]) }])
.factory('HostsReload', [ '$routeParams', 'Empty', 'InventoryHosts', 'GetBasePath', 'SearchInit', 'PaginateInit', 'Wait', .factory('HostsReload', [ '$stateParams', 'Empty', 'InventoryHosts', 'GetBasePath', 'SearchInit', 'PaginateInit', 'Wait',
'SetHostStatus', 'SetStatus', 'ApplyEllipsis', 'SetHostStatus', 'SetStatus', 'ApplyEllipsis',
function($routeParams, Empty, InventoryHosts, GetBasePath, SearchInit, PaginateInit, Wait, SetHostStatus, SetStatus, function($stateParams, Empty, InventoryHosts, GetBasePath, SearchInit, PaginateInit, Wait, SetHostStatus, SetStatus,
ApplyEllipsis) { ApplyEllipsis) {
return function(params) { return function(params) {
@@ -209,9 +209,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
SearchInit({ scope: scope, set: 'hosts', list: list, url: url }); SearchInit({ scope: scope, set: 'hosts', list: list, url: url });
PaginateInit({ scope: scope, list: list, url: url, pageSize: pageSize }); PaginateInit({ scope: scope, list: list, url: url, pageSize: pageSize });
if ($routeParams.host_name) { if ($stateParams.host_name) {
scope[list.iterator + 'InputDisable'] = false; scope[list.iterator + 'InputDisable'] = false;
scope[list.iterator + 'SearchValue'] = $routeParams.host_name; scope[list.iterator + 'SearchValue'] = $stateParams.host_name;
scope[list.iterator + 'SearchField'] = 'name'; scope[list.iterator + 'SearchField'] = 'name';
scope[list.iterator + 'SearchFieldLabel'] = list.fields.name.label; scope[list.iterator + 'SearchFieldLabel'] = list.fields.name.label;
scope[list.iterator + 'SearchSelectValue'] = null; scope[list.iterator + 'SearchSelectValue'] = null;
@@ -288,9 +288,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
}; };
}]) }])
.factory('HostsList', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'HostList', 'generateList', .factory('HostsList', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostList', 'generateList',
'Prompt', 'SearchInit', 'PaginateInit', 'ProcessErrors', 'GetBasePath', 'HostsAdd', 'HostsReload', 'SelectionInit', 'Prompt', 'SearchInit', 'PaginateInit', 'ProcessErrors', 'GetBasePath', 'HostsAdd', 'HostsReload', 'SelectionInit',
function($rootScope, $location, $log, $routeParams, Rest, Alert, HostList, GenerateList, Prompt, SearchInit, function($rootScope, $location, $log, $stateParams, Rest, Alert, HostList, GenerateList, Prompt, SearchInit,
PaginateInit, ProcessErrors, GetBasePath, HostsAdd, HostsReload, SelectionInit) { PaginateInit, ProcessErrors, GetBasePath, HostsAdd, HostsReload, SelectionInit) {
return function(params) { return function(params) {
@@ -349,9 +349,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
}]) }])
.factory('HostsCreate', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm', .factory('HostsCreate', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'ToJSON', 'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'ToJSON',
function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors, function($rootScope, $location, $log, $stateParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors,
GetBasePath, HostsReload, ParseTypeChange, Wait, ToJSON) { GetBasePath, HostsReload, ParseTypeChange, Wait, ToJSON) {
return function(params) { return function(params) {
@@ -447,10 +447,10 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
}]) }])
.factory('HostsEdit', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm', .factory('HostsEdit', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find', 'SetStatus', 'ApplyEllipsis', 'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find', 'SetStatus', 'ApplyEllipsis',
'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize', 'ToJSON', 'ParseVariableString', 'CreateDialog', 'TextareaResize',
function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors, function($rootScope, $location, $log, $stateParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors,
GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON, GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetStatus, ApplyEllipsis, ToJSON,
ParseVariableString, CreateDialog, TextareaResize) { ParseVariableString, CreateDialog, TextareaResize) {
return function(params) { return function(params) {
@@ -680,8 +680,8 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
}]) }])
.factory('HostsDelete', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'Wait', .factory('HostsDelete', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'Wait',
function($rootScope, $location, $log, $routeParams, Rest, Alert, Prompt, ProcessErrors, GetBasePath, HostsReload, Wait) { function($rootScope, $location, $log, $stateParams, Rest, Alert, Prompt, ProcessErrors, GetBasePath, HostsReload, Wait) {
return function(params) { return function(params) {
// Remove the selected host from the current group by disassociating // Remove the selected host from the current group by disassociating
@@ -983,9 +983,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
}; };
}]) }])
.factory('EditHostGroups', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GenerateForm', 'Prompt', .factory('EditHostGroups', ['$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'GenerateForm', 'Prompt',
'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait',
function($rootScope, $location, $log, $routeParams, Rest, Alert, GenerateForm, Prompt, ProcessErrors, GetBasePath, HostsReload, function($rootScope, $location, $log, $stateParams, Rest, Alert, GenerateForm, Prompt, ProcessErrors, GetBasePath, HostsReload,
ParseTypeChange, Wait) { ParseTypeChange, Wait) {
return function(params) { return function(params) {

View File

@@ -469,9 +469,9 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm,
}]) }])
.factory('PromptForVars', ['$compile', 'Rest', 'GetBasePath', 'TextareaResize', 'CreateLaunchDialog', 'GenerateForm', 'JobVarsPromptForm', 'Wait', .factory('PromptForVars', ['$compile', 'Rest', 'GetBasePath', 'TextareaResize', 'CreateLaunchDialog', 'GenerateForm', 'JobVarsPromptForm', 'Wait',
'ParseVariableString', 'ToJSON', 'ProcessErrors', '$routeParams' , 'ParseVariableString', 'ToJSON', 'ProcessErrors', '$stateParams' ,
function($compile, Rest, GetBasePath, TextareaResize,CreateLaunchDialog, GenerateForm, JobVarsPromptForm, Wait, function($compile, Rest, GetBasePath, TextareaResize,CreateLaunchDialog, GenerateForm, JobVarsPromptForm, Wait,
ParseVariableString, ToJSON, ProcessErrors, $routeParams) { ParseVariableString, ToJSON, ProcessErrors, $stateParams) {
return function(params) { return function(params) {
var var
// parent_scope = params.scope, // parent_scope = params.scope,
@@ -513,16 +513,16 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm,
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors(scope, data, status, { hdr: 'Error!', ProcessErrors(scope, data, status, { hdr: 'Error!',
msg: 'Failed to retrieve organization: ' + $routeParams.id + '. GET status: ' + status }); msg: 'Failed to retrieve organization: ' + $stateParams.id + '. GET status: ' + status });
}); });
}; };
}]) }])
.factory('PromptForSurvey', ['$filter', '$compile', 'Wait', 'Alert', 'CredentialForm', 'CreateLaunchDialog', 'GetBasePath', 'Rest' , 'Empty', .factory('PromptForSurvey', ['$filter', '$compile', 'Wait', 'Alert', 'CredentialForm', 'CreateLaunchDialog', 'GetBasePath', 'Rest' , 'Empty',
'GenerateForm', 'ProcessErrors', '$routeParams' , 'GenerateForm', 'ProcessErrors', '$stateParams' ,
function($filter, $compile, Wait, Alert, CredentialForm, CreateLaunchDialog, GetBasePath, Rest, Empty, function($filter, $compile, Wait, Alert, CredentialForm, CreateLaunchDialog, GetBasePath, Rest, Empty,
GenerateForm, ProcessErrors, $routeParams) { GenerateForm, ProcessErrors, $stateParams) {
return function(params) { return function(params) {
var html = params.html || "", var html = params.html || "",
id= params.id, id= params.id,
@@ -698,16 +698,16 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm,
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors(scope, data, status, { hdr: 'Error!', ProcessErrors(scope, data, status, { hdr: 'Error!',
msg: 'Failed to retrieve organization: ' + $routeParams.id + '. GET status: ' + status }); msg: 'Failed to retrieve organization: ' + $stateParams.id + '. GET status: ' + status });
}); });
}; };
}]) }])
.factory('CheckPasswords', ['$compile', 'Rest', 'GetBasePath', 'TextareaResize', 'CreateLaunchDialog', 'GenerateForm', 'JobVarsPromptForm', 'Wait', .factory('CheckPasswords', ['$compile', 'Rest', 'GetBasePath', 'TextareaResize', 'CreateLaunchDialog', 'GenerateForm', 'JobVarsPromptForm', 'Wait',
'ParseVariableString', 'ToJSON', 'ProcessErrors', '$routeParams', 'Empty', 'ParseVariableString', 'ToJSON', 'ProcessErrors', '$stateParams', 'Empty',
function($compile, Rest, GetBasePath, TextareaResize,CreateLaunchDialog, GenerateForm, JobVarsPromptForm, Wait, function($compile, Rest, GetBasePath, TextareaResize,CreateLaunchDialog, GenerateForm, JobVarsPromptForm, Wait,
ParseVariableString, ToJSON, ProcessErrors, $routeParams, Empty) { ParseVariableString, ToJSON, ProcessErrors, $stateParams, Empty) {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,
callback = params.callback, callback = params.callback,
@@ -752,9 +752,9 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm,
* *
*/ */
// Submit request to run a playbook // Submit request to run a playbook
.factory('PlaybookRun', ['$location','$routeParams', 'LaunchJob', 'PromptForPasswords', 'Rest', 'GetBasePath', 'Alert', 'ProcessErrors', 'Wait', 'Empty', .factory('PlaybookRun', ['$location','$stateParams', 'LaunchJob', 'PromptForPasswords', 'Rest', 'GetBasePath', 'Alert', 'ProcessErrors', 'Wait', 'Empty',
'PromptForCredential', 'PromptForVars', 'PromptForSurvey' , 'CreateLaunchDialog', 'PromptForCredential', 'PromptForVars', 'PromptForSurvey' , 'CreateLaunchDialog',
function ($location, $routeParams, LaunchJob, PromptForPasswords, Rest, GetBasePath, Alert, ProcessErrors, Wait, Empty, function ($location, $stateParams, LaunchJob, PromptForPasswords, Rest, GetBasePath, Alert, ProcessErrors, Wait, Empty,
PromptForCredential, PromptForVars, PromptForSurvey, CreateLaunchDialog) { PromptForCredential, PromptForVars, PromptForSurvey, CreateLaunchDialog) {
return function (params) { return function (params) {
var //parent_scope = params.scope, var //parent_scope = params.scope,

View File

@@ -18,9 +18,9 @@ angular.module('JobTemplatesHelper', ['Utilities'])
* *
*/ */
.factory('CallbackHelpInit', ['$location', 'GetBasePath', 'Rest', 'JobTemplateForm', 'GenerateForm', '$routeParams', 'LoadBreadCrumbs', 'ProcessErrors', 'ParseTypeChange', .factory('CallbackHelpInit', ['$location', 'GetBasePath', 'Rest', 'JobTemplateForm', 'GenerateForm', '$stateParams', 'LoadBreadCrumbs', 'ProcessErrors', 'ParseTypeChange',
'ParseVariableString', 'Empty', 'LookUpInit', 'InventoryList', 'CredentialList','ProjectList', 'RelatedSearchInit', 'RelatedPaginateInit', 'Wait', 'ParseVariableString', 'Empty', 'LookUpInit', 'InventoryList', 'CredentialList','ProjectList', 'RelatedSearchInit', 'RelatedPaginateInit', 'Wait',
function($location, GetBasePath, Rest, JobTemplateForm, GenerateForm, $routeParams, LoadBreadCrumbs, ProcessErrors,ParseTypeChange, function($location, GetBasePath, Rest, JobTemplateForm, GenerateForm, $stateParams, LoadBreadCrumbs, ProcessErrors,ParseTypeChange,
ParseVariableString, Empty, LookUpInit, InventoryList, CredentialList, ProjectList, RelatedSearchInit, RelatedPaginateInit, Wait) { ParseVariableString, Empty, LookUpInit, InventoryList, CredentialList, ProjectList, RelatedSearchInit, RelatedPaginateInit, Wait) {
return function(params) { return function(params) {
@@ -31,7 +31,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
// loadingFinishedCount = 0, // loadingFinishedCount = 0,
// base = $location.path().replace(/^\//, '').split('/')[0], // base = $location.path().replace(/^\//, '').split('/')[0],
master = {}, master = {},
id = $routeParams.template_id, id = $stateParams.template_id,
relatedSets = {}; relatedSets = {};
// checkSCMStatus, getPlaybooks, callback, // checkSCMStatus, getPlaybooks, callback,
// choicesCount = 0; // choicesCount = 0;
@@ -192,7 +192,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
.error(function (data, status) { .error(function (data, status) {
ProcessErrors(scope, data, status, form, { ProcessErrors(scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to retrieve job template: ' + $routeParams.template_id + '. GET status: ' + status msg: 'Failed to retrieve job template: ' + $stateParams.template_id + '. GET status: ' + status
}); });
}); });
}; };

View File

@@ -369,8 +369,8 @@ export default
* Called from JobsList controller to load each section or list on the page * Called from JobsList controller to load each section or list on the page
* *
*/ */
.factory('LoadJobsScope', ['$routeParams', '$location', '$compile', 'SearchInit', 'PaginateInit', 'generateList', 'JobsControllerInit', 'JobsListUpdate', 'SearchWidget', .factory('LoadJobsScope', ['$stateParams', '$location', '$compile', 'SearchInit', 'PaginateInit', 'generateList', 'JobsControllerInit', 'JobsListUpdate', 'SearchWidget',
function($routeParams, $location, $compile, SearchInit, PaginateInit, GenerateList, JobsControllerInit, JobsListUpdate, SearchWidget) { function($stateParams, $location, $compile, SearchInit, PaginateInit, GenerateList, JobsControllerInit, JobsListUpdate, SearchWidget) {
return function(params) { return function(params) {
var parent_scope = params.parent_scope, var parent_scope = params.parent_scope,
scope = params.scope, scope = params.scope,
@@ -429,9 +429,9 @@ export default
}); });
if (base === 'jobs' && list.name === 'all_jobs') { if (base === 'jobs' && list.name === 'all_jobs') {
if ($routeParams.id__int) { if ($stateParams.id__int) {
scope[list.iterator + 'SearchField'] = 'id'; scope[list.iterator + 'SearchField'] = 'id';
scope[list.iterator + 'SearchValue'] = $routeParams.id__int; scope[list.iterator + 'SearchValue'] = $stateParams.id__int;
scope[list.iterator + 'SearchFieldLabel'] = 'Job ID'; scope[list.iterator + 'SearchFieldLabel'] = 'Job ID';
} }
} }

View File

@@ -236,9 +236,9 @@ export default
}; };
}]) }])
.factory('AddSchedule', ['$location', '$routeParams', 'SchedulerInit', 'ShowSchedulerModal', 'Wait', 'GetBasePath', 'Empty', .factory('AddSchedule', ['$location', '$stateParams', 'SchedulerInit', 'ShowSchedulerModal', 'Wait', 'GetBasePath', 'Empty',
'SchedulePost', 'SchedulePost',
function($location, $routeParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost) { function($location, $stateParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost) {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,
callback= params.callback, callback= params.callback,
@@ -246,14 +246,14 @@ export default
url = GetBasePath(base), url = GetBasePath(base),
scheduler; scheduler;
if (!Empty($routeParams.template_id)) { if (!Empty($stateParams.template_id)) {
url += $routeParams.template_id + '/schedules/'; url += $stateParams.template_id + '/schedules/';
} }
else if (!Empty($routeParams.id)) { else if (!Empty($stateParams.id)) {
url += $routeParams.id + '/schedules/'; url += $stateParams.id + '/schedules/';
} }
else if (!Empty($routeParams.management_job)) { else if (!Empty($stateParams.management_job)) {
url += $routeParams.management_job + '/schedules/'; url += $stateParams.management_job + '/schedules/';
if(scope.management_job.id === 4){ if(scope.management_job.id === 4){
scope.isFactCleanup = true; scope.isFactCleanup = true;
scope.keep_unit_choices = [{ scope.keep_unit_choices = [{
@@ -690,9 +690,9 @@ export default
* Called from a controller to setup the scope for a schedules list * Called from a controller to setup the scope for a schedules list
* *
*/ */
.factory('LoadSchedulesScope', ['$compile', '$location', '$routeParams','SearchInit', 'PaginateInit', 'generateList', 'SchedulesControllerInit', .factory('LoadSchedulesScope', ['$compile', '$location', '$stateParams','SearchInit', 'PaginateInit', 'generateList', 'SchedulesControllerInit',
'SchedulesListInit', 'SchedulesListInit',
function($compile, $location, $routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit) { function($compile, $location, $stateParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit) {
return function(params) { return function(params) {
var parent_scope = params.parent_scope, var parent_scope = params.parent_scope,
scope = params.scope, scope = params.scope,
@@ -746,9 +746,9 @@ export default
parent_scope.$emit('listLoaded'); parent_scope.$emit('listLoaded');
}); });
if ($routeParams.id__int) { if ($stateParams.id__int) {
scope[list.iterator + 'SearchField'] = 'id'; scope[list.iterator + 'SearchField'] = 'id';
scope[list.iterator + 'SearchValue'] = $routeParams.id__int; scope[list.iterator + 'SearchValue'] = $stateParams.id__int;
scope[list.iterator + 'SearchFieldLabel'] = 'ID'; scope[list.iterator + 'SearchFieldLabel'] = 'ID';
} }

View File

@@ -1,5 +1,5 @@
export default export default
function AddFactory($location, $routeParams, ShowSurveyModal, Wait) { function AddFactory($location, $stateParams, ShowSurveyModal, Wait) {
return function(params) { return function(params) {
var scope = params.scope; var scope = params.scope;
@@ -19,7 +19,7 @@ export default
AddFactory.$inject = AddFactory.$inject =
[ '$location', [ '$location',
'$routeParams', '$stateParams',
'showSurvey', 'showSurvey',
'Wait' 'Wait'
]; ];

View File

@@ -1,5 +1,5 @@
export default export default
function EditFactory($routeParams, SchedulerInit, ShowSurveyModal, Wait, Rest, ProcessErrors, GetBasePath, GenerateForm, function EditFactory($stateParams, SchedulerInit, ShowSurveyModal, Wait, Rest, ProcessErrors, GetBasePath, GenerateForm,
Empty, AddSurvey) { Empty, AddSurvey) {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,
@@ -66,7 +66,7 @@ export default
EditFactory.$inject = EditFactory.$inject =
[ '$routeParams', [ '$stateParams',
'SchedulerInit', 'SchedulerInit',
'showSurvey', 'showSurvey',
'Wait', 'Wait',

View File

@@ -11,10 +11,10 @@
*/ */
export default [ export default [
'$scope', '$location', '$routeParams', 'SchedulesList', 'Rest', '$scope', '$location', '$stateParams', 'SchedulesList', 'Rest',
'ProcessErrors', 'GetBasePath', 'Wait','LoadSchedulesScope', 'GetChoices', 'ProcessErrors', 'GetBasePath', 'Wait','LoadSchedulesScope', 'GetChoices',
'Stream', 'management_job', '$rootScope', 'Stream', 'management_job', '$rootScope',
function($scope, $location, $routeParams, SchedulesList, Rest, function($scope, $location, $stateParams, SchedulesList, Rest,
ProcessErrors, GetBasePath, Wait, LoadSchedulesScope, GetChoices, ProcessErrors, GetBasePath, Wait, LoadSchedulesScope, GetChoices,
Stream, management_job, $rootScope) { Stream, management_job, $rootScope) {
var base, id, url, parentObject; var base, id, url, parentObject;
@@ -58,7 +58,7 @@ export default [
} }
$scope.removeChoicesReady = $scope.$on('choicesReady', function() { $scope.removeChoicesReady = $scope.$on('choicesReady', function() {
// Load the parent object // Load the parent object
id = $routeParams.management_job; id = $stateParams.management_job;
url = GetBasePath('system_job_templates') + id + '/'; url = GetBasePath('system_job_templates') + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.get() Rest.get()

View File

@@ -10,15 +10,15 @@
* @description This controller for permissions add * @description This controller for permissions add
*/ */
export default export default
['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'permissionsForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess', 'Wait', 'permissionsCategoryChange', 'fieldChoices', 'fieldLabels', ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'permissionsForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess', 'Wait', 'permissionsCategoryChange', 'fieldChoices', 'fieldLabels',
function($scope, $rootScope, $compile, $location, $log, $routeParams, permissionsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, ReturnToCaller, InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, permissionsCategoryChange, fieldChoices, fieldLabels) { function($scope, $rootScope, $compile, $location, $log, $stateParams, permissionsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, ReturnToCaller, InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, permissionsCategoryChange, fieldChoices, fieldLabels) {
ClearScope(); ClearScope();
// Inject dynamic view // Inject dynamic view
var form = permissionsForm, var form = permissionsForm,
generator = GenerateForm, generator = GenerateForm,
id = ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id, id = ($stateParams.user_id !== undefined) ? $stateParams.user_id : $stateParams.team_id,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}; master = {};

View File

@@ -10,15 +10,15 @@
* @description This controller for permissions edit * @description This controller for permissions edit
*/ */
export default export default
['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'permissionsForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess', 'Wait', 'permissionsCategoryChange', 'fieldChoices', 'fieldLabels', ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'permissionsForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess', 'Wait', 'permissionsCategoryChange', 'fieldChoices', 'fieldLabels',
function($scope, $rootScope, $compile, $location, $log, $routeParams, permissionsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, Prompt, GetBasePath, InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, permissionsCategoryChange, fieldChoices, fieldLabels) { function($scope, $rootScope, $compile, $location, $log, $stateParams, permissionsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, Prompt, GetBasePath, InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, permissionsCategoryChange, fieldChoices, fieldLabels) {
ClearScope(); ClearScope();
var generator = GenerateForm, var generator = GenerateForm,
form = permissionsForm, form = permissionsForm,
base_id = ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id, base_id = ($stateParams.user_id !== undefined) ? $stateParams.user_id : $stateParams.team_id,
id = $routeParams.permission_id, id = $stateParams.permission_id,
defaultUrl = GetBasePath('base') + 'permissions/' + id + '/', defaultUrl = GetBasePath('base') + 'permissions/' + id + '/',
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
master = {}; master = {};
@@ -168,7 +168,7 @@ export default
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update Permission: ' + ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update Permission: ' +
$routeParams.id + '. PUT status: ' + status }); $stateParams.id + '. PUT status: ' + status });
}); });
}; };

View File

@@ -12,14 +12,14 @@
export default export default
['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'permissionsList', 'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'CheckAccess', 'Wait', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect', ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'permissionsList', 'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'CheckAccess', 'Wait', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect',
function ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, permissionsList, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, CheckAccess, Wait, fieldChoices, fieldLabels, permissionsSearchSelect) { function ($scope, $rootScope, $location, $log, $stateParams, Rest, Alert, permissionsList, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, CheckAccess, Wait, fieldChoices, fieldLabels, permissionsSearchSelect) {
ClearScope(); ClearScope();
var list = permissionsList, var list = permissionsList,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
base_id = ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id, base_id = ($stateParams.user_id !== undefined) ? $stateParams.user_id : $stateParams.team_id,
defaultUrl = GetBasePath(base), defaultUrl = GetBasePath(base),
generator = GenerateList; generator = GenerateList;
@@ -56,7 +56,7 @@ export default
generator.inject(list, { mode: 'edit', scope: $scope, breadCrumbs: true }); generator.inject(list, { mode: 'edit', scope: $scope, breadCrumbs: true });
}); });
defaultUrl += ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id; defaultUrl += ($stateParams.user_id !== undefined) ? $stateParams.user_id : $stateParams.team_id;
defaultUrl += '/permissions/'; defaultUrl += '/permissions/';
$scope.selected = []; $scope.selected = [];

View File

@@ -35,7 +35,7 @@
* the respoinse details and initiate action. For example: * the respoinse details and initiate action. For example:
* *
* ``` * ```
* var url = GetBasePath('inventories') + $routeParams.id + '/'; * var url = GetBasePath('inventories') + $stateParams.id + '/';
* Rest.setUrl(url); * Rest.setUrl(url);
* Rest.get() * Rest.get()
* .success(function(data) { * .success(function(data) {

View File

@@ -274,8 +274,8 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
]) ])
.factory('LoadBreadCrumbs', ['$rootScope', '$routeParams', '$location', 'Empty', .factory('LoadBreadCrumbs', ['$rootScope', '$stateParams', '$location', 'Empty',
function ($rootScope, $routeParams, $location, Empty) { function ($rootScope, $stateParams, $location, Empty) {
return function (crumb) { return function (crumb) {
var title, found, j, i, paths, ppath, parent, child; var title, found, j, i, paths, ppath, parent, child;

View File

@@ -8,8 +8,8 @@ import {wrapDelegate} from './route-params.decorator';
export default export default
[ '$rootScope', [ '$rootScope',
'$routeParams', '$stateParams',
function($rootScope, $routeParams) { function($rootScope, $stateParams) {
$rootScope.$on('$routeChangeStart', function(e, newRoute) { $rootScope.$on('$routeChangeStart', function(e, newRoute) {
wrapDelegate(newRoute); wrapDelegate(newRoute);
}); });
@@ -22,7 +22,7 @@ export default
return model; return model;
}, {}); }, {});
$routeParams.model = models; $stateParams.model = models;
} }
}); });
} }

View File

@@ -11,7 +11,7 @@ import FactTemplate from './compare-facts/fact-template';
function controller($rootScope, function controller($rootScope,
$scope, $scope,
$routeParams, $stateParams,
$location, $location,
$q, $q,
moduleOptions, moduleOptions,
@@ -20,15 +20,15 @@ function controller($rootScope,
moment, moment,
_) { _) {
// var inventoryId = $routeParams.id; // var inventoryId = $stateParams.id;
var hostIds = $routeParams.hosts.split(','); var hostIds = $stateParams.hosts.split(',');
var hosts = $routeParams.model.hosts; var hosts = $stateParams.model.hosts;
var moduleParam = $routeParams.module || 'packages'; var moduleParam = $stateParams.module || 'packages';
$scope.compareMode = $scope.compareMode =
hostIds.length === 1 ? 'single-host' : 'host-to-host'; hostIds.length === 1 ? 'single-host' : 'host-to-host';
$scope.hostIds = $routeParams.hosts; $scope.hostIds = $stateParams.hosts;
$scope.inventory = $routeParams.model.inventory; $scope.inventory = $stateParams.model.inventory;
$scope.noModuleData = false; $scope.noModuleData = false;
// this means no scans have been run // this means no scans have been run
@@ -314,7 +314,7 @@ function controller($rootScope,
export default export default
[ '$rootScope', [ '$rootScope',
'$scope', '$scope',
'$routeParams', '$stateParams',
'$location', '$location',
'$q', '$q',
'moduleOptions', 'moduleOptions',

View File

@@ -46,7 +46,6 @@
<div class="container-fluid" id="#content-container"> <div class="container-fluid" id="#content-container">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<!-- <div ng-view id="main-view"></div> -->
<div ui-view id="main-view"></div> <div ui-view id="main-view"></div>
</div> </div>
</div> </div>