From 3125c91494bc32a0c1837eeab8b05fe0f2721e01 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Tue, 9 Jul 2024 16:18:02 +0200 Subject: [PATCH] fix: formatting --- .../widgets/customerOrder-list-widget.js | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/src/VirtoCommerce.OrdersModule.Web/Scripts/widgets/customerOrder-list-widget.js b/src/VirtoCommerce.OrdersModule.Web/Scripts/widgets/customerOrder-list-widget.js index 055d25b1..205df102 100644 --- a/src/VirtoCommerce.OrdersModule.Web/Scripts/widgets/customerOrder-list-widget.js +++ b/src/VirtoCommerce.OrdersModule.Web/Scripts/widgets/customerOrder-list-widget.js @@ -1,46 +1,47 @@ angular.module('virtoCommerce.orderModule') - .controller('virtoCommerce.orderModule.customerOrderListWidgetController', ['$scope', 'platformWebApp.bladeNavigationService', 'virtoCommerce.orderModule.order_res_customerOrders', - function ($scope, bladeNavigationService, customerOrders) { - var blade = $scope.widget.blade; + .controller('virtoCommerce.orderModule.customerOrderListWidgetController', + ['$scope', 'platformWebApp.bladeNavigationService', 'virtoCommerce.orderModule.order_res_customerOrders', + function ($scope, bladeNavigationService, customerOrders) { + var blade = $scope.widget.blade; - var searchCriteria = {}; - if (blade.currentEntity) { - if (blade.currentEntity.memberType === "Organization") { - searchCriteria.organizationId = blade.currentEntityId; - } - else { - var account = _.first(blade.currentEntity.securityAccounts) - if (account) { - searchCriteria.customerId = account.id; + var searchCriteria = {}; + if (blade.currentEntity) { + if (blade.currentEntity.memberType === "Organization") { + searchCriteria.organizationId = blade.currentEntityId; + } + else { + var account = _.first(blade.currentEntity.securityAccounts) + if (account) { + searchCriteria.customerId = account.id; + } } } - } - function refresh() { - $scope.ordersCount = '...'; + function refresh() { + $scope.ordersCount = '...'; - var countSearchCriteria = { - responseGroup: "Default", - take: 0 - }; + var countSearchCriteria = { + responseGroup: "Default", + take: 0 + }; - angular.extend(countSearchCriteria, searchCriteria); + angular.extend(countSearchCriteria, searchCriteria); - customerOrders.search(countSearchCriteria, function (data) { - $scope.ordersCount = data.totalCount; - }); - } + customerOrders.search(countSearchCriteria, function (data) { + $scope.ordersCount = data.totalCount; + }); + } - $scope.openBlade = function () { - var newBlade = { - id: 'orders', - title: 'orders.blades.customerOrder-list.title', - searchCriteria: searchCriteria, - controller: 'virtoCommerce.orderModule.customerOrderListController', - template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-list.tpl.html' + $scope.openBlade = function () { + var newBlade = { + id: 'orders', + title: 'orders.blades.customerOrder-list.title', + searchCriteria: searchCriteria, + controller: 'virtoCommerce.orderModule.customerOrderListController', + template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-list.tpl.html' + }; + bladeNavigationService.showBlade(newBlade, blade); }; - bladeNavigationService.showBlade(newBlade, blade); - }; - refresh() - }]); + refresh() + }]);