diff --git a/src/admin-orderable-list/admin-orderable-list.routes.js b/src/admin-orderable-list/admin-orderable-list.routes.js index 5eea272..c61afa9 100644 --- a/src/admin-orderable-list/admin-orderable-list.routes.js +++ b/src/admin-orderable-list/admin-orderable-list.routes.js @@ -26,7 +26,7 @@ $stateProvider.state('openlmis.administration.orderables', { showInNavigation: true, label: 'adminOrderableList.products', - url: '/orderables?code&name&description&program&page&size&sort', + url: '/orderables?code&name&quarantined&description&program&page&size&sort', controller: 'OrderableListController', templateUrl: 'admin-orderable-list/orderable-list.html', controllerAs: 'vm', @@ -40,8 +40,14 @@ return new ProgramResource().query(); }, orderables: function(paginationService, OrderableResource, $stateParams) { - return paginationService.registerUrl($stateParams, function(stateParams) { - return new OrderableResource().query(stateParams); + return paginationService.registerUrl($stateParams, function() { + if ($stateParams.quarantined === undefined) { + $stateParams.quarantined = 'true'; + } + + var params = angular.copy($stateParams); + + return new OrderableResource().query(params); }); }, canAdd: function(authorizationService, permissionService, ADMINISTRATION_RIGHTS) { diff --git a/src/admin-orderable-list/messages_en.json b/src/admin-orderable-list/messages_en.json index c8dee05..8eca176 100644 --- a/src/admin-orderable-list/messages_en.json +++ b/src/admin-orderable-list/messages_en.json @@ -1,3 +1,4 @@ { - "adminOrderableList.export": "Export" + "adminOrderableList.export": "Export", + "adminOrderableList.showQuarantined": "Show Quarantined" } diff --git a/src/admin-orderable-list/orderable-list.controller.js b/src/admin-orderable-list/orderable-list.controller.js index 7f0a5f0..13bfca7 100644 --- a/src/admin-orderable-list/orderable-list.controller.js +++ b/src/admin-orderable-list/orderable-list.controller.js @@ -59,6 +59,17 @@ */ vm.programs = undefined; + /** + * @ngdoc property + * @propertyOf admin-orderable-list.controller:OrderableListController + * @name showQuarantined + * @type {String} + * + * @description + * Contains quarantined param for searching products. + */ + vm.showQuarantined = undefined; + /** * @ngdoc property * @propertyOf admin-orderable-list.controller:OrderableListController @@ -114,9 +125,12 @@ function onInit() { vm.orderables = orderables; vm.programs = programs; + + vm.showQuarantined = $stateParams.quarantined; vm.code = $stateParams.code; vm.name = $stateParams.name; vm.program = $stateParams.program; + vm.canAdd = canAdd; vm.tableConfig = getTableConfig(); } @@ -132,6 +146,7 @@ function search() { var stateParams = angular.copy($stateParams); + stateParams.quarantined = vm.showQuarantined; stateParams.code = vm.code; stateParams.name = vm.name; stateParams.program = vm.program; diff --git a/src/admin-orderable-list/orderable-list.html b/src/admin-orderable-list/orderable-list.html index 1d6acaf..d63a42f 100644 --- a/src/admin-orderable-list/orderable-list.html +++ b/src/admin-orderable-list/orderable-list.html @@ -7,6 +7,12 @@

{{'adminOrderableList.products' | message}}

+
+ +