mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 18:21:03 -03:30
adding callback for when options are received
This commit is contained in:
@@ -18,13 +18,23 @@ export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSear
|
|||||||
|
|
||||||
// grab a single model from the cache, if present
|
// grab a single model from the cache, if present
|
||||||
if (cache.get(path)) {
|
if (cache.get(path)) {
|
||||||
defer.resolve({[name] : new DjangoSearchModel(name, path, cache.get(path), relations)});
|
defer.resolve({
|
||||||
|
models: {
|
||||||
|
[name] : new DjangoSearchModel(name, path, cache.get(path), relations)
|
||||||
|
},
|
||||||
|
options: cache.get(path)
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.url = path;
|
this.url = path;
|
||||||
resolve = this.options(path)
|
resolve = this.options(path)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
base = res.data.actions.GET;
|
base = res.data.actions.GET;
|
||||||
defer.resolve({[name]: new DjangoSearchModel(name, path, base, relations)});
|
defer.resolve({
|
||||||
|
models: {
|
||||||
|
[name]: new DjangoSearchModel(name, path, base, relations)
|
||||||
|
},
|
||||||
|
options: res
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return defer.promise;
|
return defer.promise;
|
||||||
|
|||||||
@@ -15,8 +15,9 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', '
|
|||||||
path = GetBasePath($scope.basePath) || $scope.basePath;
|
path = GetBasePath($scope.basePath) || $scope.basePath;
|
||||||
relations = getRelationshipFields($scope.dataset.results);
|
relations = getRelationshipFields($scope.dataset.results);
|
||||||
$scope.searchTags = stripDefaultParams($state.params[`${$scope.iterator}_search`]);
|
$scope.searchTags = stripDefaultParams($state.params[`${$scope.iterator}_search`]);
|
||||||
qs.initFieldset(path, $scope.djangoModel, relations).then((models) => {
|
qs.initFieldset(path, $scope.djangoModel, relations).then((data) => {
|
||||||
$scope.models = models;
|
$scope.models = data.models;
|
||||||
|
$scope.$emit(`${$scope.list.iterator}_options`, data.options);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user