diff --git a/awx/ui/client/src/adhoc/adhoc.controller.js b/awx/ui/client/src/adhoc/adhoc.controller.js index 28a692a0df..14827600f9 100644 --- a/awx/ui/client/src/adhoc/adhoc.controller.js +++ b/awx/ui/client/src/adhoc/adhoc.controller.js @@ -9,7 +9,7 @@ * @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. */ -function adhocController($q, $scope, $rootScope, $location, $routeParams, +function adhocController($q, $scope, $rootScope, $location, $stateParams, CheckPasswords, PromptForPasswords, CreateLaunchDialog, adhocForm, GenerateForm, Rest, ProcessErrors, ClearScope, GetBasePath, GetChoices, 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(), hostPattern = $rootScope.hostPatterns || "all"; @@ -199,7 +199,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams, // launch the job with the provided form data $scope.launchJob = function () { - var adhocUrl = GetBasePath('inventory') + $routeParams.inventory_id + + var adhocUrl = GetBasePath('inventory') + $stateParams.inventory_id + '/ad_hoc_commands/', fld, data={}, html; html = '
/g, ' '); //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]; // break; // } //} } - if ($routeParams.source) { + if ($stateParams.source) { scope[list.iterator + 'SearchField'] = 'source'; scope[list.iterator + 'SelectShow'] = true; scope[list.iterator + 'SearchSelectOpts'] = list.fields.source.searchOptions; scope[list.iterator + 'SearchFieldLabel'] = list.fields.source.label.replace(//g, ' '); 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]; break; } } - if ($routeParams.status) { - scope[list.iterator + 'ExtraParms'] = 'inventory_source__status__icontains=' + $routeParams.status; + if ($stateParams.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 + 'SearchValue'] = list.fields.has_external_source.searchValue; 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; } - if ($routeParams.inventory_source__id) { + if ($stateParams.inventory_source__id) { 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'; } @@ -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', '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) { 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 - if ($routeParams.name) { + if ($stateParams.name) { $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 + 'SearchFieldLabel'] = list.fields.name.label; } - if ($routeParams.id) { + if ($stateParams.id) { $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 + 'SearchFieldLabel'] = list.fields.id.label; $scope[HomeHostList.iterator + 'SearchSelectValue'] = null; } - if ($routeParams.has_active_failures) { + if ($stateParams.has_active_failures) { $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 + '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); @@ -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', 'Find', 'ShowJobSummary', 'ViewJob' ]; diff --git a/awx/ui/client/src/controllers/Inventories.js b/awx/ui/client/src/controllers/Inventories.js index 840ee6069c..63d94bb5a7 100644 --- a/awx/ui/client/src/controllers/Inventories.js +++ b/awx/ui/client/src/controllers/Inventories.js @@ -13,7 +13,7 @@ import '../job-templates/main'; 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, ClearScope, ProcessErrors, GetBasePath, Wait, Stream, EditInventoryProperties, Find, Empty, LogViewer, $state) { @@ -80,42 +80,42 @@ export function InventoriesList($scope, $rootScope, $location, $log, url: defaultUrl }); - if ($routeParams.name) { + if ($stateParams.name) { $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 + 'SearchFieldLabel'] = InventoryList.fields.name.label; $scope[InventoryList.iterator + 'SearchSelectValue'] = null; } - if ($routeParams.has_active_failures) { + if ($stateParams.has_active_failures) { $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 + '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: 0 }; } - if ($routeParams.has_inventory_sources) { + if ($stateParams.has_inventory_sources) { $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 + '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: 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 $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 + 'SearchFieldLabel'] = InventoryList.fields.inventory_sources_with_failures.label; $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', '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, LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON) { @@ -405,7 +405,7 @@ export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $r LookUpInit({ scope: $scope, form: form, - current_item: ($routeParams.organization_id) ? $routeParams.organization_id : null, + current_item: ($stateParams.organization_id) ? $stateParams.organization_id : null, list: OrganizationList, field: 'organization', 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', '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, LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, RelatedSearchInit, RelatedPaginateInit, Prompt, PlaybookRun, CreateDialog, deleteJobTemplate) { @@ -469,7 +469,7 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $ var defaultUrl = GetBasePath('inventory'), form = InventoryForm(), generator = GenerateForm, - inventory_id = $routeParams.inventory_id, + inventory_id = $stateParams.inventory_id, master = {}, fld, json_data, data, 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', 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'PlaybookRun', 'CreateDialog', 'deleteJobTemplate' @@ -1049,7 +1049,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location, $scope.$emit('InventoryLoaded'); }) .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 }); }); @@ -1139,7 +1139,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location, } groups.push(group.id); 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); setActiveGroupBreadcrumb(); loadGroups(group.related.children, group.id); diff --git a/awx/ui/client/src/controllers/JobDetail.js b/awx/ui/client/src/controllers/JobDetail.js index d820b2b172..4ff5ab4d48 100644 --- a/awx/ui/client/src/controllers/JobDetail.js +++ b/awx/ui/client/src/controllers/JobDetail.js @@ -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, UpdateDOM, EventViewer, DeleteJob, PlaybookRun, HostEventsViewer, LoadPlays, LoadTasks, LoadHosts, HostsEdit, ParseVariableString, GetChoices, fieldChoices, fieldLabels, EditSchedule) { ClearScope(); - var job_id = $routeParams.id, + var job_id = $stateParams.id, scope = $scope, api_complete = false, refresh_count = 0, @@ -793,7 +793,7 @@ export function JobDetailController ($location, $rootScope, $filter, $scope, $co }) .error(function(data, status) { 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', 'JobIsFinished', 'SetTaskStyles', 'DigestEvent', 'UpdateDOM', 'EventViewer', 'DeleteJob', 'PlaybookRun', 'HostEventsViewer', 'LoadPlays', 'LoadTasks', 'LoadHosts', 'HostsEdit', 'ParseVariableString', 'GetChoices', 'fieldChoices', 'fieldLabels', 'EditSchedule' diff --git a/awx/ui/client/src/controllers/JobEvents.js b/awx/ui/client/src/controllers/JobEvents.js index 41771424e5..ad4c7c09ab 100644 --- a/awx/ui/client/src/controllers/JobEvents.js +++ b/awx/ui/client/src/controllers/JobEvents.js @@ -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, FormatDate, EventView, Refresh, Wait) { ClearScope(); 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, page; list.base = $location.path(); - $scope.job_id = $routeParams.id; + $scope.job_id = $stateParams.id; $rootScope.flashMessage = null; $scope.selected = []; $scope.expand = true; //on load, automatically expand all nodes @@ -207,7 +207,7 @@ export function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log url: defaultUrl }); - page = ($routeParams.page) ? parseInt($routeParams.page,10) - 1 : null; + page = ($stateParams.page) ? parseInt($stateParams.page,10) - 1 : null; PaginateInit({ scope: $scope, @@ -217,13 +217,13 @@ export function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log }); // Called from Inventories tab, host failed events link: - if ($routeParams.host) { + if ($stateParams.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.search(list.iterator, $routeParams.page); + $scope.search(list.iterator, $stateParams.page); $scope.toggle = function (id) { 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', '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) { ClearScope(); var form = JobEventsForm, 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.reset(); @@ -276,7 +276,7 @@ export function JobEventsEdit($scope, $rootScope, $compile, $location, $log, $ro .success(function (data) { var cDate, fld, n, rows; $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) { switch (fld) { case 'status': @@ -335,14 +335,14 @@ export function JobEventsEdit($scope, $rootScope, $compile, $location, $log, $ro Wait('stop'); }) .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 }); }); $scope.navigateBack = function () { - var url = '/jobs/' + $routeParams.job_id + '/job_events'; - if ($routeParams.page) { - url += '?page=' + $routeParams.page; + var url = '/jobs/' + $stateParams.job_id + '/job_events'; + if ($stateParams.page) { + url += '?page=' + $stateParams.page; } $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' ]; diff --git a/awx/ui/client/src/controllers/JobHosts.js b/awx/ui/client/src/controllers/JobHosts.js index 6270422d6f..59c7643c9d 100644 --- a/awx/ui/client/src/controllers/JobHosts.js +++ b/awx/ui/client/src/controllers/JobHosts.js @@ -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, JobStatusToolTip) { ClearScope(); var list = JobHostList, - defaultUrl = GetBasePath('jobs') + $routeParams.id + '/job_host_summaries/', + defaultUrl = GetBasePath('jobs') + $stateParams.id + '/job_host_summaries/', view = GenerateList, inventory; - $scope.job_id = $routeParams.id; + $scope.job_id = $stateParams.id; $scope.host_id = null; // 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: - if ($routeParams.host_name) { + if ($stateParams.host_name) { $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.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', 'GetBasePath', 'Refresh', 'JobStatusToolTip', 'Wait' ]; diff --git a/awx/ui/client/src/controllers/JobStdout.js b/awx/ui/client/src/controllers/JobStdout.js index 3b07f31502..91c0f3f322 100644 --- a/awx/ui/client/src/controllers/JobStdout.js +++ b/awx/ui/client/src/controllers/JobStdout.js @@ -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(); - var job_id = $routeParams.id, + var job_id = $stateParams.id, api_complete = false, stdout_url, 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']; diff --git a/awx/ui/client/src/controllers/JobTemplates.js b/awx/ui/client/src/controllers/JobTemplates.js index b8ea1bd888..1567413ebb 100644 --- a/awx/ui/client/src/controllers/JobTemplates.js +++ b/awx/ui/client/src/controllers/JobTemplates.js @@ -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, 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: - if ($routeParams.name) { + if ($stateParams.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; } @@ -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', 'ProcessErrors', 'GetBasePath', 'JobTemplateForm', 'CredentialList', 'LookUpInit', '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, InventoryList, CredentialList, ProjectList, LookUpInit, md5Setup, ParseTypeChange, Wait, Empty, ToJSON, CallbackHelpInit, SurveyControllerInit, Prompt, GetChoices) { @@ -289,7 +289,7 @@ export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location LookUpInit({ scope: $scope, form: form, - current_item: ($routeParams.inventory_id !== undefined) ? $routeParams.inventory_id : null, + current_item: ($stateParams.inventory_id !== undefined) ? $stateParams.inventory_id : null, list: InventoryList, field: 'inventory', 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, // 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 also means the job is a scan job. $scope.job_type.value = 'scan'; $scope.jobTypeChange(); - $scope.inventory = $routeParams.inventory_id; - Rest.setUrl(GetBasePath('inventory') + $routeParams.inventory_id + '/'); + $scope.inventory = $stateParams.inventory_id; + Rest.setUrl(GetBasePath('inventory') + $stateParams.inventory_id + '/'); Rest.get() .success(function (data) { $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', 'GetBasePath', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', '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, CredentialList, ProjectList, LookUpInit, GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate, Wait, Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, JobsControllerInit, JobsListUpdate, @@ -679,7 +679,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio form = JobTemplateForm(), base = $location.path().replace(/^\//, '').split('/')[0], master = {}, - id = $routeParams.template_id, + id = $stateParams.template_id, relatedSets = {}, checkSCMStatus, getPlaybooks, callback, choicesCount = 0; @@ -955,7 +955,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio .error(function (data, status) { ProcessErrors($scope, data, status, form, { 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 $scope.add = function (set) { $rootScope.flashMessage = null; - $location.path('/' + base + '/' + $routeParams.template_id + '/' + set); + $location.path('/' + base + '/' + $stateParams.template_id + '/' + set); }; // Related set: Edit button @@ -1223,7 +1223,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio .error(function (data, status) { ProcessErrors($scope, data, status, form, { 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', 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', 'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt', diff --git a/awx/ui/client/src/controllers/Jobs.js b/awx/ui/client/src/controllers/Jobs.js index 0ed23890a2..9407ceb901 100644 --- a/awx/ui/client/src/controllers/Jobs.js +++ b/awx/ui/client/src/controllers/Jobs.js @@ -11,7 +11,7 @@ */ -export function JobsListController ($rootScope, $log, $scope, $compile, $routeParams, +export function JobsListController ($rootScope, $log, $scope, $compile, $stateParams, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope, LoadJobsScope, AllJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait) { @@ -49,14 +49,14 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa if (AllJobsList.fields.type) { AllJobsList.fields.type.searchOptions = $scope.type_choices; } - if ($routeParams.status) { + if ($stateParams.status) { search_params[AllJobsList.iterator + 'SearchField'] = 'status'; search_params[AllJobsList.iterator + 'SelectShow'] = true; search_params[AllJobsList.iterator + 'SearchSelectOpts'] = AllJobsList.fields.status.searchOptions; search_params[AllJobsList.iterator + 'SearchFieldLabel'] = AllJobsList.fields.status.label.replace(//g,' '); search_params[AllJobsList.iterator + 'SearchType'] = ''; 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]; 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', 'AllJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait']; diff --git a/awx/ui/client/src/controllers/Organizations.js b/awx/ui/client/src/controllers/Organizations.js index b2d6ca3d80..9bddadce5d 100644 --- a/awx/ui/client/src/controllers/Organizations.js +++ b/awx/ui/client/src/controllers/Organizations.js @@ -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) { ClearScope(); @@ -28,7 +28,7 @@ export function OrganizationsList($routeParams, $scope, $rootScope, $location, $ LoadBreadCrumbs(); 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 }); } @@ -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', '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, ReturnToCaller, Wait) { @@ -119,7 +119,7 @@ export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, generator.clearApiErrors(); Wait('start'); var url = GetBasePath(base); - url += (base !== 'organizations') ? $routeParams.project_id + '/organizations/' : ''; + url += (base !== 'organizations') ? $stateParams.project_id + '/organizations/' : ''; Rest.setUrl(url); Rest.post({ name: $scope.name, description: $scope.description }) .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' ]; -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) { ClearScope(); @@ -160,7 +160,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, defaultUrl = GetBasePath('organizations'), base = $location.path().replace(/^\//, '').split('/')[0], master = {}, - id = $routeParams.organization_id, + id = $stateParams.organization_id, relatedSets = {}; $scope.organization_id = id; @@ -208,7 +208,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, }) .error(function (data, status) { 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 $scope.add = function (set) { $rootScope.flashMessage = null; - $location.path('/' + base + '/' + $routeParams.organization_id + '/' + set); + $location.path('/' + base + '/' + $stateParams.organization_id + '/' + set); }; // Related set: Edit button @@ -267,7 +267,7 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, var action = function () { Wait('start'); - var url = defaultUrl + $routeParams.organization_id + '/' + set + '/'; + var url = defaultUrl + $stateParams.organization_id + '/' + set + '/'; Rest.setUrl(url); Rest.post({ id: itm_id, disassociate: 1 }) .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', 'Wait', 'Stream' ]; diff --git a/awx/ui/client/src/controllers/Portal.js b/awx/ui/client/src/controllers/Portal.js index d249008167..e2e059ca0c 100644 --- a/awx/ui/client/src/controllers/Portal.js +++ b/awx/ui/client/src/controllers/Portal.js @@ -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){ 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' ]; diff --git a/awx/ui/client/src/controllers/Projects.js b/awx/ui/client/src/controllers/Projects.js index 4083dbe2d4..2a6b404f69 100644 --- a/awx/ui/client/src/controllers/Projects.js +++ b/awx/ui/client/src/controllers/Projects.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @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, Refresh, Wait, Stream, GetChoices, Empty, Find, LogViewer, GetProjectIcon, GetProjectToolTip, $filter) { @@ -24,10 +24,10 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, view = GenerateList, base = $location.path().replace(/^\//, '').split('/')[0], 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; - 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; $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.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 - defaultUrl += '?status=' + $routeParams.status; + defaultUrl += '?status=' + $stateParams.status; } SearchInit({ @@ -133,27 +133,27 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, url: defaultUrl }); - if ($routeParams.scm_type) { + if ($stateParams.scm_type) { $scope[list.iterator + 'SearchType'] = ''; $scope[list.iterator + 'SearchField'] = 'scm_type'; $scope[list.iterator + 'SelectShow'] = true; $scope[list.iterator + 'SearchSelectOpts'] = list.fields.scm_type.searchOptions; $scope[list.iterator + 'SearchFieldLabel'] = list.fields.scm_type.label.replace(//g, ' '); 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]; break; } } - } else if ($routeParams.status) { + } else if ($stateParams.status) { $scope[list.iterator + 'SearchType'] = ''; - $scope[list.iterator + 'SearchValue'] = $routeParams.status; + $scope[list.iterator + 'SearchValue'] = $stateParams.status; $scope[list.iterator + 'SearchField'] = 'status'; $scope[list.iterator + 'SelectShow'] = true; $scope[list.iterator + 'SearchFieldLabel'] = list.fields.status.label; $scope[list.iterator + 'SearchSelectOpts'] = 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]; 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', 'SelectionInit', 'ProjectUpdate', 'Refresh', 'Wait', 'Stream', 'GetChoices', 'Empty', 'Find', '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, CredentialList, GetChoices, DebugForm, Wait) { @@ -482,7 +482,7 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $rout 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'); Rest.setUrl(url); 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', 'ReturnToCaller', 'GetProjectPath', 'LookUpInit', 'OrganizationList', 'CredentialList', 'GetChoices', '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, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, Authorization, CredentialList, LookUpInit, GetChoices, Empty, DebugForm, Wait, Stream, SchedulesControllerInit, SchedulesListInit, SchedulesList, ProjectUpdate) { @@ -552,10 +552,10 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $rou // Inject dynamic view var form = ProjectsForm(), generator = GenerateForm, - defaultUrl = GetBasePath('projects') + $routeParams.id + '/', + defaultUrl = GetBasePath('projects') + $stateParams.id + '/', base = $location.path().replace(/^\//, '').split('/')[0], master = {}, i, - id = $routeParams.id, + id = $stateParams.id, relatedSets = {}; SchedulesList.well = false; @@ -779,7 +779,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $rou // Related set: Add button $scope.add = function (set) { $rootScope.flashMessage = null; - $location.path('/' + base + '/' + $routeParams.id + '/' + set); + $location.path('/' + base + '/' + $stateParams.id + '/' + set); }; // 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', 'GetBasePath', 'ReturnToCaller', 'GetProjectPath', 'Authorization', 'CredentialList', 'LookUpInit', 'GetChoices', 'Empty', 'DebugForm', 'Wait', 'Stream', 'SchedulesControllerInit', 'SchedulesListInit', 'SchedulesList', 'ProjectUpdate' diff --git a/awx/ui/client/src/controllers/Schedules.js b/awx/ui/client/src/controllers/Schedules.js index df73c19f51..b553ad114e 100644 --- a/awx/ui/client/src/controllers/Schedules.js +++ b/awx/ui/client/src/controllers/Schedules.js @@ -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) { ClearScope(); @@ -61,7 +61,7 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, Get } $scope.removeChoicesReady = $scope.$on('choicesReady', function() { // Load the parent object - id = $routeParams.id; + id = $stateParams.id; url = GetBasePath(base) + id + '/'; Rest.setUrl(url); 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' ]; diff --git a/awx/ui/client/src/controllers/Teams.js b/awx/ui/client/src/controllers/Teams.js index 2eb49e7ac2..1de7ba61aa 100644 --- a/awx/ui/client/src/controllers/Teams.js +++ b/awx/ui/client/src/controllers/Teams.js @@ -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, 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', '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, OrganizationList, SearchInit, PaginateInit, GetBasePath, LookUpInit, Wait) { 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', '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, OrganizationList, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) { @@ -185,7 +185,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP form = TeamForm, base = $location.path().replace(/^\//, '').split('/')[0], master = {}, - id = $routeParams.team_id, + id = $stateParams.team_id, relatedSets = {}; $scope.permission_label = {}; @@ -290,7 +290,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP Wait('stop'); }) .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 }); Wait('stop'); }); @@ -315,7 +315,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP generator.clearApiErrors(); Wait('start'); $rootScope.flashMessage = null; - Rest.setUrl(defaultUrl + $routeParams.team_id + '/'); + Rest.setUrl(defaultUrl + $stateParams.team_id + '/'); for (fld in form.fields) { data[fld] = $scope[fld]; } @@ -334,7 +334,7 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP .error(function (data, status) { Wait('stop'); 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; if (set === 'permissions') { if ($scope.PermissionAddAllowed) { - $location.path('/' + base + '/' + $routeParams.team_id + '/' + set + '/add'); + $location.path('/' + base + '/' + $stateParams.team_id + '/' + set + '/add'); } else { Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.'); } } 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) { $rootScope.flashMessage = null; if (set === 'permissions') { - $location.path('/' + base + '/' + $routeParams.team_id + '/' + set + '/' + id); + $location.path('/' + base + '/' + $stateParams.team_id + '/' + set + '/' + id); } else { $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.'); } } else { - url = defaultUrl + $routeParams.team_id + '/' + set + '/'; + url = defaultUrl + $stateParams.team_id + '/' + set + '/'; Rest.setUrl(url); Rest.post({ id: itm_id, disassociate: 1 }) .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', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath', 'CheckAccess', 'OrganizationList', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect' ]; diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index 6c2aa2bd1a..7d7633b95d 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -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) { ClearScope(); @@ -21,10 +21,10 @@ export function UsersList($scope, $rootScope, $location, $log, $routeParams, Res generator = GenerateList, base = $location.path().replace(/^\//, '').split('/')[0], mode = (base === 'users') ? 'edit' : 'select', - url = (base === 'organizations') ? GetBasePath('organizations') + $routeParams.organization_id + '/users/' : - GetBasePath('teams') + $routeParams.team_id + '/users/'; + url = (base === 'organizations') ? GetBasePath('organizations') + $stateParams.organization_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 = []; @@ -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', '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) { ClearScope(); @@ -130,15 +130,15 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log, $routePa LookUpInit({ scope: $scope, form: form, - current_item: ($routeParams.organization_id !== undefined) ? $routeParams.organization_id : null, + current_item: ($stateParams.organization_id !== undefined) ? $stateParams.organization_id : null, list: OrganizationList, field: 'organization', input_type: 'radio' }); - if ($routeParams.organization_id) { - $scope.organization = $routeParams.organization_id; - Rest.setUrl(GetBasePath('organizations') + $routeParams.organization_id + '/'); + if ($stateParams.organization_id) { + $scope.organization = $stateParams.organization_id; + Rest.setUrl(GetBasePath('organizations') + $stateParams.organization_id + '/'); Rest.get() .success(function (data) { $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', '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, Prompt, CheckAccess, ResetForm, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) { @@ -218,7 +218,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP form = UserForm, base = $location.path().replace(/^\//, '').split('/')[0], master = {}, - id = $routeParams.user_id, + id = $stateParams.user_id, relatedSets = {}; $scope.permission_label = {}; @@ -324,7 +324,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP }) .error(function (data, status) { 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 () { @@ -368,7 +368,7 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP } }) .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 }); }); } @@ -402,12 +402,12 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeP $rootScope.flashMessage = null; if (set === 'permissions') { if ($scope.PermissionAddAllowed) { - $location.path('/' + base + '/' + $routeParams.user_id + '/' + set + '/add'); + $location.path('/' + base + '/' + $stateParams.user_id + '/' + set + '/add'); } else { Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.'); } } 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) { $rootScope.flashMessage = null; if (set === 'permissions') { - $location.path('/users/' + $routeParams.user_id + '/permissions/' + id); + $location.path('/users/' + $stateParams.user_id + '/permissions/' + id); } else { $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.'); } } else { - url = defaultUrl + $routeParams.user_id + '/' + set + '/'; + url = defaultUrl + $stateParams.user_id + '/' + set + '/'; Rest.setUrl(url); Rest.post({ 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', 'GetBasePath', 'Prompt', 'CheckAccess', 'ResetForm', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect' ]; diff --git a/awx/ui/client/src/helpers/Adhoc.js b/awx/ui/client/src/helpers/Adhoc.js index 4fc00c19d4..ef2baed981 100644 --- a/awx/ui/client/src/helpers/Adhoc.js +++ b/awx/ui/client/src/helpers/Adhoc.js @@ -53,11 +53,11 @@ export default * */ // Submit request to run an adhoc comamand - .factory('AdhocRun', ['$location','$routeParams', 'LaunchJob', + .factory('AdhocRun', ['$location','$stateParams', 'LaunchJob', 'PromptForPasswords', 'Rest', 'GetBasePath', 'Alert', 'ProcessErrors', 'Wait', 'Empty', 'PromptForCredential', 'PromptForVars', 'PromptForSurvey' , 'CreateLaunchDialog', - function ($location, $routeParams, LaunchJob, PromptForPasswords, + function ($location, $stateParams, LaunchJob, PromptForPasswords, Rest, GetBasePath, Alert, ProcessErrors, Wait, Empty, PromptForCredential, PromptForVars, PromptForSurvey, CreateLaunchDialog) { diff --git a/awx/ui/client/src/helpers/Events.js b/awx/ui/client/src/helpers/Events.js index 29e1f7803c..be58e72661 100644 --- a/awx/ui/client/src/helpers/Events.js +++ b/awx/ui/client/src/helpers/Events.js @@ -13,9 +13,9 @@ export default 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', - 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) { return function (params) { diff --git a/awx/ui/client/src/helpers/Groups.js b/awx/ui/client/src/helpers/Groups.js index 4ce763747f..d775398a99 100644 --- a/awx/ui/client/src/helpers/Groups.js +++ b/awx/ui/client/src/helpers/Groups.js @@ -707,11 +707,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name * 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', 'LookUpInit', 'Empty', 'Wait', 'GetChoices', 'UpdateGroup', 'SourceChange', 'Find', '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, GetChoices, UpdateGroup, SourceChange, Find, ParseVariableString, ToJSON, GroupsScheduleListInit, 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 * */ -.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', - 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) { return function (params) { @@ -1994,9 +1994,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name * 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', - 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) { return function (params) { diff --git a/awx/ui/client/src/helpers/Hosts.js b/awx/ui/client/src/helpers/Hosts.js index 524b55de6c..693137ccd8 100644 --- a/awx/ui/client/src/helpers/Hosts.js +++ b/awx/ui/client/src/helpers/Hosts.js @@ -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', - function($routeParams, Empty, InventoryHosts, GetBasePath, SearchInit, PaginateInit, Wait, SetHostStatus, SetStatus, + function($stateParams, Empty, InventoryHosts, GetBasePath, SearchInit, PaginateInit, Wait, SetHostStatus, SetStatus, ApplyEllipsis) { return function(params) { @@ -209,9 +209,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name, SearchInit({ scope: scope, set: 'hosts', list: list, url: url }); 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 + 'SearchValue'] = $routeParams.host_name; + scope[list.iterator + 'SearchValue'] = $stateParams.host_name; scope[list.iterator + 'SearchField'] = 'name'; scope[list.iterator + 'SearchFieldLabel'] = list.fields.name.label; 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', - 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) { 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', - 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) { 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', '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, ParseVariableString, CreateDialog, TextareaResize) { 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', - function($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, $stateParams, Rest, Alert, Prompt, ProcessErrors, GetBasePath, HostsReload, Wait) { return function(params) { // 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', - 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) { return function(params) { diff --git a/awx/ui/client/src/helpers/JobSubmission.js b/awx/ui/client/src/helpers/JobSubmission.js index 9e641dc388..f50f1c2bd2 100644 --- a/awx/ui/client/src/helpers/JobSubmission.js +++ b/awx/ui/client/src/helpers/JobSubmission.js @@ -469,9 +469,9 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm, }]) .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, - ParseVariableString, ToJSON, ProcessErrors, $routeParams) { + ParseVariableString, ToJSON, ProcessErrors, $stateParams) { return function(params) { var // parent_scope = params.scope, @@ -513,16 +513,16 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm, }) .error(function (data, status) { 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', - 'GenerateForm', 'ProcessErrors', '$routeParams' , + 'GenerateForm', 'ProcessErrors', '$stateParams' , function($filter, $compile, Wait, Alert, CredentialForm, CreateLaunchDialog, GetBasePath, Rest, Empty, - GenerateForm, ProcessErrors, $routeParams) { + GenerateForm, ProcessErrors, $stateParams) { return function(params) { var html = params.html || "", id= params.id, @@ -698,16 +698,16 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm, }) .error(function (data, status) { 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', - 'ParseVariableString', 'ToJSON', 'ProcessErrors', '$routeParams', 'Empty', + 'ParseVariableString', 'ToJSON', 'ProcessErrors', '$stateParams', 'Empty', function($compile, Rest, GetBasePath, TextareaResize,CreateLaunchDialog, GenerateForm, JobVarsPromptForm, Wait, - ParseVariableString, ToJSON, ProcessErrors, $routeParams, Empty) { + ParseVariableString, ToJSON, ProcessErrors, $stateParams, Empty) { return function(params) { var scope = params.scope, callback = params.callback, @@ -752,9 +752,9 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm, * */ // 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', - 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) { return function (params) { var //parent_scope = params.scope, diff --git a/awx/ui/client/src/helpers/JobTemplates.js b/awx/ui/client/src/helpers/JobTemplates.js index f5d59c419b..eaf0e8df18 100644 --- a/awx/ui/client/src/helpers/JobTemplates.js +++ b/awx/ui/client/src/helpers/JobTemplates.js @@ -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', - 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) { return function(params) { @@ -31,7 +31,7 @@ angular.module('JobTemplatesHelper', ['Utilities']) // loadingFinishedCount = 0, // base = $location.path().replace(/^\//, '').split('/')[0], master = {}, - id = $routeParams.template_id, + id = $stateParams.template_id, relatedSets = {}; // checkSCMStatus, getPlaybooks, callback, // choicesCount = 0; @@ -192,7 +192,7 @@ angular.module('JobTemplatesHelper', ['Utilities']) .error(function (data, status) { ProcessErrors(scope, data, status, form, { 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 }); }); }; diff --git a/awx/ui/client/src/helpers/Jobs.js b/awx/ui/client/src/helpers/Jobs.js index cd3bb677af..64b231180e 100644 --- a/awx/ui/client/src/helpers/Jobs.js +++ b/awx/ui/client/src/helpers/Jobs.js @@ -369,8 +369,8 @@ export default * Called from JobsList controller to load each section or list on the page * */ - .factory('LoadJobsScope', ['$routeParams', '$location', '$compile', 'SearchInit', 'PaginateInit', 'generateList', 'JobsControllerInit', 'JobsListUpdate', 'SearchWidget', - function($routeParams, $location, $compile, SearchInit, PaginateInit, GenerateList, JobsControllerInit, JobsListUpdate, SearchWidget) { + .factory('LoadJobsScope', ['$stateParams', '$location', '$compile', 'SearchInit', 'PaginateInit', 'generateList', 'JobsControllerInit', 'JobsListUpdate', 'SearchWidget', + function($stateParams, $location, $compile, SearchInit, PaginateInit, GenerateList, JobsControllerInit, JobsListUpdate, SearchWidget) { return function(params) { var parent_scope = params.parent_scope, scope = params.scope, @@ -429,9 +429,9 @@ export default }); if (base === 'jobs' && list.name === 'all_jobs') { - if ($routeParams.id__int) { + if ($stateParams.id__int) { 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'; } } diff --git a/awx/ui/client/src/helpers/Schedules.js b/awx/ui/client/src/helpers/Schedules.js index 5d45098833..36161cce3e 100644 --- a/awx/ui/client/src/helpers/Schedules.js +++ b/awx/ui/client/src/helpers/Schedules.js @@ -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', - function($location, $routeParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost) { + function($location, $stateParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost) { return function(params) { var scope = params.scope, callback= params.callback, @@ -246,14 +246,14 @@ export default url = GetBasePath(base), scheduler; - if (!Empty($routeParams.template_id)) { - url += $routeParams.template_id + '/schedules/'; + if (!Empty($stateParams.template_id)) { + url += $stateParams.template_id + '/schedules/'; } - else if (!Empty($routeParams.id)) { - url += $routeParams.id + '/schedules/'; + else if (!Empty($stateParams.id)) { + url += $stateParams.id + '/schedules/'; } - else if (!Empty($routeParams.management_job)) { - url += $routeParams.management_job + '/schedules/'; + else if (!Empty($stateParams.management_job)) { + url += $stateParams.management_job + '/schedules/'; if(scope.management_job.id === 4){ scope.isFactCleanup = true; scope.keep_unit_choices = [{ @@ -690,9 +690,9 @@ export default * 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', - function($compile, $location, $routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit) { + function($compile, $location, $stateParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit) { return function(params) { var parent_scope = params.parent_scope, scope = params.scope, @@ -746,9 +746,9 @@ export default parent_scope.$emit('listLoaded'); }); - if ($routeParams.id__int) { + if ($stateParams.id__int) { scope[list.iterator + 'SearchField'] = 'id'; - scope[list.iterator + 'SearchValue'] = $routeParams.id__int; + scope[list.iterator + 'SearchValue'] = $stateParams.id__int; scope[list.iterator + 'SearchFieldLabel'] = 'ID'; } diff --git a/awx/ui/client/src/job-templates/survey-maker/surveys/add.factory.js b/awx/ui/client/src/job-templates/survey-maker/surveys/add.factory.js index 62b8576d06..0bb42dd274 100644 --- a/awx/ui/client/src/job-templates/survey-maker/surveys/add.factory.js +++ b/awx/ui/client/src/job-templates/survey-maker/surveys/add.factory.js @@ -1,5 +1,5 @@ export default - function AddFactory($location, $routeParams, ShowSurveyModal, Wait) { + function AddFactory($location, $stateParams, ShowSurveyModal, Wait) { return function(params) { var scope = params.scope; @@ -19,7 +19,7 @@ export default AddFactory.$inject = [ '$location', - '$routeParams', + '$stateParams', 'showSurvey', 'Wait' ]; diff --git a/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js b/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js index 857136096f..b303a2f470 100644 --- a/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js +++ b/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js @@ -1,5 +1,5 @@ export default - function EditFactory($routeParams, SchedulerInit, ShowSurveyModal, Wait, Rest, ProcessErrors, GetBasePath, GenerateForm, + function EditFactory($stateParams, SchedulerInit, ShowSurveyModal, Wait, Rest, ProcessErrors, GetBasePath, GenerateForm, Empty, AddSurvey) { return function(params) { var scope = params.scope, @@ -66,7 +66,7 @@ export default EditFactory.$inject = - [ '$routeParams', + [ '$stateParams', 'SchedulerInit', 'showSurvey', 'Wait', diff --git a/awx/ui/client/src/management-jobs/schedule/schedule.controller.js b/awx/ui/client/src/management-jobs/schedule/schedule.controller.js index 8abdc80bf6..06fe45d71b 100644 --- a/awx/ui/client/src/management-jobs/schedule/schedule.controller.js +++ b/awx/ui/client/src/management-jobs/schedule/schedule.controller.js @@ -11,10 +11,10 @@ */ export default [ - '$scope', '$location', '$routeParams', 'SchedulesList', 'Rest', + '$scope', '$location', '$stateParams', 'SchedulesList', 'Rest', 'ProcessErrors', 'GetBasePath', 'Wait','LoadSchedulesScope', 'GetChoices', 'Stream', 'management_job', '$rootScope', - function($scope, $location, $routeParams, SchedulesList, Rest, + function($scope, $location, $stateParams, SchedulesList, Rest, ProcessErrors, GetBasePath, Wait, LoadSchedulesScope, GetChoices, Stream, management_job, $rootScope) { var base, id, url, parentObject; @@ -58,7 +58,7 @@ export default [ } $scope.removeChoicesReady = $scope.$on('choicesReady', function() { // Load the parent object - id = $routeParams.management_job; + id = $stateParams.management_job; url = GetBasePath('system_job_templates') + id + '/'; Rest.setUrl(url); Rest.get() diff --git a/awx/ui/client/src/permissions/add/add.controller.js b/awx/ui/client/src/permissions/add/add.controller.js index f90e9120a7..19c535769f 100644 --- a/awx/ui/client/src/permissions/add/add.controller.js +++ b/awx/ui/client/src/permissions/add/add.controller.js @@ -10,15 +10,15 @@ * @description This controller for permissions add */ 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', - function($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, $stateParams, permissionsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, ReturnToCaller, InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, permissionsCategoryChange, fieldChoices, fieldLabels) { ClearScope(); // Inject dynamic view var form = permissionsForm, 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], master = {}; diff --git a/awx/ui/client/src/permissions/edit/edit.controller.js b/awx/ui/client/src/permissions/edit/edit.controller.js index e209a309e2..bef7503f85 100644 --- a/awx/ui/client/src/permissions/edit/edit.controller.js +++ b/awx/ui/client/src/permissions/edit/edit.controller.js @@ -10,15 +10,15 @@ * @description This controller for permissions edit */ 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', - 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) { + ['$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, $stateParams, permissionsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, Prompt, GetBasePath, InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, permissionsCategoryChange, fieldChoices, fieldLabels) { ClearScope(); var generator = GenerateForm, form = permissionsForm, - base_id = ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id, - id = $routeParams.permission_id, + base_id = ($stateParams.user_id !== undefined) ? $stateParams.user_id : $stateParams.team_id, + id = $stateParams.permission_id, defaultUrl = GetBasePath('base') + 'permissions/' + id + '/', base = $location.path().replace(/^\//, '').split('/')[0], master = {}; @@ -168,7 +168,7 @@ export default }) .error(function (data, status) { ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update Permission: ' + - $routeParams.id + '. PUT status: ' + status }); + $stateParams.id + '. PUT status: ' + status }); }); }; diff --git a/awx/ui/client/src/permissions/list/list.controller.js b/awx/ui/client/src/permissions/list/list.controller.js index 341150b71b..cc97bd080e 100644 --- a/awx/ui/client/src/permissions/list/list.controller.js +++ b/awx/ui/client/src/permissions/list/list.controller.js @@ -12,14 +12,14 @@ export default - ['$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, $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, $stateParams, Rest, Alert, permissionsList, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, CheckAccess, Wait, fieldChoices, fieldLabels, permissionsSearchSelect) { ClearScope(); var list = permissionsList, 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), generator = GenerateList; @@ -56,7 +56,7 @@ export default 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/'; $scope.selected = []; diff --git a/awx/ui/client/src/rest/restServices.factory.js b/awx/ui/client/src/rest/restServices.factory.js index 32473c2a1b..8ecc75eb74 100644 --- a/awx/ui/client/src/rest/restServices.factory.js +++ b/awx/ui/client/src/rest/restServices.factory.js @@ -35,7 +35,7 @@ * the respoinse details and initiate action. For example: * * ``` - * var url = GetBasePath('inventories') + $routeParams.id + '/'; + * var url = GetBasePath('inventories') + $stateParams.id + '/'; * Rest.setUrl(url); * Rest.get() * .success(function(data) { diff --git a/awx/ui/client/src/shared/Utilities.js b/awx/ui/client/src/shared/Utilities.js index 5cc39aa8b3..90ad7cbe9b 100644 --- a/awx/ui/client/src/shared/Utilities.js +++ b/awx/ui/client/src/shared/Utilities.js @@ -274,8 +274,8 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter']) ]) -.factory('LoadBreadCrumbs', ['$rootScope', '$routeParams', '$location', 'Empty', - function ($rootScope, $routeParams, $location, Empty) { +.factory('LoadBreadCrumbs', ['$rootScope', '$stateParams', '$location', 'Empty', + function ($rootScope, $stateParams, $location, Empty) { return function (crumb) { var title, found, j, i, paths, ppath, parent, child; diff --git a/awx/ui/client/src/shared/route-extensions/model-listener.config.js b/awx/ui/client/src/shared/route-extensions/model-listener.config.js index 92567cae03..e685ab1a30 100644 --- a/awx/ui/client/src/shared/route-extensions/model-listener.config.js +++ b/awx/ui/client/src/shared/route-extensions/model-listener.config.js @@ -8,8 +8,8 @@ import {wrapDelegate} from './route-params.decorator'; export default [ '$rootScope', - '$routeParams', - function($rootScope, $routeParams) { + '$stateParams', + function($rootScope, $stateParams) { $rootScope.$on('$routeChangeStart', function(e, newRoute) { wrapDelegate(newRoute); }); @@ -22,7 +22,7 @@ export default return model; }, {}); - $routeParams.model = models; + $stateParams.model = models; } }); } diff --git a/awx/ui/client/src/system-tracking/system-tracking.controller.js b/awx/ui/client/src/system-tracking/system-tracking.controller.js index 1cf8e787d0..6512342ff1 100644 --- a/awx/ui/client/src/system-tracking/system-tracking.controller.js +++ b/awx/ui/client/src/system-tracking/system-tracking.controller.js @@ -11,7 +11,7 @@ import FactTemplate from './compare-facts/fact-template'; function controller($rootScope, $scope, - $routeParams, + $stateParams, $location, $q, moduleOptions, @@ -20,15 +20,15 @@ function controller($rootScope, moment, _) { - // var inventoryId = $routeParams.id; - var hostIds = $routeParams.hosts.split(','); - var hosts = $routeParams.model.hosts; - var moduleParam = $routeParams.module || 'packages'; + // var inventoryId = $stateParams.id; + var hostIds = $stateParams.hosts.split(','); + var hosts = $stateParams.model.hosts; + var moduleParam = $stateParams.module || 'packages'; $scope.compareMode = hostIds.length === 1 ? 'single-host' : 'host-to-host'; - $scope.hostIds = $routeParams.hosts; - $scope.inventory = $routeParams.model.inventory; + $scope.hostIds = $stateParams.hosts; + $scope.inventory = $stateParams.model.inventory; $scope.noModuleData = false; // this means no scans have been run @@ -314,7 +314,7 @@ function controller($rootScope, export default [ '$rootScope', '$scope', - '$routeParams', + '$stateParams', '$location', '$q', 'moduleOptions', diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 9c042bcc42..8b529e3b3e 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -46,7 +46,6 @@
-