-
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.
VCST-2334: Discounts blade and widget. A bit of refactoring
- Loading branch information
Showing
10 changed files
with
94 additions
and
8 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
2 changes: 1 addition & 1 deletion
2
...ripts/blades/item-configuration-detail.js → ...lades/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
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
src/VirtoCommerce.OrdersModule.Web/Scripts/blades/customerOrder-item-dicsounts.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,20 @@ | ||
angular.module('virtoCommerce.orderModule') | ||
.controller('virtoCommerce.orderModule.customerOrderItemDiscountController', [ | ||
'$scope', 'platformWebApp.uiGridHelper', | ||
function ($scope, uiGridHelper) { | ||
var blade = $scope.blade; | ||
blade.title = 'orders.blades.customerOrder-item-discounts.title'; | ||
blade.headIcon = 'fa fa-area-chart'; | ||
|
||
$scope.setGridOptions = function (gridOptions) { | ||
uiGridHelper.initialize($scope, gridOptions, function (gridApi) { | ||
$scope.gridApi = gridApi; | ||
}); | ||
}; | ||
|
||
function initialize() { | ||
blade.isLoading = false; | ||
} | ||
|
||
initialize(); | ||
}]); |
24 changes: 24 additions & 0 deletions
24
src/VirtoCommerce.OrdersModule.Web/Scripts/blades/customerOrder-item-dicsounts.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,24 @@ | ||
<div class="blade-content __medium-wide"> | ||
<div class="blade-inner"> | ||
<div class="inner-block" ng-init="setGridOptions({ | ||
rowTemplate: 'discounts-list.row.html', | ||
data: 'blade.currentEntity.discounts', | ||
enableSorting: false, | ||
columnDefs: [ | ||
{ name: 'name', displayName: 'orders.blades.customerOrder-item-discounts.labels.name'}, | ||
{ name: 'coupon', displayName: 'orders.blades.customerOrder-item-discounts.labels.coupon' }, | ||
{ name: 'discountAmount', displayName: 'orders.blades.customerOrder-item-discounts.labels.discountAmount' }, | ||
{ name: 'discountAmountWithTax', displayName: 'orders.blades.customerOrder-item-discounts.labels.discountAmountWithTax' }, | ||
{ name: 'currency', displayName: 'orders.blades.customerOrder-item-discounts.labels.currency' } | ||
]})"> | ||
<div class="table-wrapper" ng-if="blade.currentEntity.discounts.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.discounts.length">{{ 'orders.blades.customerOrder-item-discounts.descr.no-discounts' | translate }}</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script type="text/ng-template" id="discounts-list.row.html"> | ||
<div 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}" role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}" ui-grid-cell></div> | ||
</script> |
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
6 changes: 3 additions & 3 deletions
6
...ipts/widgets/item-configuration-widget.js → ...ustomerOrder-item-configuration-widget.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
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
src/VirtoCommerce.OrdersModule.Web/Scripts/widgets/customerOrder-item-discounts-widget.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,14 @@ | ||
angular.module('virtoCommerce.orderModule') | ||
.controller('virtoCommerce.orderModule.customerOrderItemDiscountWidgetController', ['$scope', 'platformWebApp.bladeNavigationService', function ($scope, bladeNavigationService) { | ||
var blade = $scope.blade; | ||
|
||
$scope.openBlade = function () { | ||
var newBlade = { | ||
id: "itemDiscounts", | ||
controller: 'virtoCommerce.orderModule.customerOrderItemDiscountController', | ||
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-item-dicsounts.tpl.html', | ||
currentEntity: blade.currentEntity, | ||
}; | ||
bladeNavigationService.showBlade(newBlade, blade); | ||
}; | ||
}]); |
6 changes: 6 additions & 0 deletions
6
...rtoCommerce.OrdersModule.Web/Scripts/widgets/customerOrder-item-discounts-widget.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,6 @@ | ||
<div class="gridster-cnt" ng-click="openBlade()"> | ||
<div class="cnt-inner"> | ||
<div class="list-count">{{blade.currentEntity.discounts.length | number:0}}</div> | ||
<div class="list-t">{{ 'orders.widgets.customerOrder-item-discounts.title' | translate }}</div> | ||
</div> | ||
</div> |