Skip to content

Commit

Permalink
Merge branch 'release/3.811.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Mar 27, 2024
2 parents 223cdcf + d146578 commit 7ab6da7
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 29 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.810.0</VersionPrefix>
<VersionPrefix>3.811.0</VersionPrefix>
<VersionSuffix>
</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
Expand Down
3 changes: 3 additions & 0 deletions samples/VirtoCommerce.OrdersModule2.Web/Scripts/order2.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ angular.module(moduleName, [])
function (knownOperations, $http, $compile, scopeResolver, settings, bladeNavigationService, gridOptionExtension) {
var foundTemplate = knownOperations.getOperation('CustomerOrder');
if (foundTemplate) {
foundTemplate.isLocked = function () {
return false;
}
foundTemplate.detailBlade.metaFields.push(
{
name: 'newField',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
angular.module('virtoCommerce.orderModule')
.controller('virtoCommerce.orderModule.customerOrderDetailController', ['$scope', '$window', 'platformWebApp.bladeNavigationService',
'platformWebApp.dialogService', 'virtoCommerce.customerModule.members', 'virtoCommerce.customerModule.memberTypesResolverService',
'platformWebApp.authService',
function ($scope, $window, bladeNavigationService, dialogService, members, memberTypesResolverService, authService) {
'platformWebApp.authService', 'virtoCommerce.orderModule.knownOperations',
function ($scope, $window, bladeNavigationService, dialogService, members, memberTypesResolverService, authService, knownOperations) {
var blade = $scope.blade;
blade.currentEntityId = blade.customerOrder.id;

Expand Down Expand Up @@ -78,16 +78,8 @@ angular.module('virtoCommerce.orderModule')
if (!blade.currentEntity) {
return;
}
blade.isLocked = blade.currentEntity.status === 'Completed' || blade.currentEntity.cancelledState === 'Completed' || blade.currentEntity.isCancelled;
//var orderLineItemsBlade = {
// id: 'customerOrderItems',
// currentEntity: blade.currentEntity,
// recalculateFn: blade.recalculate,
// controller: 'virtoCommerce.orderModule.customerOrderItemsController',
// template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-items.tpl.html'
//};
//Display order items disabled by default
// bladeNavigationService.showBlade(orderLineItemsBlade, blade);

blade.isLocked = knownOperations.isLocked("CustomerOrder", blade.currentEntity);
};

blade.customInitialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ angular.module('virtoCommerce.orderModule')
'platformWebApp.authService',
'virtoCommerce.paymentModule.paymentMethods',
'virtoCommerce.customerModule.members',
function ($scope, bladeNavigationService, customerOrders, authService, paymentMethods, members) {
'virtoCommerce.orderModule.knownOperations',
function ($scope, bladeNavigationService, customerOrders, authService, paymentMethods, members, knownOperations) {
var blade = $scope.blade;
blade.isVisiblePrices = authService.checkPermission('order:read_prices');
blade.paymentMethods = [];
Expand All @@ -33,11 +34,8 @@ angular.module('virtoCommerce.orderModule')
blade.isLocked = true;
bladeNavigationService.setError(error.data, blade);
});
} else {
blade.isLocked = !blade.currentEntity || (blade.currentEntity.status === 'Paid'
|| blade.currentEntity.cancelledState === 'Requested'
|| blade.currentEntity.cancelledState === 'Completed'
|| blade.currentEntity.isCancelled);
} else {
blade.isLocked = knownOperations.isLocked("PaymentIn", blade.currentEntity);

blade.title = 'orders.blades.payment-detail.title';
blade.titleValues = { number: blade.currentEntity.number };
Expand Down Expand Up @@ -146,7 +144,7 @@ angular.module('virtoCommerce.orderModule')
if (!blade.currentEntity) {
return;
}
blade.isLocked = blade.currentEntity.status === 'Paid' || blade.currentEntity.cancelledState === 'Completed' || blade.currentEntity.isCancelled;
blade.isLocked = knownOperations.isLocked("PaymentIn", blade.currentEntity);
};

blade.customInitialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ angular.module('virtoCommerce.orderModule')
'platformWebApp.authService',
'virtoCommerce.shippingModule.shippingMethods',
'virtoCommerce.customerModule.members',
function ($scope, bladeNavigationService, customerOrders, fulfillments, authService, shippingMethods, members) {
'virtoCommerce.orderModule.knownOperations',
function ($scope, bladeNavigationService, customerOrders, fulfillments,
authService, shippingMethods, members, knownOperations) {
var blade = $scope.blade;
blade.isVisiblePrices = authService.checkPermission('order:read_prices');
blade.shippingMethods = [];
Expand All @@ -30,10 +32,7 @@ angular.module('virtoCommerce.orderModule')
bladeNavigationService.setError(error.data, blade);
});
} else {
blade.isLocked = !blade.currentEntity || blade.currentEntity.status === 'Send'
|| blade.currentEntity.cancelledState === 'Completed'
|| blade.currentEntity.cancelledState === 'Requested'
|| blade.currentEntity.isCancelled;
blade.isLocked = knownOperations.isLocked("Shipment", blade.currentEntity);

blade.title = 'orders.blades.shipment-detail.title';
blade.titleValues = { number: blade.currentEntity.number };
Expand Down Expand Up @@ -114,7 +113,7 @@ angular.module('virtoCommerce.orderModule')
return;
}

blade.isLocked = blade.currentEntity.status === 'Send' || blade.currentEntity.cancelledState === 'Completed' || blade.currentEntity.isCancelled;
blade.isLocked = knownOperations.isLocked("Shipment", blade.currentEntity);
};

blade.customInitialize();
Expand Down
30 changes: 28 additions & 2 deletions src/VirtoCommerce.OrdersModule.Web/Scripts/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ angular.module(moduleName, [
id: 'operationDetail',
knownChildrenOperations: [],
metaFields: [],
isLocked: false,
controller: 'virtoCommerce.orderModule.operationDetailController'
}, copy.detailBlade);

Expand All @@ -57,9 +58,18 @@ angular.module(moduleName, [
return map[type];
}

function isLocked(type, entity) {
var operation = getOperation(type);
if (typeof operation.isLocked === "function" && entity) {
return operation.isLocked(entity);
}
return false;
}

return {
registerOperation: registerOperation,
getOperation: getOperation
getOperation: getOperation,
isLocked: isLocked
};
}])
.run(
Expand Down Expand Up @@ -108,6 +118,11 @@ angular.module(moduleName, [
knownOperations.registerOperation({
type: 'CustomerOrder',
treeTemplateUrl: 'orderOperationDefault.tpl.html',
isLocked: function (entity) {
return entity.status === 'Completed' ||
entity.cancelledState === 'Completed' ||
entity.isCancelled;
},
detailBlade: {
id: 'orderDetail',
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-detail.tpl.html',
Expand Down Expand Up @@ -169,7 +184,12 @@ angular.module(moduleName, [
var paymentInOperation = {
type: 'PaymentIn',
description: 'orders.blades.newOperation-wizard.menu.payment-operation.description',
// treeTemplateUrl: 'orderOperationDefault.tpl.html',
isLocked: function (entity) {
return entity.status === 'Paid'
|| entity.cancelledState === 'Requested'
|| entity.cancelledState === 'Completed'
|| entity.isCancelled;
},
detailBlade: {
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/payment-detail.tpl.html',
metaFields: [
Expand Down Expand Up @@ -280,6 +300,12 @@ angular.module(moduleName, [
type: 'Shipment',
description: 'orders.blades.newOperation-wizard.menu.shipment-operation.description',
treeTemplateUrl: 'shipmentOperationDefault.tpl.html',
isLocked: function (entity) {
return entity.status === 'Send'
|| entity.cancelledState === 'Completed'
|| entity.cancelledState === 'Requested'
|| entity.isCancelled;
},
detailBlade: {
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/shipment-detail.tpl.html',
metaFields: [
Expand Down
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.810.0</version>
<version>3.811.0</version>
<version-tag />
<platformVersion>3.800.0</platformVersion>
<dependencies>
Expand Down

0 comments on commit 7ab6da7

Please sign in to comment.