diff --git a/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-item-list.js b/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-item-list.js
index 2a41b615..7512f1b4 100644
--- a/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-item-list.js
+++ b/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-item-list.js
@@ -1,5 +1,5 @@
angular.module('virtoCommerce.pricingModule')
- .controller('virtoCommerce.pricingModule.pricelistItemListController', ['$scope', 'virtoCommerce.pricingModule.prices', '$filter', 'platformWebApp.bladeNavigationService', 'uiGridConstants', 'platformWebApp.uiGridHelper', 'platformWebApp.bladeUtils', 'platformWebApp.dialogService', '$translate', function ($scope, prices, $filter, bladeNavigationService, uiGridConstants, uiGridHelper, bladeUtils, dialogService, $translate) {
+ .controller('virtoCommerce.pricingModule.pricelistItemListController', ['$scope', '$injector', 'virtoCommerce.pricingModule.prices', '$filter', 'platformWebApp.bladeNavigationService', 'uiGridConstants', 'platformWebApp.uiGridHelper', 'platformWebApp.bladeUtils', 'platformWebApp.dialogService', '$translate', function ($scope, $injector, prices, $filter, bladeNavigationService, uiGridConstants, uiGridHelper, bladeUtils, dialogService, $translate) {
$scope.uiGridConstants = uiGridConstants;
$scope.noProductRowName = $translate.instant('pricing.blades.pricelist-item-list.labels.no-product-row-name');
var blade = $scope.blade;
@@ -9,6 +9,7 @@ angular.module('virtoCommerce.pricingModule')
exportTypeName: 'PriceExportDataQuery'
}
};
+ blade.exportFeaturesEnabled = $injector.modules['virtoCommerce.exportModule'];
blade.getSearchCriteria = function() {
var result = {
@@ -217,8 +218,11 @@ angular.module('virtoCommerce.pricingModule')
return $scope.gridApi && _.any($scope.gridApi.selection.getSelectedRows());
},
permission: blade.updatePermission
- },
- {
+ }
+ ];
+
+ if (blade.exportFeaturesEnabled) {
+ blade.toolbarCommands.push({
name: "platform.commands.export",
icon: 'fa fa-upload',
canExecuteMethod: function () {
@@ -227,8 +231,8 @@ angular.module('virtoCommerce.pricingModule')
executeMethod: function () {
blade.exportPrices();
}
- }
- ];
+ });
+ }
$scope.getPriceRange = function (priceGroup) {
var retVal;
diff --git a/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.js b/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.js
index 7064ebc7..07c7490c 100644
--- a/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.js
+++ b/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.js
@@ -1,6 +1,6 @@
angular.module('virtoCommerce.pricingModule')
- .controller('virtoCommerce.pricingModule.pricelistListController', ['$scope', 'virtoCommerce.pricingModule.pricelists', 'platformWebApp.dialogService', 'platformWebApp.uiGridHelper', 'platformWebApp.bladeUtils', '$localStorage',
- function ($scope, pricelists, dialogService, uiGridHelper, bladeUtils, $localStorage) {
+ .controller('virtoCommerce.pricingModule.pricelistListController', ['$scope', '$injector', 'virtoCommerce.pricingModule.pricelists', 'platformWebApp.dialogService', 'platformWebApp.uiGridHelper', 'platformWebApp.bladeUtils', '$localStorage',
+ function ($scope, $injector, pricelists, dialogService, uiGridHelper, bladeUtils, $localStorage) {
var blade = $scope.blade;
var bladeNavigationService = bladeUtils.bladeNavigationService;
@@ -12,6 +12,7 @@ angular.module('virtoCommerce.pricingModule')
};
var exportDataRequest = angular.copy(defaultDataRequest);
var filter = blade.filter = $scope.filter = {};
+ blade.exportFeaturesEnabled = $injector.modules['virtoCommerce.exportModule'];
blade.refresh = function (parentRefresh) {
blade.isLoading = true;
@@ -110,8 +111,11 @@ angular.module('virtoCommerce.pricingModule')
},
canExecuteMethod: isItemsChecked,
permission: 'pricing:delete'
- },
- {
+ }
+ ];
+
+ if ($injector.modules['virtoCommerce.exportModule']) {
+ blade.toolbarCommands.push({
name: "platform.commands.export",
icon: 'fa fa-upload',
canExecuteMethod: function () {
@@ -145,8 +149,8 @@ angular.module('virtoCommerce.pricingModule')
};
bladeNavigationService.showBlade(newBlade, blade);
}
- }
- ];
+ });
+ }
filter.criteriaChanged = function () {
if ($scope.pageSettings.currentPage > 1) {
@@ -169,8 +173,6 @@ angular.module('virtoCommerce.pricingModule')
bladeUtils.initializePagination($scope);
};
-
-
if (!$localStorage.exportSearchFilters) {
$localStorage.exportSearchFilters = {};
}
@@ -187,7 +189,7 @@ angular.module('virtoCommerce.pricingModule')
$scope.exportSearchFilterId = $localStorage.exportSearchFilterIds[exportDataRequest.exportTypeName];
- if ($scope.exportSearchFilterId) {
+ if ($scope.exportSearchFilterId && blade.exportFeaturesEnabled) {
filter.current = _.findWhere($scope.exportSearchFilters, { id: $scope.exportSearchFilterId });
}
diff --git a/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.tpl.html b/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.tpl.html
index 7ea88dc6..2780d37a 100644
--- a/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.tpl.html
+++ b/src/VirtoCommerce.PricingModule.Web/Scripts/blades/pricelist-list.tpl.html
@@ -1,16 +1,16 @@
diff --git a/src/VirtoCommerce.PricingModule.Web/Scripts/pricing.js b/src/VirtoCommerce.PricingModule.Web/Scripts/pricing.js
index 1b2b577b..927f8476 100644
--- a/src/VirtoCommerce.PricingModule.Web/Scripts/pricing.js
+++ b/src/VirtoCommerce.PricingModule.Web/Scripts/pricing.js
@@ -6,153 +6,155 @@ if (AppDependencies != undefined) {
}
angular.module(moduleName, ['ui.grid.cellNav', 'ui.grid.edit', 'ui.grid.validate'])
-.config(
- ['$stateProvider', function ($stateProvider) {
- $stateProvider
- .state('workspace.pricingModule', {
- url: '/pricing',
- templateUrl: '$(Platform)/Scripts/common/templates/home.tpl.html',
- controller: [
- '$scope', 'platformWebApp.bladeNavigationService', function ($scope, bladeNavigationService) {
- var blade = {
- id: 'pricing',
- title: 'pricing.blades.pricing-main.title',
- subtitle: 'pricing.blades.pricing-main.subtitle',
- controller: 'virtoCommerce.pricingModule.pricingMainController',
- template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/pricing-main.tpl.html',
- isClosingDisabled: true
- };
- bladeNavigationService.showBlade(blade);
- //Need for isolate and prevent conflict module css to other modules
- $scope.moduleName = "vc-pricing";
- }
- ]
- });
- }]
-)
-.run(
- ['$http', '$compile', 'platformWebApp.mainMenuService', 'platformWebApp.widgetService', '$state', 'platformWebApp.authService', 'platformWebApp.metaFormsService', 'virtoCommerce.exportModule.genericViewerItemService',
- function ($http, $compile, mainMenuService, widgetService, $state, authService, metaFormsService, genericViewerItemService) {
- //Register module in main menu
- var menuItem = {
- path: 'browse/pricing',
- icon: 'fa fa-usd',
- title: 'pricing.main-menu-title',
- priority: 30,
- action: function () { $state.go('workspace.pricingModule'); },
- permission: 'pricing:access'
- };
- mainMenuService.addMenuItem(menuItem);
+ .config(
+ ['$stateProvider', function ($stateProvider) {
+ $stateProvider
+ .state('workspace.pricingModule', {
+ url: '/pricing',
+ templateUrl: '$(Platform)/Scripts/common/templates/home.tpl.html',
+ controller: [
+ '$scope', 'platformWebApp.bladeNavigationService', function ($scope, bladeNavigationService) {
+ var blade = {
+ id: 'pricing',
+ title: 'pricing.blades.pricing-main.title',
+ subtitle: 'pricing.blades.pricing-main.subtitle',
+ controller: 'virtoCommerce.pricingModule.pricingMainController',
+ template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/pricing-main.tpl.html',
+ isClosingDisabled: true
+ };
+ bladeNavigationService.showBlade(blade);
+ //Need for isolate and prevent conflict module css to other modules
+ $scope.moduleName = "vc-pricing";
+ }
+ ]
+ });
+ }]
+ )
+ .run(
+ ['$injector', '$http', '$compile', 'platformWebApp.mainMenuService', 'platformWebApp.widgetService', '$state', 'platformWebApp.authService', 'platformWebApp.metaFormsService',
+ function ($injector, $http, $compile, mainMenuService, widgetService, $state, authService, metaFormsService) {
+ //Register module in main menu
+ var menuItem = {
+ path: 'browse/pricing',
+ icon: 'fa fa-usd',
+ title: 'pricing.main-menu-title',
+ priority: 30,
+ action: function () { $state.go('workspace.pricingModule'); },
+ permission: 'pricing:access'
+ };
+ mainMenuService.addMenuItem(menuItem);
- //Register item prices widget
- var itemPricesWidget = {
- isVisible: function (blade) { return authService.checkPermission('pricing:read'); },
- controller: 'virtoCommerce.pricingModule.itemPricesWidgetController',
- size: [2, 1],
- template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/widgets/itemPricesWidget.tpl.html',
- };
- widgetService.registerWidget(itemPricesWidget, 'itemDetail');
+ //Register item prices widget
+ var itemPricesWidget = {
+ isVisible: function (blade) { return authService.checkPermission('pricing:read'); },
+ controller: 'virtoCommerce.pricingModule.itemPricesWidgetController',
+ size: [2, 1],
+ template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/widgets/itemPricesWidget.tpl.html',
+ };
+ widgetService.registerWidget(itemPricesWidget, 'itemDetail');
- //Register pricelist widgets
- widgetService.registerWidget({
- isVisible: function (blade) { return !blade.isNew; },
- controller: 'virtoCommerce.pricingModule.pricesWidgetController',
- template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/widgets/pricesWidget.tpl.html',
- }, 'pricelistDetail');
- widgetService.registerWidget({
- controller: 'virtoCommerce.pricingModule.assignmentsWidgetController',
- template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/widgets/assignmentsWidget.tpl.html',
- }, 'pricelistDetail');
+ //Register pricelist widgets
+ widgetService.registerWidget({
+ isVisible: function (blade) { return !blade.isNew; },
+ controller: 'virtoCommerce.pricingModule.pricesWidgetController',
+ template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/widgets/pricesWidget.tpl.html',
+ }, 'pricelistDetail');
+ widgetService.registerWidget({
+ controller: 'virtoCommerce.pricingModule.assignmentsWidgetController',
+ template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/widgets/assignmentsWidget.tpl.html',
+ }, 'pricelistDetail');
- $http.get('Modules/$(VirtoCommerce.Pricing)/Scripts/dynamicConditions/templates.html').then(function (response) {
- // compile the response, which will put stuff into the cache
- $compile(response.data);
- });
+ $http.get('Modules/$(VirtoCommerce.Pricing)/Scripts/dynamicConditions/templates.html').then(function (response) {
+ // compile the response, which will put stuff into the cache
+ $compile(response.data);
+ });
- //
- metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePrice' + 'ExportFilter', [
- {
- name: 'pricelistSelector',
- title: "pricing.selectors.titles.price-lists",
- templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/pricelist-selector.tpl.html',
- },
- {
- name: 'productSelector',
- title: "pricing.selectors.titles.products",
- templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/product-selector.tpl.html',
- },
- {
- name: 'modifiedSince',
- title: "pricing.selectors.titles.modified-since",
- valueType: "DateTime"
- }]);
+ metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePrice' + 'ExportFilter', [
+ {
+ name: 'pricelistSelector',
+ title: "pricing.selectors.titles.price-lists",
+ templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/pricelist-selector.tpl.html',
+ },
+ {
+ name: 'productSelector',
+ title: "pricing.selectors.titles.products",
+ templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/product-selector.tpl.html',
+ },
+ {
+ name: 'modifiedSince',
+ title: "pricing.selectors.titles.modified-since",
+ valueType: "DateTime"
+ }]);
- metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePricelist' + 'ExportFilter', [
- {
- name: 'currencySelector',
- title: "pricing.selectors.titles.currencies",
- templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/currency-selector.tpl.html',
- }]);
+ metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePricelist' + 'ExportFilter', [
+ {
+ name: 'currencySelector',
+ title: "pricing.selectors.titles.currencies",
+ templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/currency-selector.tpl.html',
+ }]);
- metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePricelistFullData' + 'ExportFilter', [
- {
- name: 'currencySelector',
- title: "pricing.selectors.titles.currencies",
- templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/currency-selector.tpl.html',
- }]);
+ metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePricelistFullData' + 'ExportFilter', [
+ {
+ name: 'currencySelector',
+ title: "pricing.selectors.titles.currencies",
+ templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/currency-selector.tpl.html',
+ }]);
- metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePricelistAssignment' + 'ExportFilter', [
- {
- name: 'pricelistAssignmentSelector',
- title: "pricing.selectors.titles.price-lists",
- templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/pricelist-selector.tpl.html',
- },
- {
- name: 'catalogSelector',
- title: "Select Catalog",
- templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/catalog-selector.tpl.html',
- }
- ]);
+ metaFormsService.registerMetaFields('VirtoCommerce.PricingModule.Data.ExportImport.ExportablePricelistAssignment' + 'ExportFilter', [
+ {
+ name: 'pricelistAssignmentSelector',
+ title: "pricing.selectors.titles.price-lists",
+ templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/pricelist-selector.tpl.html',
+ },
+ {
+ name: 'catalogSelector',
+ title: "Select Catalog",
+ templateUrl: 'Modules/$(VirtoCommerce.Pricing)/Scripts/selectors/catalog-selector.tpl.html',
+ }
+ ]);
- genericViewerItemService.registerViewer('Price', function (item) {
- var itemCopy = angular.copy(item);
+ if ($injector.modules['virtoCommerce.exportModule']) {
+ var genericViewerItemService = $injector.get('virtoCommerce.exportModule.genericViewerItemService');
+ genericViewerItemService.registerViewer('Price', function (item) {
+ var itemCopy = angular.copy(item);
- return {
- id: 'itemPrices',
- itemId: itemCopy.productId,
- priceListId: itemCopy.pricelistId,
- data: { prices: [itemCopy] },
- currency: itemCopy.currency,
- title: 'pricing.blades.prices-list.title',
- titleValues: { name: itemCopy.name },
- subtitle: 'pricing.blades.prices-list.subtitle',
- controller: 'virtoCommerce.pricingModule.pricesListController',
- template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/prices-list.tpl.html'
- };
- });
+ return {
+ id: 'itemPrices',
+ itemId: itemCopy.productId,
+ priceListId: itemCopy.pricelistId,
+ data: { prices: [itemCopy] },
+ currency: itemCopy.currency,
+ title: 'pricing.blades.prices-list.title',
+ titleValues: { name: itemCopy.name },
+ subtitle: 'pricing.blades.prices-list.subtitle',
+ controller: 'virtoCommerce.pricingModule.pricesListController',
+ template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/prices-list.tpl.html'
+ };
+ });
- genericViewerItemService.registerViewer('Pricelist', function (item) {
- var itemCopy = angular.copy(item);
+ genericViewerItemService.registerViewer('Pricelist', function (item) {
+ var itemCopy = angular.copy(item);
- return {
- id: 'listItemChild',
- controller: 'virtoCommerce.pricingModule.pricelistDetailController',
- template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/pricelist-detail.tpl.html',
- currentEntityId: itemCopy.id,
- title: itemCopy.name
- };
- });
+ return {
+ id: 'listItemChild',
+ controller: 'virtoCommerce.pricingModule.pricelistDetailController',
+ template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/pricelist-detail.tpl.html',
+ currentEntityId: itemCopy.id,
+ title: itemCopy.name
+ };
+ });
- genericViewerItemService.registerViewer('PricelistAssignment', function (item) {
- var itemCopy = angular.copy(item);
+ genericViewerItemService.registerViewer('PricelistAssignment', function (item) {
+ var itemCopy = angular.copy(item);
- return {
- id: 'pricelistAssignmentDetail',
- controller: 'virtoCommerce.pricingModule.assignmentDetailController',
- template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/assignment-detail.tpl.html',
- currentEntityId: itemCopy.id,
- title: itemCopy.name,
- subtitle: 'pricing.blades.assignment-detail.subtitle'
- };
- });
- }]);
+ return {
+ id: 'pricelistAssignmentDetail',
+ controller: 'virtoCommerce.pricingModule.assignmentDetailController',
+ template: 'Modules/$(VirtoCommerce.Pricing)/Scripts/blades/assignment-detail.tpl.html',
+ currentEntityId: itemCopy.id,
+ title: itemCopy.name,
+ subtitle: 'pricing.blades.assignment-detail.subtitle'
+ };
+ });
+ }
+ }]);
diff --git a/src/VirtoCommerce.PricingModule.Web/module.manifest b/src/VirtoCommerce.PricingModule.Web/module.manifest
index afc3856b..a6b4f2a3 100644
--- a/src/VirtoCommerce.PricingModule.Web/module.manifest
+++ b/src/VirtoCommerce.PricingModule.Web/module.manifest
@@ -3,12 +3,12 @@
VirtoCommerce.Pricing
3.803.0
-
3.800.0
+
3.824.0
-
+
Pricing