Skip to content

Commit

Permalink
Merge branch 'master' into feature/OAM-123
Browse files Browse the repository at this point in the history
  • Loading branch information
olewandowski1 committed May 16, 2024
2 parents a76cfa0 + 22b920b commit 0ba09d5
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 44 deletions.
3 changes: 2 additions & 1 deletion src/order-view/messages_en.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"orderView.view": "View details"
"orderView.view": "View details",
"orderView.requisitionless": "Requisitionless"
}
17 changes: 17 additions & 0 deletions src/order-view/order-view.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@
*/
vm.tableConfig = undefined;

/**
* @ngdoc property
* @propertyOf order-view.controller:OrderViewController
* @name requisitionless
* @type {boolean}
*
* @description
* Sets requisitionless flag
*/
vm.requisitionless = undefined;

/**
* @ngdoc method
* @methodOf order-view.controller:OrderViewController
Expand Down Expand Up @@ -195,6 +206,10 @@
vm.periodEndDate = $stateParams.periodEndDate;
}

if ($stateParams.requisitionless) {
vm.requisitionless = $stateParams.requisitionless;
}

if ($stateParams.status) {
vm.status = vm.orderStatuses.filter(function(status) {
return $stateParams.status === status.value;
Expand Down Expand Up @@ -236,6 +251,7 @@
stateParams.periodStartDate = vm.periodStartDate ? $filter('isoDate')(vm.periodStartDate) : null;
stateParams.periodEndDate = vm.periodEndDate ? $filter('isoDate')(vm.periodEndDate) : null;
stateParams.sort = 'createdDate,desc';
stateParams.requisitionless = vm.requisitionless;

$state.go('openlmis.orders.view', stateParams, {
reload: true
Expand Down Expand Up @@ -408,6 +424,7 @@
{
header: 'orderView.lastUpdated',
propertyPath: 'lastUpdatedDate',
sortable: false,
template: function(item) {
return item.lastUpdatedDate ?
$filter('openlmisDate')(item.lastUpdatedDate) : '';
Expand Down
55 changes: 27 additions & 28 deletions src/order-view/order-view.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
<h2>{{'orderView.viewOrders' | message}}</h2>
<form class="sidebar" ng-submit="vm.loadOrders()">
<label for="supplyingFacility">{{'orderView.supplyingFacility' | message}}</label>
<select id="supplyingFacility"
ng-model="vm.supplyingFacility"
ng-options="facility.name for facility in vm.supplyingFacilities"
required></select>
<input type="submit" value="{{'orderView.search' | message}}" />
<label for="supplyingFacility">{{'orderView.supplyingFacility' | message}}</label>
<select id="supplyingFacility" ng-model="vm.supplyingFacility"
ng-options="facility.name for facility in vm.supplyingFacilities" required></select>
<input type="submit" value="{{'orderView.search' | message}}" />
</form>
<section class="openlmis-table-container order-view">
<form ng-submit="vm.loadOrders()" >
<label for="requestingFacility">{{'orderView.requestingFacility' | message}}</label>
<select id="requestingFacility"
ng-model="vm.requestingFacility"
ng-options="facility.name for facility in vm.requestingFacilities"></select>
<label>{{'orderView.program' | message}}</label>
<select id="program"
ng-model="vm.program"
ng-options="program.name for program in vm.programs"></select>
<label>{{'orderView.status' | message}}</label>
<select id="status"
ng-model="vm.status"
ng-options="status as status.name for status in vm.orderStatuses track by status.value"></select>
<label for=periodStartDate>{{'orderView.periodStart' | message}}</label>
<input id="periodStartDate" type="date" ng-model="vm.periodStartDate" max-date="vm.periodEndDate"/>
<label for=periodEndDate>{{'orderView.periodEnd' | message}}</label>
<input id="periodEndDate" type="date" ng-model="vm.periodEndDate" min-date="vm.periodStartDate"/>
<input type="submit" class="btn btn-primary" value="{{'orderView.search' | message}}"/>
</form>
<openlmis-table table-config="vm.tableConfig"></openlmis-table>
<openlmis-pagination/>
</section>
<form ng-submit="vm.loadOrders()">
<label for="requestingFacility">{{'orderView.requestingFacility' | message}}</label>
<select id="requestingFacility" ng-model="vm.requestingFacility"
ng-options="facility.name for facility in vm.requestingFacilities"></select>
<label>{{'orderView.program' | message}}</label>
<select id="program" ng-model="vm.program"
ng-options="program.name for program in vm.programs"></select>
<label>{{'orderView.status' | message}}</label>
<select id="status" ng-model="vm.status"
ng-options="status as status.name for status in vm.orderStatuses track by status.value"></select>
<label for=periodStartDate>{{'orderView.periodStart' | message}}</label>
<input id="periodStartDate" type="date" ng-model="vm.periodStartDate" max-date="vm.periodEndDate" />
<label for=periodEndDate>{{'orderView.periodEnd' | message}}</label>
<input id="periodEndDate" type="date" ng-model="vm.periodEndDate" min-date="vm.periodStartDate" />
<div>
<label for="requisitionless">{{:: 'orderView.requisitionless' | message}}</label>
<input type="checkbox" ng-model="vm.requisitionless" id="requisitionless" ng-true-value="'true'" ng-false-value="'false'">
</div>
<input type="submit" class="btn btn-primary" value="{{'orderView.search' | message}}" />
</form>
<openlmis-table table-config="vm.tableConfig"></openlmis-table>
<openlmis-pagination />
</section>
2 changes: 1 addition & 1 deletion src/order-view/order-view.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
showInNavigation: true,
templateUrl: 'order-view/order-view.html',
url: '/view?supplyingFacilityId&requestingFacilityId&programId&periodStartDate&periodEndDate&page&size' +
'&status&sort',
'&status&sort&requisitionless',
accessRights: [
FULFILLMENT_RIGHTS.PODS_MANAGE,
FULFILLMENT_RIGHTS.ORDERS_VIEW
Expand Down
10 changes: 0 additions & 10 deletions src/react-components/modals/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ $padding-value: 1rem;
font-size: $font-size-h3;
font-weight: $headings-font-weight;
}

.modal-close-button {
color: red;
@include icon-only('times');
font-size: $font-size-h3;
&:hover {
cursor: pointer;
color: darken(red, 10%);
}
}
}

.react-modal-body {
Expand Down
4 changes: 0 additions & 4 deletions src/requisition-order-create/order-create-summary-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const OrderCreateSummaryModal = ({ isOpen, orders, onSaveClick, onModalClose })
<>
<div className="react-modal-header">
<span className='modal-title'>Orders Summary</span>
<span
className="modal-close-button"
onClick={() => onModalClose()}
></span>
</div>
<div className="react-modal-body">
<TabNavigation
Expand Down

0 comments on commit 0ba09d5

Please sign in to comment.