Skip to content

Commit

Permalink
VCST-156: correct pagination in subscription orders (#86)
Browse files Browse the repository at this point in the history
Co-authored-by: AlexTzykin <52533659+AlexTzykin@users.noreply.github.com>
  • Loading branch information
ksavosteev and AlexTzykin authored Jan 17, 2024
1 parent 92ae461 commit 356ef80
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.CoreModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.801.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.800.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ angular.module('virtoCommerce.subscriptionModule')
};

if (blade.currentEntity.id) {
newBlade.refreshCallback = function () {
newBlade.refreshCallback = function (orderBlade, orderBladeCriteria) {
var criteria = {
subscriptionIds: [blade.currentEntity.id]
subscriptionIds: [blade.currentEntity.id],
sort: orderBladeCriteria.sort,
skip: orderBladeCriteria.skip,
take: orderBladeCriteria.take
};

return orders.search(criteria);
Expand All @@ -27,4 +30,18 @@ angular.module('virtoCommerce.subscriptionModule')
}
};

function refresh() {
$scope.ordersCount = '...';

var countSearchCriteria = {
subscriptionIds: [blade.entityNode.id],
take: 0
};

orders.search(countSearchCriteria, function (data) {
$scope.ordersCount = data.totalCount;
});
}

refresh();
}]);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="gridster-cnt" ng-click="openBlade()">
<div class="gridster-cnt" ng-click="openBlade()">
<div class="cnt-inner">
<div class="list-count">{{blade.currentEntity.customerOrders ? blade.currentEntity.customerOrders.length : '...'}}</div>
<div class="list-count">{{ordersCount | number:0}}</div>
<div class="list-t">{{'subscription.widgets.subscription-orders.title' | translate}}</div>
</div>
</div>
2 changes: 1 addition & 1 deletion src/VirtoCommerce.SubscriptionModule.Web/module.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<dependency id="VirtoCommerce.Core" version="3.800.0" />
<dependency id="VirtoCommerce.Customer" version="3.800.0" />
<dependency id="VirtoCommerce.Notifications" version="3.800.0" />
<dependency id="VirtoCommerce.Orders" version="3.800.0" />
<dependency id="VirtoCommerce.Orders" version="3.801.0" />
<dependency id="VirtoCommerce.Store" version="3.800.0" />
</dependencies>

Expand Down

0 comments on commit 356ef80

Please sign in to comment.