Very crudely reload table

pull/4239/head
Oliver Günther 9 years ago
parent c55822d80c
commit f6ab6de17b
  1. 7
      frontend/app/components/api/api-work-packages/api-work-packages.service.ts
  2. 10
      frontend/app/components/routing/wp-list/wp-list.controller.ts
  3. 1
      frontend/app/components/wp-edit/wp-edit-form.directive.ts

@ -35,12 +35,13 @@ export class ApiWorkPackagesService {
public list(offset:number, pageSize:number, query:api.ex.Query) {
var workPackages;
var uncachedProvider = this.apiV3.setDefaultHttpFields({cache: false});
if (query.projectId) {
workPackages = this.apiV3.service('work_packages', this.apiV3.one('projects', query.projectId));
if (query.projectId) {
workPackages = uncachedProvider.service('work_packages', this.apiV3.one('projects', query.projectId));
}
else {
workPackages = this.apiV3.service('work_packages');
workPackages = uncachedProvider.service('work_packages');
}
return workPackages.getList(this.queryAsV3Params(offset, pageSize, query));

@ -33,7 +33,6 @@ function WorkPackagesListController($scope,
WorkPackagesTableService,
WorkPackageService,
wpListService,
apiWorkPackages,
ProjectService,
QueryService,
PaginationService,
@ -208,8 +207,13 @@ function WorkPackagesListController($scope,
updateResults();
});
$rootScope.$on('workPackagesBackgroundRefreshRequired', function () {
updateResults();
$rootScope.$on('workPackagesRefreshInBackground', function () {
wpListService.fromQueryInstance($scope.query, $scope.projectIdentifier)
.then(function (json:api.ex.WorkPackagesMeta) {
// $scope.workPackagesBackground = json;
$scope.$broadcast('openproject.workPackages.updateResults');
$scope.$evalAsync(_ => setupWorkPackagesTable(json));
});
});
$rootScope.$on('queryClearRequired', _ => wpListService.clearUrlQueryParams);

@ -44,6 +44,7 @@ export class WorkPackageEditFormController {
.then(() => {
angular.forEach(this.fields, field => field.setErrorState(false));
deferred.resolve();
this.$rootScope.$emit('workPackagesRefreshInBackground');
})
.catch((error) => {
if (!error.data) {

Loading…
Cancel
Save