1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Merge pull request #1632 from leigh-johnson/TagServiceLogging

Set OPTIONS req endpoint per list field, additional logging for list configs
This commit is contained in:
Leigh 2016-04-21 10:26:46 -04:00
commit 770a964b18
2 changed files with 16 additions and 8 deletions

View File

@ -11,13 +11,13 @@ export default function(){
iterator: 'notification',
index: false,
hover: false,
basePath: 'notifications',
fields: {
name: {
key: true,
label: 'Name',
columnClass: 'col-md-3 col-sm-9 col-xs-9',
linkTo: '/#/notifications/{{notifier.id}}'
linkTo: '/#/notifications/{{notifier.id}}',
},
notification_type: {
label: 'Type',

View File

@ -1,4 +1,4 @@
export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', function(Rest, $q, GetBasePath, Wait, ProcessErrors) {
export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', function(Rest, $q, GetBasePath, Wait, ProcessErrors, $log) {
var that = this;
// parse the field config object to return
// one of the searchTypes (for the left dropdown)
@ -79,11 +79,12 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', function(R
if (needsRequest.length) {
// make the options request to reutrn the typeOptions
Rest.setUrl(basePath);
Rest.setUrl(needsRequest[0].basePath ? needsRequest[0].basePath : basePath);
Rest.options()
.success(function (data) {
var options = data.actions.GET;
needsRequest = needsRequest
try {
var options = data.actions.GET;
needsRequest = needsRequest
.map(function (option) {
option.typeOptions = options[option
.value]
@ -94,8 +95,15 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', function(R
label: i[1]
};
});
return option;
});
return option;
});
}
catch(err){
if (!basePath){
$log.error('Cannot retrieve OPTIONS because the basePath parameter is not set on the list with the following fieldset: \n', list);
}
else { $log.error(err); }
}
Wait("stop");
defer.resolve(joinOptions());
})