Merge pull request #3732 from furinvader/bugs/21702-unnecessary-loading-overlay

[21702] Unnecessary page reload after changing search term when filtering work packages by their subject
pull/3745/head
Oliver Günther 9 years ago
commit e542518eae
  1. 5
      frontend/app/work_packages/controllers/work-packages-list-controller.js
  2. 14
      frontend/app/work_packages/directives/query-filter-directive.js

@ -215,10 +215,9 @@ module.exports = function($scope, $rootScope, $state, $stateParams, $location, l
function updateResults() {
$scope.$broadcast('openproject.workPackages.updateResults');
$scope.refreshWorkPackages = WorkPackageService.getWorkPackages($scope.projectIdentifier, $scope.query, PaginationService.getPaginationOptions())
WorkPackageService.getWorkPackages($scope.projectIdentifier,
$scope.query, PaginationService.getPaginationOptions())
.then(setupWorkPackagesTable);
return $scope.refreshWorkPackages;
}
// More

@ -54,7 +54,9 @@ module.exports = function(
scope.showValueOptionsAsSelect = !scope.filter.isSingleInputField();
if (scope.showValueOptionsAsSelect) {
WorkPackageLoadingHelper.withLoading(scope, QueryService.getAvailableFilterValues, [scope.filter.name, scope.projectIdentifier])
WorkPackageLoadingHelper.withLoading(scope, QueryService.getAvailableFilterValues,
[scope.filter.name, scope.projectIdentifier])
.then(buildOptions)
.then(addStandardOptions)
.then(function(options) {
@ -71,12 +73,18 @@ module.exports = function(
// Filter updates
scope.$watch('filter.operator', function(operator) {
if(operator && scope.filter.requiresValues) scope.showValuesInput = scope.filter.requiresValues();
if(operator && scope.filter.requiresValues){
scope.showValuesInput = scope.filter.requiresValues();
}
});
scope.$watch('filter', function(filter, oldFilter) {
var isEmptyText = filter.type === 'text' && filter.textValue === undefined;
if (filter !== oldFilter) {
if (filter.isConfigured() && (filterChanged(filter, oldFilter) || valueReset(filter, oldFilter))) {
if ((isEmptyText || filter.isConfigured())
&& (filterChanged(filter, oldFilter) || valueReset(filter, oldFilter))) {
PaginationService.resetPage();
scope.$emit('queryStateChange');
scope.$emit('workPackagesRefreshRequired');

Loading…
Cancel
Save