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

Fixes breadcrumbs for all the schedule states

This commit is contained in:
Jared Tabor 2018-05-14 17:17:24 -07:00
parent 77e195bbb9
commit e04b2b7455
No known key found for this signature in database
GPG Key ID: 1B343EC4C3CF7E5C
10 changed files with 21 additions and 13 deletions

View File

@ -33,6 +33,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
{verbosity: inventorySourceData.verbosity}); {verbosity: inventorySourceData.verbosity});
$scope.inventory_source_obj = inventorySourceData; $scope.inventory_source_obj = inventorySourceData;
$scope.breadcrumb.inventory_source_name = inventorySourceData.name;
if (inventorySourceData.credential) { if (inventorySourceData.credential) {
$scope.credential_name = inventorySourceData.summary_fields.credential.name; $scope.credential_name = inventorySourceData.summary_fields.credential.name;
} }

View File

@ -5,7 +5,7 @@ export default {
url: "/edit/:inventory_source_id", url: "/edit/:inventory_source_id",
ncyBreadcrumb: { ncyBreadcrumb: {
parent: "inventories.edit.inventory_sources", parent: "inventories.edit.inventory_sources",
label: N_("INVENTORY SOURCES") label: '{{breadcrumb.inventory_source_name}}'
}, },
views: { views: {
'groupForm@inventories': { 'groupForm@inventories': {

View File

@ -5,8 +5,8 @@ export default {
name: 'inventories.edit.inventory_sources.edit.schedules.edit', name: 'inventories.edit.inventory_sources.edit.schedules.edit',
url: '/:schedule_id', url: '/:schedule_id',
ncyBreadcrumb: { ncyBreadcrumb: {
parent: "inventories.edit.inventory_sources.edit.schedules", parent: 'inventories.edit.inventory_sources.edit.schedules',
label: "{{schedule_obj.name}}" label: "{{breadcrumb.schedule_name}}"
}, },
views: { views: {
'scheduler@inventories': { 'scheduler@inventories': {

View File

@ -156,6 +156,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
$scope.project_obj = data; $scope.project_obj = data;
$scope.name = data.name; $scope.name = data.name;
$scope.breadcrumb.project_name = data.name;
$scope.$emit('projectLoaded'); $scope.$emit('projectLoaded');
Wait('stop'); Wait('stop');
}) })

View File

@ -91,6 +91,9 @@ angular.module('Projects', [])
ncyBreadcrumb: { ncyBreadcrumb: {
label: N_('PROJECTS') label: N_('PROJECTS')
}, },
breadcrumbs: {
edit: '{{breadcrumb.project_name}}'
},
resolve: { resolve: {
add: projectResolve, add: projectResolve,
edit: projectResolve edit: projectResolve

View File

@ -223,6 +223,8 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
$scope.showRRuleDetail = false; $scope.showRRuleDetail = false;
scheduler.setRRule(schedule.rrule); scheduler.setRRule(schedule.rrule);
scheduler.setName(schedule.name); scheduler.setName(schedule.name);
$rootScope.breadcrumb.schedule_name = $scope.schedulerName;
$rootScope.breadcrumb[`${$scope.parentObject.type}_name`] = $scope.parentObject.name;
scheduler.scope.timeZones = timezonesResolve; scheduler.scope.timeZones = timezonesResolve;
scheduler.scope.schedulerTimeZone = scheduleResolve.timezone; scheduler.scope.schedulerTimeZone = scheduleResolve.timezone;
if ($scope.cleanupJob){ if ($scope.cleanupJob){

View File

@ -12,7 +12,6 @@ const jobTemplatesSchedulesListRoute = {
activityStreamId: 'id' activityStreamId: 'id'
}, },
ncyBreadcrumb: { ncyBreadcrumb: {
parent: 'templates.editJobTemplate({job_template_id: parentObject.id})',
label: N_('SCHEDULES') label: N_('SCHEDULES')
}, },
resolve: { resolve: {
@ -72,7 +71,6 @@ const jobTemplatesSchedulesAddRoute = {
} }
}, },
ncyBreadcrumb: { ncyBreadcrumb: {
parent: 'templates.editJobTemplate({job_template_id: parentObject.id})',
label: N_('CREATE SCHEDULE') label: N_('CREATE SCHEDULE')
} }
}; };
@ -87,8 +85,7 @@ const jobTemplatesSchedulesEditRoute = {
} }
}, },
ncyBreadcrumb: { ncyBreadcrumb: {
parent: 'templates.editJobTemplate({job_template_id: parentObject.id})', label: "{{breadcrumb.schedule_name}}"
label: '{{schedule_obj.name}}'
}, },
resolve: editScheduleResolve() resolve: editScheduleResolve()
}; };
@ -104,7 +101,6 @@ const workflowSchedulesRoute = {
activityStreamId: 'id' activityStreamId: 'id'
}, },
ncyBreadcrumb: { ncyBreadcrumb: {
parent: 'templates.editWorkflowJobTemplate({workflow_job_template_id: parentObject.id})',
label: N_('SCHEDULES') label: N_('SCHEDULES')
}, },
resolve: { resolve: {
@ -164,7 +160,6 @@ const workflowSchedulesAddRoute = {
} }
}, },
ncyBreadcrumb: { ncyBreadcrumb: {
parent: 'templates.editWorkflowJobTemplate({workflow_job_template_id: parentObject.id})',
label: N_('CREATE SCHEDULE') label: N_('CREATE SCHEDULE')
} }
}; };
@ -179,8 +174,7 @@ const workflowSchedulesEditRoute = {
} }
}, },
ncyBreadcrumb: { ncyBreadcrumb: {
parent: 'templates.editWorkflowJobTemplate({workflow_job_template_id: parentObject.id})', label: '{{breadcrumb.schedule_name}}'
label: '{{schedule_obj.name}}'
}, },
resolve: editScheduleResolve() resolve: editScheduleResolve()
}; };
@ -195,7 +189,6 @@ const projectsSchedulesListRoute = {
activityStreamId: 'id' activityStreamId: 'id'
}, },
ncyBreadcrumb: { ncyBreadcrumb: {
parent: 'projects.edit({project_id: parentObject.id})',
label: N_('SCHEDULES') label: N_('SCHEDULES')
}, },
resolve: { resolve: {
@ -263,7 +256,7 @@ const projectsSchedulesEditRoute = {
name: 'projects.edit.schedules.edit', name: 'projects.edit.schedules.edit',
route: '/:schedule_id', route: '/:schedule_id',
ncyBreadcrumb: { ncyBreadcrumb: {
label: '{{schedule_obj.name}}' label: "{{breadcrumb.schedule_name}}"
}, },
views: { views: {
'scheduler@projects': { 'scheduler@projects': {

View File

@ -278,6 +278,7 @@ export default
$scope.removeLoadJobs = $scope.$on('LoadJobs', function() { $scope.removeLoadJobs = $scope.$on('LoadJobs', function() {
$scope.job_template_obj = jobTemplateData; $scope.job_template_obj = jobTemplateData;
$scope.name = jobTemplateData.name; $scope.name = jobTemplateData.name;
$scope.breadcrumb.job_template_name = jobTemplateData.name;
var fld, i; var fld, i;
for (fld in form.fields) { for (fld in form.fields) {
if (fld !== 'extra_vars' && fld !== 'survey' && fld !== 'forks' && jobTemplateData[fld] !== null && jobTemplateData[fld] !== undefined) { if (fld !== 'extra_vars' && fld !== 'survey' && fld !== 'forks' && jobTemplateData[fld] !== null && jobTemplateData[fld] !== undefined) {

View File

@ -164,6 +164,9 @@ angular.module('templates', [surveyMaker.name, jobTemplates.name, labels.name, p
activityStreamTarget: 'job_template', activityStreamTarget: 'job_template',
activityStreamId: 'job_template_id' activityStreamId: 'job_template_id'
}, },
breadcrumbs: {
edit: '{{breadcrumb.job_template_name}}'
},
resolve: { resolve: {
edit: { edit: {
jobTemplateData: ['$stateParams', 'TemplatesService', 'ProcessErrors', jobTemplateData: ['$stateParams', 'TemplatesService', 'ProcessErrors',
@ -346,6 +349,9 @@ angular.module('templates', [surveyMaker.name, jobTemplates.name, labels.name, p
activityStreamTarget: 'workflow_job_template', activityStreamTarget: 'workflow_job_template',
activityStreamId: 'workflow_job_template_id' activityStreamId: 'workflow_job_template_id'
}, },
breadcrumbs: {
edit: '{{breadcrumb.workflow_job_template_name}}'
},
resolve: { resolve: {
edit: { edit: {
availableLabels: ['Rest', '$stateParams', 'GetBasePath', 'ProcessErrors', 'TemplatesService', availableLabels: ['Rest', '$stateParams', 'GetBasePath', 'ProcessErrors', 'TemplatesService',

View File

@ -264,6 +264,7 @@ export default [
$scope.workflow_job_template_obj = workflowJobTemplateData; $scope.workflow_job_template_obj = workflowJobTemplateData;
$scope.name = workflowJobTemplateData.name; $scope.name = workflowJobTemplateData.name;
$scope.can_edit = workflowJobTemplateData.summary_fields.user_capabilities.edit; $scope.can_edit = workflowJobTemplateData.summary_fields.user_capabilities.edit;
$scope.breadcrumb.workflow_job_template_name = $scope.name;
let fld, i; let fld, i;
for (fld in form.fields) { for (fld in form.fields) {
if (fld !== 'variables' && fld !== 'survey' && workflowJobTemplateData[fld] !== null && workflowJobTemplateData[fld] !== undefined) { if (fld !== 'variables' && fld !== 'survey' && workflowJobTemplateData[fld] !== null && workflowJobTemplateData[fld] !== undefined) {