diff --git a/src/openlmis-facility-program-select/facility-program-cache.service.js b/src/openlmis-facility-program-select/facility-program-cache.service.js index 955229f..cdfd9ca 100644 --- a/src/openlmis-facility-program-select/facility-program-cache.service.js +++ b/src/openlmis-facility-program-select/facility-program-cache.service.js @@ -30,11 +30,11 @@ service.$inject = [ '$q', 'programService', 'authorizationService', 'facilityService', 'currentUserService', - 'permissionService' + 'permissionService', 'loadingModalService' ]; function service($q, programService, authorizationService, facilityService, currentUserService, - permissionService) { + permissionService, loadingModalService) { var modulesWithRights = {}, facilities = [], @@ -162,7 +162,7 @@ */ function loadData(moduleName) { var userId = authorizationService.getUser().user_id; - + loadingModalService.open(); return $q.all([ facilityService.getFacilitiesWithoutWards(), programService.getUserPrograms(userId), @@ -178,6 +178,7 @@ var currentUserDetails = responses[3]; homeFacility = getFacilityById(currentUserDetails.homeFacilityId); + loadingModalService.close(); }); } diff --git a/src/requisition-view-tab/_requisition-view-tab.scss b/src/requisition-view-tab/_requisition-view-tab.scss index b1c69b2..d09d710 100644 --- a/src/requisition-view-tab/_requisition-view-tab.scss +++ b/src/requisition-view-tab/_requisition-view-tab.scss @@ -4,6 +4,16 @@ flex-direction: row-reverse; } + .toolbar { + display: flex; + flex-direction: row; + align-items: center !important; + + .requisition-indicator { + margin-left: auto; + } + } + .hide-line-item { @extend button.danger; @include icon-only('remove'); diff --git a/src/requisition-view-tab/messages_en.json b/src/requisition-view-tab/messages_en.json new file mode 100644 index 0000000..159254d --- /dev/null +++ b/src/requisition-view-tab/messages_en.json @@ -0,0 +1,3 @@ +{ + "requisitionPatientsViewTab.filterPlaceholder": "Filter by product name" +} diff --git a/src/requisition-view-tab/requisition-view-tab.controller.js b/src/requisition-view-tab/requisition-view-tab.controller.js index b473dae..5d60ec6 100644 --- a/src/requisition-view-tab/requisition-view-tab.controller.js +++ b/src/requisition-view-tab/requisition-view-tab.controller.js @@ -143,9 +143,16 @@ */ vm.columns = undefined; + vm.orderableFilterProperties = { + name: undefined + }; + + vm.filteredItems = undefined; + function onInit() { vm.lineItems = lineItems; vm.items = items; + vm.filteredItems = lineItems; vm.requisition = requisition; vm.columns = columns; vm.userCanEdit = canAuthorize || canSubmit || canUnskipRequisitionItemWhenApproving; @@ -198,7 +205,7 @@ * * @description * Caches given requisition in the local storage. - * + * * @return {Promise} the promise resolved after adding requisition to the local storage */ function cacheRequisition() { @@ -384,6 +391,13 @@ return vm.requisition.requisitionLineItems.filter(isSkippedFullSupply).length; } + vm.filterByOrderableParams = function() { + vm.filteredItems = vm.lineItems.filter(function(item) { + return item.orderable.fullProductName.toLowerCase() + .includes(vm.orderableFilterProperties.name.toLowerCase()); + }); + }; + function getNoProductsMessage() { return fullSupply ? 'requisitionViewTab.noFullSupplyProducts' : diff --git a/src/requisition-view-tab/requisition-view-tab.html b/src/requisition-view-tab/requisition-view-tab.html index 75f14dd..7b64b76 100644 --- a/src/requisition-view-tab/requisition-view-tab.html +++ b/src/requisition-view-tab/requisition-view-tab.html @@ -1,5 +1,6 @@