Add a clear filters button

- This button clear all stored filters and then update results
This commit is contained in:
Jean-Baptiste Bellet
2021-05-21 15:28:18 +02:00
parent ea2cb4e6c0
commit 385446807d
5 changed files with 19 additions and 6 deletions

View File

@@ -30,6 +30,11 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
completed_at_not_null: true
}
$scope.clearFilters = () ->
QueryPersistence.clearFilters()
$scope.setDefaults()
$scope.fetchResults()
$scope.fetchResults = (page=1) ->
startDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_gteq, ' 00:00:00')
endDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_lteq, ' 23:59:59')

View File

@@ -25,3 +25,6 @@ angular.module("admin.indexUtils").factory 'QueryPersistence', (localStorageServ
return true
false
clearFilters: () ->
localStorageService.remove(@storageKey)