mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Add assignment of on list change
This commit is contained in:
parent
01316aebf7
commit
ce4eccc513
@ -21,16 +21,14 @@ export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ProcessErrors', '
|
||||
$scope.canAdd = params.canAdd;
|
||||
});
|
||||
|
||||
$scope.$watch(list.name, assignCredentialKinds);
|
||||
|
||||
// search init
|
||||
$scope.list = list;
|
||||
$scope[`${list.iterator}_dataset`] = Dataset.data;
|
||||
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
|
||||
|
||||
$scope.selected = [];
|
||||
|
||||
$scope[list.name].forEach(credential => {
|
||||
credential.kind = credentialType.getById(credential.credential_type).name;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$on(`${list.iterator}_options`, function(event, data){
|
||||
@ -42,6 +40,12 @@ export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ProcessErrors', '
|
||||
optionsRequestDataProcessing();
|
||||
});
|
||||
|
||||
function assignCredentialKinds () {
|
||||
$scope[list.name].forEach(credential => {
|
||||
credential.kind = credentialType.getById(credential.credential_type).name;
|
||||
});
|
||||
}
|
||||
|
||||
// iterate over the list and add fields like type label, after the
|
||||
// OPTIONS request returns, or the list is sorted/paginated/searched
|
||||
function optionsRequestDataProcessing(){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user