Update dataset from event listener instead of queryset search method

This commit is contained in:
Marliana Lara 2019-03-11 14:55:09 -04:00
parent b55212368b
commit ee6445d620
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
3 changed files with 4 additions and 16 deletions

View File

@ -8,10 +8,8 @@ function ListApplicationsController (
$scope,
$state,
Dataset,
GetBasePath,
ProcessErrors,
Prompt,
qs,
resolvedModels,
strings,
Wait
@ -160,10 +158,8 @@ ListApplicationsController.$inject = [
'$scope',
'$state',
'Dataset',
'GetBasePath',
'ProcessErrors',
'Prompt',
'QuerySet',
'resolvedModels',
'ApplicationsStrings',
'Wait'

View File

@ -74,6 +74,8 @@ function ListJobsController (
// are represented in the url.
$scope.$on('updateDataset', (event, dataset, queryset) => {
paginateQuerySet = queryset;
vm.jobs = dataset.results;
vm.job_dataset = dataset;
});
vm.onToolbarSort = (sort) => {
@ -90,12 +92,6 @@ function ListJobsController (
$state.go('.', {
job_search: queryParams
}, { notify: false, location: 'replace' });
qs.search(SearchBasePath, queryParams)
.then(({ data }) => {
vm.jobs = data.results;
vm.job_dataset = data;
});
};
$scope.$watch('vm.job_dataset.count', () => {

View File

@ -80,6 +80,8 @@ function projectsListController (
// Remove this event listener once the page and page_size params
// are represented in the url.
$scope.$on('updateDataset', (event, dataset, queryset) => {
vm.dataset = dataset;
vm.projects = dataset.results;
paginateQuerySet = queryset;
});
@ -97,12 +99,6 @@ function projectsListController (
$state.go('.', {
project_search: queryParams
}, { notify: false, location: 'replace' });
qs.search(GetBasePath(vm.list.basePath), queryParams)
.then(({ data }) => {
vm.dataset = data;
vm.projects = vm.dataset.results;
});
};
$scope.$on('ws-jobs', (e, data) => {