Skip to content

Commit

Permalink
Merge branch 'release/3.822.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Jul 11, 2024
2 parents 7f2ea68 + 5766eb4 commit 77d6937
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.821.0</VersionPrefix>
<VersionPrefix>3.822.0</VersionPrefix>
<VersionSuffix>
</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ protected virtual IList<IFilter> GetPermanentFilters(CustomerOrderSearchCriteria
result.Add(FilterHelper.CreateTermFilter("customerid", criteria.CustomerIds));
}

if (!criteria.OrganizationIds.IsNullOrEmpty())
{
result.Add(FilterHelper.CreateTermFilter("organizationid", criteria.OrganizationIds));
}

if (!string.IsNullOrEmpty(criteria.EmployeeId))
{
result.Add(FilterHelper.CreateTermFilter("employeeid", criteria.EmployeeId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@
"revenue-per-customer": "Revenue per customer",
"title": "Order Statistics",
"not-authorized": "You do not currently have access to this feature. Please contact your account administrator for access."
},
"customerOrder-list": {
"title": "Orders"
}
},
"dialogs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<div class="blade-static" ng-if="blade.isExpanded">
<div class="blade-static">
<div class="form-group">
<div class="form-input __search">
<input placeholder="{{'platform.placeholders.search-keyword' | translate}}" ng-model="filter.keyword" ng-keyup="$event.which === 13 && filter.criteriaChanged()" style="width: 190px">
<input placeholder="{{'platform.placeholders.search-keyword' | translate}}" ng-model="filter.keyword" ng-keyup="$event.which === 13 && filter.criteriaChanged()" ng-style="blade.isExpanded && { 'width': '190px' }">
<button class="btn __other" style="position: relative;right: 45px;">
<i class="btn-ico fa fa-remove" title="Clear" ng-click="filter.keyword=null;filter.criteriaChanged()"></i>
</button>
<ui-select ng-model="filter.current" ng-change="filter.change()" style="left: 220px;position: absolute;width: 190px;top: 0px;">
<ui-select ng-if="blade.isExpanded" ng-model="filter.current" ng-change="filter.change()" style="left: 220px;position: absolute;width: 190px;top: 0px;">
<ui-select-match allow-clear="true" placeholder="{{'orders.blades.customerOrder-list.placeholders.select-filter' | translate}}">{{$select.selected.name | translate}}</ui-select-match>
<ui-select-choices repeat="x in $localStorage.orderSearchFilters | filter: $select.search">
<span ng-bind-html="x.name | translate | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
</div>
<a href="" ng-click="filter.edit()" style="left: 416px; top:25px; position:absolute;" class="form-edit"><i class="form-ico fa fa-pencil"></i></a>
<a href="" ng-if="blade.isExpanded" ng-click="filter.edit()" style="left: 416px; top:25px; position:absolute;" class="form-edit"><i class="form-ico fa fa-pencil"></i></a>
</div>
</div>
<div class="blade-static __bottom" ng-if="pageSettings.itemsPerPageCount < pageSettings.totalItems" ng-include="'pagerTemplate.html'"></div>
Expand Down
10 changes: 10 additions & 0 deletions src/VirtoCommerce.OrdersModule.Web/Scripts/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,16 @@ angular.module(moduleName, [
};
widgetService.registerWidget(operationsTreeWidget, 'customerOrderDetailWidgets');

// register members widgets
var customerOrdersWidget = {
controller: 'virtoCommerce.orderModule.customerOrderListWidgetController',
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/widgets/customerOrder-list-widget.tpl.html',
isVisible: function (blade) { return !blade.isNew; }
};

widgetService.registerWidget(customerOrdersWidget, 'customerDetail1');
widgetService.registerWidget(customerOrdersWidget, 'organizationDetail1');

// register dashboard widgets
var statisticsController = 'virtoCommerce.orderModule.dashboard.statisticsWidgetController';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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;

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 = '...';

if (!searchCriteria.organizationId && !searchCriteria.customerId) {
return;
}

var countSearchCriteria = {
responseGroup: "Default",
take: 0
};

angular.extend(countSearchCriteria, searchCriteria);

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

$scope.openBlade = function () {
if (!searchCriteria.organizationId && !searchCriteria.customerId) {
return;
}

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);
};

refresh()
}]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="gridster-cnt" ng-click="openBlade()">
<div class="cnt-inner">
<div class="list-count">{{ordersCount | number:0}}</div>
<div class="list-t">{{'orders.widgets.customerOrder-list.title' | translate}}</div>
</div>
</div>
2 changes: 1 addition & 1 deletion src/VirtoCommerce.OrdersModule.Web/module.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<id>VirtoCommerce.Orders</id>
<version>3.821.0</version>
<version>3.822.0</version>
<version-tag />
<platformVersion>3.825.0</platformVersion>
<dependencies>
Expand Down

0 comments on commit 77d6937

Please sign in to comment.