-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
482 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/VirtoCommerce.OrdersModule.Web/Scripts/blades/customerOrder-item-configuration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
angular.module('virtoCommerce.orderModule') | ||
.controller('virtoCommerce.orderModule.customerOrderItemConfigurationController', [ | ||
'$scope', 'platformWebApp.uiGridHelper', 'platformWebApp.bladeNavigationService', | ||
function ($scope, uiGridHelper, bladeNavigationService) { | ||
var blade = $scope.blade; | ||
blade.title = 'orders.blades.configuration.title'; | ||
blade.headIcon = 'fas fa-sliders'; | ||
|
||
$scope.setGridOptions = function (gridOptions) { | ||
uiGridHelper.initialize($scope, gridOptions, function (gridApi) { | ||
$scope.gridApi = gridApi; | ||
}); | ||
}; | ||
|
||
$scope.selectNode = function (item) { | ||
$scope.selectedNodeId = item.id; | ||
|
||
var newBlade = { | ||
id: "listItemDetail", | ||
controller: 'virtoCommerce.catalogModule.itemDetailController', | ||
template: 'Modules/$(VirtoCommerce.Catalog)/Scripts/blades/item-detail.tpl.html', | ||
title: item.name, | ||
itemId: item.productId | ||
}; | ||
bladeNavigationService.showBlade(newBlade, blade); | ||
} | ||
|
||
function initialize() { | ||
blade.isLoading = false; | ||
} | ||
|
||
initialize(); | ||
}]); |
35 changes: 35 additions & 0 deletions
35
src/VirtoCommerce.OrdersModule.Web/Scripts/blades/customerOrder-item-configuration.tpl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div class="blade-content __medium-wide"> | ||
<div class="blade-inner"> | ||
<div class="inner-block" ng-init="setGridOptions({ | ||
rowTemplate: 'configuration-list.row.html', | ||
data: 'blade.currentEntity.configurationItems', | ||
rowHeight: 61, | ||
enableSorting: false, | ||
columnDefs: [ | ||
{ | ||
name: 'imageUrl', displayName: 'orders.blades.configuration.labels.picture', | ||
enableColumnResizing: false, width: 75, cellTemplate: 'configuration-item-list-icon.cell.html' | ||
}, | ||
{ name: 'name', displayName: 'orders.blades.configuration.labels.product-name'}, | ||
{ name: 'quantity', displayName: 'orders.blades.configuration.labels.quantity', width: 120 } | ||
]})"> | ||
<div class="table-wrapper" ng-if="blade.currentEntity.configurationItems.length" style="margin: 0 -21px 0;"> | ||
<div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-save-state ui-grid-resize-columns ui-grid-move-columns ui-grid-pinning ui-grid-height></div> | ||
</div> | ||
<div class="note" ng-if="!blade.currentEntity.configurationItems.length">{{ 'orders.blades.configuration.descr.no-configuration' | translate }}</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script type="text/ng-template" id="configuration-list.row.html"> | ||
<div ng-click='grid.appScope.selectNode(row.entity)' ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell" ng-class="{'ui-grid-row-header-cell': col.isRowHeader, '__hovered': grid.appScope.contextMenuEntity === row.entity, '__selected': row.entity.id ===grid.appScope.selectedNodeId}" role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}" ui-grid-cell></div> | ||
</script> | ||
|
||
<script type="text/ng-template" id="configuration-item-list-icon.cell.html"> | ||
<div class="ui-grid-cell-contents"> | ||
<div class="product-img"> | ||
<img class="image" ng-src="{{COL_FIELD}}" ng-if="COL_FIELD"> | ||
<span class="table-ico fas fa-image" ng-if="!COL_FIELD"></span> | ||
</div> | ||
</div> | ||
</script> |
88 changes: 88 additions & 0 deletions
88
src/VirtoCommerce.OrdersModule.Web/Scripts/blades/customerOrder-item-detail.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
angular.module('virtoCommerce.orderModule') | ||
.controller('virtoCommerce.orderModule.customerOrderItemDetailController', [ | ||
'$scope', 'platformWebApp.bladeNavigationService', 'platformWebApp.authService', | ||
function ($scope, bladeNavigationService, authService) { | ||
var blade = $scope.blade; | ||
blade.updatePermission = 'order:update'; | ||
blade.isVisiblePrices = authService.checkPermission('order:read_prices'); | ||
blade.formScope = null; | ||
blade.metaFields = [ | ||
{ | ||
title: "orders.blades.customerOrder-item-detail.labels.product", | ||
colSpan: 2, | ||
templateUrl: "name.html" | ||
}, | ||
{ | ||
templateUrl: "status.html" | ||
}, | ||
{ | ||
title: "orders.blades.customerOrder-items.labels.quantity", | ||
templateUrl: "quantity.html" | ||
}, | ||
{ | ||
title: "orders.blades.customerOrder-items.labels.price", | ||
templateUrl: "price.html" | ||
}, | ||
{ | ||
title: "orders.blades.customerOrder-items.labels.priceWithTax", | ||
templateUrl: "priceWithTax.html" | ||
}, | ||
{ | ||
title: "orders.blades.customerOrder-items.labels.discount", | ||
templateUrl: "discountAmount.html" | ||
}, | ||
{ | ||
title: "orders.blades.customerOrder-items.labels.discountWithTax", | ||
templateUrl: "discountAmountWithTax.html" | ||
}, | ||
{ | ||
title: "orders.blades.customerOrder-items.labels.tax", | ||
templateUrl: "taxTotal.html" | ||
}, | ||
{ | ||
title: "orders.blades.customerOrder-items.labels.total", | ||
templateUrl: "extendedPriceWithTax.html" | ||
} | ||
]; | ||
|
||
blade.refresh = function () { | ||
blade.isLoading = false; | ||
}; | ||
|
||
blade.openStatusSettingManagement = function () { | ||
var newBlade = { | ||
id: 'settingDetailChild', | ||
controller: 'platformWebApp.settingDictionaryController', | ||
template: '$(Platform)/Scripts/app/settings/blades/setting-dictionary.tpl.html', | ||
currentEntityId: 'OrderLineItem.Statuses', | ||
isApiSave: true, | ||
}; | ||
bladeNavigationService.showBlade(newBlade, blade); | ||
}; | ||
|
||
blade.recalculate = function() { | ||
if (blade.formScope && blade.formScope.$valid && angular.isFunction(blade.recalculateFn)) { | ||
blade.recalculateFn(); | ||
} | ||
} | ||
|
||
blade.setForm = function (form) { blade.formScope = form; } | ||
|
||
blade.openItemDetail = function () { | ||
var newBlade = { | ||
id: "listItemDetail", | ||
controller: 'virtoCommerce.catalogModule.itemDetailController', | ||
template: 'Modules/$(VirtoCommerce.Catalog)/Scripts/blades/item-detail.tpl.html', | ||
title: blade.currentEntity.name, | ||
itemId: blade.currentEntity.productId, | ||
productType: blade.currentEntity.productType | ||
}; | ||
bladeNavigationService.showBlade(newBlade, blade); | ||
}; | ||
|
||
$scope.$watch("blade.order", function (order) { | ||
blade.currentEntity = _.filter(order.items, function (item) { return item.id === blade.currentEntityId })[0]; | ||
}, true); | ||
|
||
blade.refresh(); | ||
}]); |
Oops, something went wrong.