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

Merge pull request #2180 from mabashian/breadcrumb-audit

Added missing breadcrumbs
This commit is contained in:
Michael Abashian 2016-06-07 09:11:28 -04:00
commit 2a351d1d21
20 changed files with 84 additions and 33 deletions

View File

@ -304,7 +304,7 @@ var tower = angular.module('Tower', [
},
ncyBreadcrumb: {
parent: 'projects',
label: 'EDIT PROJECT'
label: '{{name}}'
}
}).
@ -353,7 +353,7 @@ var tower = angular.module('Tower', [
},
ncyBreadcrumb: {
parent: "teams",
label: "EDIT TEAM"
label: "{{team_obj.name}}"
}
}).
@ -438,7 +438,7 @@ var tower = angular.module('Tower', [
},
ncyBreadcrumb: {
parent: "credentials",
label: "EDIT CREDENTIAL"
label: "{{credential_obj.name}}"
}
}).
@ -472,6 +472,10 @@ var tower = angular.module('Tower', [
controller: UsersEdit,
data: {
activityStreamId: 'user_id'
},
ncyBreadcrumb: {
parent: "users",
label: "{{user_obj.username}}"
}
}).

View File

@ -725,6 +725,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
}
$scope.project_obj = data;
$scope.name = data.name;
$scope.$emit('projectLoaded');
})
.error(function (data, status) {

View File

@ -343,6 +343,8 @@ export function UsersEdit($scope, $rootScope, $location,
$scope.is_superuser = true;
}
$scope.user_obj = data;
CreateSelect2({
element: '#user_user_type',
multiple: false

View File

@ -31,7 +31,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
// loadingFinishedCount = 0,
// base = $location.path().replace(/^\//, '').split('/')[0],
master = {},
id = $stateParams.template_id,
id = $stateParams.id,
relatedSets = {};
// checkSCMStatus, getPlaybooks, callback,
// choicesCount = 0;
@ -76,7 +76,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
Rest.setUrl(defaultUrl + id);
Rest.get()
.success(function (data) {
scope.job_template_obj = data;
scope.name = data.name;
var fld, i;
for (fld in form.fields) {
if (fld !== 'variables' && fld !== 'survey' && data[fld] !== null && data[fld] !== undefined) {
@ -197,7 +197,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
.error(function (data, status) {
ProcessErrors(scope, data, status, form, {
hdr: 'Error!',
msg: 'Failed to retrieve job template: ' + $stateParams.template_id + '. GET status: ' + status
msg: 'Failed to retrieve job template: ' + $stateParams.id + '. GET status: ' + status
});
});
};

View File

@ -167,6 +167,8 @@ export default
scope.cleanupJob = true;
}
scope.schedule_obj = data;
scope.$emit('ScheduleFound');
})
.error(function(data,status){
@ -188,10 +190,7 @@ export default
url,
scheduler;
if (!Empty($stateParams.template_id)) {
url = GetBasePath(base) + $stateParams.template_id + '/schedules/';
}
else if (!Empty($stateParams.id) && base !== 'system_job_templates' && base !== 'inventory') {
if (!Empty($stateParams.id) && base !== 'system_job_templates' && base !== 'inventory') {
url = GetBasePath(base) + $stateParams.id + '/schedules/';
}
else if(base === "inventory"){

View File

@ -16,6 +16,7 @@ export default {
activityStreamId: 'inventory_id'
},
ncyBreadcrumb: {
label: "INVENTORY EDIT"
parent: 'inventories',
label: "{{inventory_obj.name}}"
}
};

View File

@ -20,5 +20,8 @@ export default {
templateUrl: templateUrl('inventories/manage/adhoc/adhoc'),
controller: 'adhocController'
}
},
ncyBreadcrumb: {
label: "RUN COMMAND"
}
};

View File

@ -65,6 +65,7 @@ export default
if (!$scope.canEdit) {
$scope.script = "Script contents hidden";
}
$scope.inventory_script_obj = data;
Wait('stop');
})
.error(function (data, status) {

View File

@ -12,6 +12,10 @@ export default {
templateUrl: templateUrl('inventory-scripts/edit/edit'),
controller: 'inventoryScriptsEditController',
params: {inventory_script: null},
ncyBreadcrumb: {
parent: 'inventoryScripts',
label: "{{inventory_script_obj.name}}"
},
resolve: {
inventory_script:
[ '$state',

View File

@ -14,5 +14,8 @@ export default {
controller: 'HostSummaryController',
templateUrl: templateUrl('job-detail/host-summary/host-summary'),
}
},
ncyBreadcrumb: {
skip: true // Never display this state in breadcrumb.
}
};

View File

@ -334,7 +334,7 @@
function saveCompleted(id) {
$state.go('jobTemplates.edit', {template_id: id}, {reload: true});
$state.go('jobTemplates.edit', {id: id}, {reload: true});
}
if ($scope.removeTemplateSaveSuccess) {

View File

@ -19,7 +19,7 @@
jobTemplateCopyService.set(res)
.success(function(res){
Wait('stop');
$state.go('jobTemplates.edit', {template_id: res.id, copied: true}, {reload: true});
$state.go('jobTemplates.edit', {id: res.id, copied: true}, {reload: true});
});
})
.error(function(res, status){

View File

@ -41,7 +41,7 @@ export default
form = JobTemplateForm(),
base = $location.path().replace(/^\//, '').split('/')[0],
master = {},
id = $stateParams.template_id,
id = $stateParams.id,
relatedSets = {},
checkSCMStatus, getPlaybooks, callback,
choicesCount = 0;
@ -444,7 +444,7 @@ export default
});
};
Rest.setUrl(defaultUrl + $state.params.template_id +
Rest.setUrl(defaultUrl + $state.params.id +
"/labels");
Rest.get()
.success(function(data) {
@ -634,7 +634,7 @@ export default
.filter("[data-select2-tag=true]")
.map((i, val) => ({name: $(val).text()}));
Rest.setUrl(defaultUrl + $state.params.template_id);
Rest.setUrl(defaultUrl + $state.params.id);
Rest.put(data)
.success(function (data) {
$scope.$emit('templateSaveSuccess', data);
@ -653,7 +653,7 @@ export default
$scope.formCancel = function () {
// the form was just copied in the previous state, it's safe to destroy on cancel
if ($state.params.copied){
var defaultUrl = GetBasePath('job_templates') + $state.params.template_id;
var defaultUrl = GetBasePath('job_templates') + $state.params.id;
Rest.setUrl(defaultUrl);
Rest.destroy()
.success(function(){
@ -672,7 +672,7 @@ export default
// Related set: Add button
$scope.add = function (set) {
$rootScope.flashMessage = null;
$location.path('/' + base + '/' + $stateParams.template_id + '/' + set);
$location.path('/' + base + '/' + $stateParams.id + '/' + set);
};
// Related set: Edit button

View File

@ -8,13 +8,17 @@ import {templateUrl} from '../../shared/template-url/template-url.factory';
export default {
name: 'jobTemplates.edit',
url: '/:template_id',
url: '/:id',
templateUrl: templateUrl('job-templates/edit/job-templates-edit'),
controller: 'JobTemplatesEdit',
data: {
activityStreamId: 'template_id'
activityStreamId: 'id'
},
params: {
copied: null
},
ncyBreadcrumb: {
parent: 'jobTemplates',
label: "{{name}}"
}
};

View File

@ -43,7 +43,7 @@ export default {
]
},
ncyBreadcrumb: {
parent: 'setup',
label: 'MANAGEMENT JOBS'
},
parent: 'managementJobsList',
label: 'NOTIFICATIONS'
}
};

View File

@ -20,18 +20,30 @@ export default
name: 'managementJobSchedules',
route: '/management_jobs/:id/schedules',
templateUrl: templateUrl('scheduler/scheduler'),
controller: 'managementJobController'
controller: 'managementJobController',
ncyBreadcrumb: {
parent: 'managementJobsList',
label: 'SCHEDULES'
}
});
$stateExtender.addState({
name: 'managementJobSchedules.add',
route: '/add',
templateUrl: templateUrl('management-jobs/scheduler/schedulerForm'),
controller: 'managementJobAddController'
controller: 'managementJobAddController',
ncyBreadcrumb: {
parent: 'managementJobSchedules',
label: 'CREATE SCHEDULED JOB'
}
});
$stateExtender.addState({
name: 'managementJobSchedules.edit',
route: '/edit/:schedule_id',
templateUrl: templateUrl('management-jobs/scheduler/schedulerForm'),
controller: 'managementJobEditController'
controller: 'managementJobEditController',
ncyBreadcrumb: {
parent: 'managementJobSchedules',
label: 'EDIT SCHEDULED JOB'
}
});
}]);

View File

@ -87,6 +87,7 @@ export default
NotificationsTypeChange.getDetailFields($scope.notification_type.value).forEach(function(field) {
$scope[field[0]] = field[1];
});
$scope.notification_obj = data;
Wait('stop');
})
.error(function (data, status) {

View File

@ -43,6 +43,6 @@ export default {
},
ncyBreadcrumb: {
parent: 'notifications',
label: 'Edit Notification Template'
label: '{{notification_obj.name}}'
}
};

View File

@ -19,19 +19,31 @@ export default
name: 'jobTemplateSchedules',
route: '/job_templates/:id/schedules',
templateUrl: templateUrl("scheduler/scheduler"),
controller: 'schedulerController'
controller: 'schedulerController',
ncyBreadcrumb: {
parent: 'jobTemplates.edit',
label: 'SCHEDULES'
}
});
$stateExtender.addState({
name: 'jobTemplateSchedules.add',
route: '/add',
templateUrl: templateUrl("scheduler/schedulerForm"),
controller: 'schedulerAddController'
controller: 'schedulerAddController',
ncyBreadcrumb: {
parent: 'jobTemplateSchedules',
label: 'CREATE SCHEDULE'
}
});
$stateExtender.addState({
name: 'jobTemplateSchedules.edit',
route: '/:schedule_id',
templateUrl: templateUrl("scheduler/schedulerForm"),
controller: 'schedulerEditController'
controller: 'schedulerEditController',
ncyBreadcrumb: {
parent: 'jobTemplateSchedules',
label: '{{schedule_obj.name}}'
}
});
$stateExtender.addState({
name: 'projectSchedules',
@ -39,7 +51,8 @@ export default
templateUrl: templateUrl("scheduler/scheduler"),
controller: 'schedulerController',
ncyBreadcrumb: {
label: 'PROJECT SCHEDULES'
parent: 'projects.edit',
label: 'SCHEDULES'
}
});
$stateExtender.addState({
@ -48,7 +61,8 @@ export default
templateUrl: templateUrl("scheduler/schedulerForm"),
controller: 'schedulerAddController',
ncyBreadcrumb: {
label: 'PROJECT SCHEDULES ADD'
parent: 'projectSchedules',
label: 'CREATE SCHEDULE'
}
});
$stateExtender.addState({
@ -57,7 +71,8 @@ export default
templateUrl: templateUrl("scheduler/schedulerForm"),
controller: 'schedulerEditController',
ncyBreadcrumb: {
label: 'PROJECT SCHEDULES EDIT'
parent: 'projectSchedules',
label: '{{schedule_obj.name}}'
}
});
$stateExtender.addState({

View File

@ -104,6 +104,7 @@ export default [
Rest.get()
.success(function(data) {
parentObject = data;
$scope.name = data.name;
$scope.$emit('ParentLoaded');
})
.error(function(data, status) {