Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OLMIS-7987: Move Submit Requisitionless Orders functionalities from Angola to Core instance #68

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Improvements:
* [OLMIS-7954](https://openlmis.atlassian.net/browse/OLMIS-7954): Added fixes to improve performance on login page
* [OLMIS-7991](https://openlmis.atlassian.net/browse/OLMIS-7991): Filtered out lots that not expired on Issue screeen

New functionalities that are backwards-compatible:
* [OLMIS-7987](https://openlmis.atlassian.net/browse/OLMIS-7987): Move Submit Requisitionless Orders functionalities from Angola to Core instance

Bug fixes:
* [OLMIS-7748](https://openlmis.atlassian.net/browse/OLMIS-7748): Fix filtering 'includeInactive' on the Physical Inventory page

Expand Down
28 changes: 16 additions & 12 deletions src/stock-card-summary/stock-card-summary-repository-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,24 @@
var lotIds = getLotIds(stockCardSummariesPage.content),
orderableIds = getOrderableIds(stockCardSummariesPage.content);

return $q.all([
orderableResource.query({
var promisses = [];

if (orderableIds.length > 0) {
promisses.push(orderableResource.query({
id: orderableIds
}),
lotService.query({
}));
}

if (lotIds.length > 0) {
promisses.push(lotService.query({
id: lotIds
})
])
}));
}

return $q.all(promisses)
.then(function(responses) {
var orderablePage = responses[0],
lotPage = responses[1];
var orderablePage = responses[0] || [],
lotPage = responses[1] || [];

return combineResponses(stockCardSummariesPage, orderablePage.content,
lotPage.content, params);
Expand Down Expand Up @@ -145,7 +152,6 @@
stockCardSummariesPage.content,
params.includeInactive === 'true'
);

}

return stockCardSummariesPage;
Expand Down Expand Up @@ -197,7 +203,6 @@
return items;
}, []);
}

/**
* @param {StockCardSummary[]} stockCardSummariesPage
* @param {Boolean} includeInactive
Expand All @@ -207,7 +212,6 @@
if (includeInactive) {
return stockCardSummariesPage;
}

return _.filter(stockCardSummariesPage, function(summary) {
summary.canFulfillForMe = _.filter(summary.canFulfillForMe, function(item) {
return item.active === true;
Expand All @@ -216,4 +220,4 @@
}, []);
}
}
})();
})();
Loading