1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

fix edit action in Jobs > Schedules tab view, resolves #2258 (#2292)

This commit is contained in:
Leigh 2016-06-10 10:08:55 -04:00 committed by GitHub
parent 67cfc35c79
commit 3113ae584d
2 changed files with 12 additions and 2 deletions

View File

@ -533,6 +533,16 @@ export default
if ($state.includes('inventoryManage')){ if ($state.includes('inventoryManage')){
$state.go('inventoryManage.schedules.edit', {schedule_id: id}); $state.go('inventoryManage.schedules.edit', {schedule_id: id});
} }
else if ($state.current.name === 'jobs'){
// id === schedule object in this case
var stateDictionary = {
// type: stateName
job: 'jobTemplateSchedules.edit',
system_job: 'managementJobSchedules.edit',
project_update: 'projectSchedules.edit',
};
$state.go(stateDictionary[id.type], {schedule_id: id.id, id: id.summary_fields.unified_job_template.id});
}
else{ else{
var base = $state.current.name.split(".")[0]; var base = $state.current.name.split(".")[0];
$state.go(base + ".edit", {schedule_id: id}); $state.go(base + ".edit", {schedule_id: id});

View File

@ -33,7 +33,7 @@ export default
columnClass: 'col-lg-4 col-md-5 col-sm-5 col-xs-7 List-staticColumnAdjacent', columnClass: 'col-lg-4 col-md-5 col-sm-5 col-xs-7 List-staticColumnAdjacent',
sourceModel: 'unified_job_template', sourceModel: 'unified_job_template',
sourceField: 'name', sourceField: 'name',
ngClick: "editSchedule(schedule.id)", ngClick: "editSchedule(schedule)",
awToolTip: "{{ schedule.nameTip | sanitize}}", awToolTip: "{{ schedule.nameTip | sanitize}}",
dataPlacement: "top", dataPlacement: "top",
defaultSearchField: true defaultSearchField: true
@ -72,7 +72,7 @@ export default
columnClass: 'col-lg-3 col-md-3 col-sm-3 col-xs-5', columnClass: 'col-lg-3 col-md-3 col-sm-3 col-xs-5',
"edit": { "edit": {
mode: "all", mode: "all",
ngClick: "editSchedule(schedule.id)", ngClick: "editSchedule(schedule)",
awToolTip: "Edit the schedule", awToolTip: "Edit the schedule",
dataPlacement: "top" dataPlacement: "top"
}, },