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