mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 02:01:01 -03:30
post processing for credentials list
This commit is contained in:
@@ -36,6 +36,36 @@ export function CredentialsList($scope, $rootScope, $location, $log,
|
|||||||
$scope.selected = [];
|
$scope.selected = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.$on(`${list.iterator}_options`, function(event, data){
|
||||||
|
$scope.options = data.data.actions.GET;
|
||||||
|
optionsRequestDataProcessing();
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.$watchCollection(`${$scope.list.name}`, function() {
|
||||||
|
optionsRequestDataProcessing();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// iterate over the list and add fields like type label, after the
|
||||||
|
// OPTIONS request returns, or the list is sorted/paginated/searched
|
||||||
|
function optionsRequestDataProcessing(){
|
||||||
|
$scope[list.name].forEach(function(item, item_idx) {
|
||||||
|
var itm = $scope[list.name][item_idx];
|
||||||
|
|
||||||
|
// Set the item type label
|
||||||
|
debugger;
|
||||||
|
if (list.fields.kind && $scope.options &&
|
||||||
|
$scope.options.hasOwnProperty('kind')) {
|
||||||
|
$scope.options.kind.choices.every(function(choice) {
|
||||||
|
if (choice[0] === item.kind) {
|
||||||
|
itm.kind_label = choice[1];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.addCredential = function() {
|
$scope.addCredential = function() {
|
||||||
$state.go('credentials.add');
|
$state.go('credentials.add');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,33 +28,8 @@ export function JobsListController($state, $rootScope, $log, $scope, $compile, $
|
|||||||
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
|
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
|
||||||
|
|
||||||
$scope.showJobType = true;
|
$scope.showJobType = true;
|
||||||
|
|
||||||
// _.forEach($scope[list.name], buildTooltips);
|
|
||||||
// if ($scope.removeChoicesReady) {
|
|
||||||
// $scope.removeChoicesReady();
|
|
||||||
// }
|
|
||||||
// $scope.removeChoicesReady = $scope.$on('choicesReady', function() {
|
|
||||||
// $scope[list.name].forEach(function(item, item_idx) {
|
|
||||||
// var itm = $scope[list.name][item_idx];
|
|
||||||
// if(item.summary_fields && item.summary_fields.source_workflow_job &&
|
|
||||||
// item.summary_fields.source_workflow_job.id){
|
|
||||||
// item.workflow_result_link = `/#/workflows/${item.summary_fields.source_workflow_job.id}`;
|
|
||||||
// }
|
|
||||||
// // Set the item type label
|
|
||||||
// if (list.fields.type) {
|
|
||||||
// $scope.type_choices.every(function(choice) {
|
|
||||||
// if (choice.value === item.type) {
|
|
||||||
// itm.type_label = choice.label;
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// return true;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$on(`${list.iterator}_options`, function(event, data){
|
$scope.$on(`${list.iterator}_options`, function(event, data){
|
||||||
$scope.options = data.data.actions.GET;
|
$scope.options = data.data.actions.GET;
|
||||||
optionsRequestDataProcessing();
|
optionsRequestDataProcessing();
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ export default
|
|||||||
},
|
},
|
||||||
kind: {
|
kind: {
|
||||||
label: i18n._('Type'),
|
label: i18n._('Type'),
|
||||||
|
ngBind: 'credential.kind_label',
|
||||||
excludeModal: true,
|
excludeModal: true,
|
||||||
nosort: true,
|
nosort: true,
|
||||||
columnClass: 'col-md-2 hidden-sm hidden-xs'
|
columnClass: 'col-md-2 hidden-sm hidden-xs'
|
||||||
|
|||||||
Reference in New Issue
Block a user