diff --git a/awx/ui/client/src/helpers/Schedules.js b/awx/ui/client/src/helpers/Schedules.js index fe67527d1d..2dcc6f93e4 100644 --- a/awx/ui/client/src/helpers/Schedules.js +++ b/awx/ui/client/src/helpers/Schedules.js @@ -526,14 +526,27 @@ export default }; scope.editSchedule = function(id) { - var base = $state.current.name.split(".")[0]; - $state.go(base + ".edit", {schedule_id: id}); + if ($state.includes('inventoryManage')){ + $state.go('inventoryManage.schedules.edit', {schedule_id: id}); + } + else{ + var base = $state.current.name.split(".")[0]; + $state.go(base + ".edit", {schedule_id: id}); + } }; scope.addSchedule = function() { - var base = $state.current.name.split(".")[0]; - ParamPass.set(scope.schedule_url); - $state.go(base + ".add"); + if ($state.includes('inventoryManage')){ + scope.schedule_url = parent_scope.current_url.split('?')[0]; + scope.base = 'inventory'; + ParamPass.set(scope.base, scope.schedule_url); + $state.go('inventoryManage.schedules.add'); + } + else{ + var base = $state.current.name.split(".")[0]; + ParamPass.set(scope.schedule_url); + $state.go(base + ".add"); + } }; scope.refreshSchedules = function() { diff --git a/awx/ui/client/src/scheduler/schedulerAdd.controller.js b/awx/ui/client/src/scheduler/schedulerAdd.controller.js index cc9485c0aa..8f3ae65621 100644 --- a/awx/ui/client/src/scheduler/schedulerAdd.controller.js +++ b/awx/ui/client/src/scheduler/schedulerAdd.controller.js @@ -19,7 +19,7 @@ export default ['$compile', '$filter', '$state', '$stateParams', 'AddSchedule', day = $filter('schZeroPad')(dt.getDate(), 2); $scope.$parent.schedulerEndDt = month + '/' + day + '/' + dt.getFullYear(); }; - + // initial end @ midnight values $scope.schedulerEndHour = "00"; $scope.schedulerEndMinute = "00"; @@ -102,7 +102,7 @@ export default ['$compile', '$filter', '$state', '$stateParams', 'AddSchedule', field_id: 'SchedulerForm-extraVars' }); } - else if ($state.current.name === 'inventoryManageSchedules.add'){ + else if ($state.current.name === 'inventoryManage.schedules.add'){ $scope.extraVars = '---'; $scope.parseType = 'yaml'; ParseTypeChange({ @@ -112,7 +112,6 @@ export default ['$compile', '$filter', '$state', '$stateParams', 'AddSchedule', field_id: 'SchedulerForm-extraVars' }); } - AddSchedule({ scope: $scope, callback: 'SchedulesRefresh',