mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Merge pull request #2290 from Haokun-Chen/2254
update jobs/schedules to schedules in route and breadcrumb
This commit is contained in:
commit
fb56585636
@ -2,13 +2,13 @@
|
|||||||
<div class="tab-pane" id="jobs-page">
|
<div class="tab-pane" id="jobs-page">
|
||||||
<at-panel ng-cloak id="htmlTemplate">
|
<at-panel ng-cloak id="htmlTemplate">
|
||||||
<div>
|
<div>
|
||||||
<div ng-hide="$state.includes('jobs.schedules')">
|
<div ng-hide="$state.includes('schedules')">
|
||||||
<at-panel-heading hide-dismiss="true">
|
<at-panel-heading hide-dismiss="true">
|
||||||
<translate>JOBS</translate>
|
<translate>JOBS</translate>
|
||||||
</at-panel-heading>
|
</at-panel-heading>
|
||||||
<div ui-view="jobsList"></div>
|
<div ui-view="jobsList"></div>
|
||||||
</div>
|
</div>
|
||||||
<div ng-hide="!$state.includes('jobs.schedules')">
|
<div ng-hide="!$state.includes('schedules')">
|
||||||
<at-panel-heading hide-dismiss="true">
|
<at-panel-heading hide-dismiss="true">
|
||||||
<translate>SCHEDULES</translate>
|
<translate>SCHEDULES</translate>
|
||||||
</at-panel-heading>
|
</at-panel-heading>
|
||||||
|
@ -45,6 +45,27 @@ function LegacyRedirect ($stateRegistry) {
|
|||||||
return { state: destination, params: { type: 'project', id } };
|
return { state: destination, params: { type: 'project', id } };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'legacySchedulesList',
|
||||||
|
url: '/jobs/schedules?schedule_search',
|
||||||
|
redirectTo: (trans) => {
|
||||||
|
const {
|
||||||
|
schedule_search // eslint-disable-line camelcase
|
||||||
|
} = trans.params();
|
||||||
|
return { state: 'schedules', params: { schedule_search } };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'legacySchedule',
|
||||||
|
url: '/jobs/schedules/:schedule_id?schedule_search',
|
||||||
|
redirectTo: (trans) => {
|
||||||
|
const {
|
||||||
|
schedule_id, // eslint-disable-line camelcase
|
||||||
|
schedule_search // eslint-disable-line camelcase
|
||||||
|
} = trans.params();
|
||||||
|
return { state: 'schedules.edit', params: { schedule_id, schedule_search } };
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
routes.forEach(state => $stateRegistry.register(state));
|
routes.forEach(state => $stateRegistry.register(state));
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
</at-side-nav-item>
|
</at-side-nav-item>
|
||||||
<at-side-nav-item icon-class="fa-spinner" route="jobs" name="JOBS">
|
<at-side-nav-item icon-class="fa-spinner" route="jobs" name="JOBS">
|
||||||
</at-side-nav-item>
|
</at-side-nav-item>
|
||||||
<at-side-nav-item icon-class="fa-calendar" route="jobs.schedules" name="SCHEDULES">
|
<at-side-nav-item icon-class="fa-calendar" route="schedules" name="SCHEDULES">
|
||||||
</at-side-nav-item>
|
</at-side-nav-item>
|
||||||
<at-side-nav-item icon-class="fa-columns" route="portalMode.myJobs" name="MY_VIEW">
|
<at-side-nav-item icon-class="fa-columns" route="portalMode.myJobs" name="MY_VIEW">
|
||||||
</at-side-nav-item>
|
</at-side-nav-item>
|
||||||
|
@ -11,7 +11,7 @@ function AtSideNavItemController ($scope, strings) {
|
|||||||
if ($scope.name === 'portal mode') {
|
if ($scope.name === 'portal mode') {
|
||||||
vm.isRoute = (current && current.indexOf('portalMode') === 0);
|
vm.isRoute = (current && current.indexOf('portalMode') === 0);
|
||||||
} else if (current && current.indexOf($scope.route) === 0) {
|
} else if (current && current.indexOf($scope.route) === 0) {
|
||||||
if (current.indexOf('jobs.schedules') === 0 && $scope.route === 'jobs') {
|
if (current.indexOf('schedules') === 0 && $scope.route === 'jobs') {
|
||||||
vm.isRoute = false;
|
vm.isRoute = false;
|
||||||
} else {
|
} else {
|
||||||
vm.isRoute = true;
|
vm.isRoute = true;
|
||||||
|
@ -101,7 +101,7 @@ export default [
|
|||||||
}
|
}
|
||||||
buildTooltips(itm);
|
buildTooltips(itm);
|
||||||
|
|
||||||
if (!$state.is('jobs.schedules')){
|
if (!$state.is('schedules')){
|
||||||
if($state.current.name.endsWith('.add')) {
|
if($state.current.name.endsWith('.add')) {
|
||||||
itm.linkToDetails = `^.edit({schedule_id:schedule.id})`;
|
itm.linkToDetails = `^.edit({schedule_id:schedule.id})`;
|
||||||
}
|
}
|
||||||
@ -157,8 +157,8 @@ export default [
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.editSchedule = function(schedule) {
|
$scope.editSchedule = function(schedule) {
|
||||||
if ($state.is('jobs.schedules')){
|
if ($state.is('schedules')){
|
||||||
$state.go('jobs.schedules.edit', {schedule_id: schedule.id});
|
$state.go('schedules.edit', {schedule_id: schedule.id});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($state.current.name.endsWith('.add')) {
|
if($state.current.name.endsWith('.add')) {
|
||||||
|
@ -269,7 +269,7 @@ const projectsSchedulesEditRoute = {
|
|||||||
|
|
||||||
const jobsSchedulesRoute = {
|
const jobsSchedulesRoute = {
|
||||||
searchPrefix: 'schedule',
|
searchPrefix: 'schedule',
|
||||||
name: 'jobs.schedules',
|
name: 'schedules',
|
||||||
route: '/schedules',
|
route: '/schedules',
|
||||||
params: {
|
params: {
|
||||||
schedule_search: {
|
schedule_search: {
|
||||||
@ -284,7 +284,6 @@ const jobsSchedulesRoute = {
|
|||||||
activityStream: false,
|
activityStream: false,
|
||||||
},
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'jobs',
|
|
||||||
label: N_('SCHEDULES')
|
label: N_('SCHEDULES')
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
@ -312,8 +311,9 @@ const jobsSchedulesRoute = {
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
views: {
|
views: {
|
||||||
'schedulesList@jobs': {
|
'@': {
|
||||||
templateProvider: function(ScheduleList, generateList){
|
templateProvider: function(ScheduleList, generateList){
|
||||||
|
ScheduleList.well = true;
|
||||||
let html = generateList.build({
|
let html = generateList.build({
|
||||||
list: ScheduleList,
|
list: ScheduleList,
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
@ -339,14 +339,14 @@ const parentResolve = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const jobsSchedulesEditRoute = {
|
const jobsSchedulesEditRoute = {
|
||||||
name: 'jobs.schedules.edit',
|
name: 'schedules.edit',
|
||||||
route: '/:schedule_id',
|
route: '/:schedule_id',
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'jobs.schedules',
|
parent: 'schedules',
|
||||||
label: "{{breadcrumb.schedule_name}}"
|
label: "{{breadcrumb.schedule_name}}"
|
||||||
},
|
},
|
||||||
views: {
|
views: {
|
||||||
'scheduler@jobs': {
|
'@': {
|
||||||
controller: 'schedulerEditController',
|
controller: 'schedulerEditController',
|
||||||
templateUrl: templateUrl("scheduler/schedulerForm"),
|
templateUrl: templateUrl("scheduler/schedulerForm"),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user