Skip to content

Commit

Permalink
fix(review): include change suggestions from review and update the test
Browse files Browse the repository at this point in the history
  • Loading branch information
DedrickEnc committed Aug 15, 2017
1 parent 6d6cd7f commit 5687998
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
7 changes: 4 additions & 3 deletions client/src/js/components/bhSupplierSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ angular.module('bhima.components')
});

SupplierSelectController.$inject = [
'SupplierService'
'SupplierService', 'NotifyService'
];

/**
* Supplier selection component
*
*/
function SupplierSelectController(Suppliers) {
function SupplierSelectController(Suppliers, Notify) {
var $ctrl = this;

$ctrl.$onInit = function onInit() {
Expand All @@ -34,7 +34,8 @@ function SupplierSelectController(Suppliers) {
Suppliers.read()
.then(function (suppliers) {
$ctrl.suppliers = suppliers;
});
})
.catch(Notify.handleError);
};

// fires the onSelectCallback bound to the component boundary
Expand Down
3 changes: 1 addition & 2 deletions client/src/modules/purchases/list/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@
</div>
</div>

<div class="flex-util" style="min-height : 35px; padding-top : 7px; max-height: initial">
<div class="flex-util bh-filter-bar">
<bh-filters
style="max-width:90%"
filters="PurchaseListCtrl.latestViewFilters"
on-remove-filter="PurchaseListCtrl.onRemoveFilter(filter)">
</bh-filters>
Expand Down
6 changes: 3 additions & 3 deletions client/src/modules/purchases/list/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ angular.module('bhima.controllers')

PurchaseListController.$inject = [
'$state', 'PurchaseOrderService', 'NotifyService', 'ReceiptModal',
'uiGridConstants', 'GridColumnService', 'SearchFilterFormatService',
'uiGridConstants', 'GridColumnService',
'GridStateService', 'SessionService', 'ModalService',
];

Expand All @@ -13,7 +13,7 @@ PurchaseListController.$inject = [
* This module is responsible for the management of Purchase Order Registry.
*/
function PurchaseListController($state, PurchaseOrder, Notify, Receipts, uiGridConstants,
Columns, SearchFilterFormat, GridState, Session, Modal) {
Columns, GridState, Session, Modal) {
var vm = this;

var cacheKey = 'PurchaseRegistry';
Expand Down Expand Up @@ -143,7 +143,7 @@ function PurchaseListController($state, PurchaseOrder, Notify, Receipts, uiGridC
PurchaseOrder.cacheFilters();
vm.latestViewFilters = PurchaseOrder.filters.formatView();
return load(PurchaseOrder.filters.formatHTTP(true));
}).catch(angular.noop);
});
}

// remove a filter with from the filter object, save the filters and reload
Expand Down
12 changes: 6 additions & 6 deletions client/src/modules/purchases/modals/search.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@
<strong translate>FORM.LABELS.STATUS</strong>
</p>

<label class="checkbox-inline">
<input type="checkbox" id="is_confirmed" ng-model="$ctrl.searchQueries.is_confirmed" ng-true-value="1" ng-false-value="0">
<label class="radio-inline">
<input type="radio" id="is_confirmed" name="state" ng-model="$ctrl.searchQueries.is_confirmed" ng-true-value="1" ng-false-value="0">
<span translate>PURCHASES.STATUS.CONFIRMED</span>
</label>

<label class="checkbox-inline">
<input type="checkbox" id="is_received" ng-model="$ctrl.searchQueries.is_received" ng-true-value="1" ng-false-value="0">
<label class="radio-inline">
<input type="radio" id="is_received" name="state" ng-model="$ctrl.searchQueries.is_received" ng-true-value="1" ng-false-value="0">
<span translate>PURCHASES.STATUS.RECEIVED</span>
</label>

<label class="checkbox-inline">
<input type="checkbox" id="is_cancelled" ng-model="$ctrl.searchQueries.is_cancelled" ng-true-value="1" ng-false-value="0">
<label class="radio-inline">
<input type="radio" id="is_cancelled" name="state" ng-model="$ctrl.searchQueries.is_cancelled" ng-true-value="1" ng-false-value="0">
<span translate>PURCHASES.STATUS.CANCELLED</span>
</label>
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/end-to-end/purchases/registry.search.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function PurchaseOrderSearch() {


it(`Choose the status confirmed and should find two Purchases Orders status By "${parameters.status}" for all time`, function () {
const NUM_MATCHING = 1;
const NUM_MATCHING = 4;
element(by.id('is_confirmed')).click();
modal.switchToDefaultFilterTab();
modal.setPeriod('allTime');
Expand Down

0 comments on commit 5687998

Please sign in to comment.