Skip to content

Commit

Permalink
removed symbols "\", "/", " ", ":" from restrictions (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyawzrd authored and tatarincev committed Feb 21, 2019
1 parent 0015305 commit de90ff6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace VirtoCommerce.CatalogModule.Data.Services.Validation
{
public class ProductValidator : AbstractValidator<CatalogProduct>
{
private static readonly char[] _illegalCodeChars = { '$', '+', ';', '=', '%', '{', '}', '[', ']', '|', '\\', '/', '@', '~', '!', '^', '*', '&', '(', ')', ':', '<', '>' };
private static readonly char[] _illegalCodeChars = { '$', '+', ';', '=', '%', '{', '}', '[', ']', '|', '@', '~', '!', '^', '*', '&', '(', ')', '<', '>' };
public ProductValidator()
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"priority": "Priority"
},
"validations": {
"code": "Code can't contain $+;=%{}[]|/@ ~!^*&()?:'<>, characters"
"code": "Code can't contain $+;=%{}[]|@~!^*&()?'<>, characters"
},
"placeholders": {
"name": "Enter category name",
Expand Down Expand Up @@ -297,7 +297,7 @@
"end-date": "Listing expires on"
},
"validations": {
"sku": "SKU can't contain $+;=%{}[]|/@ ~!^*&()?:'<>, characters"
"sku": "SKU can't contain $+;=%{}[]|@~!^*&()?'<>, characters"
},
"placeholders": {
"sku": "Enter item SKU",
Expand Down Expand Up @@ -609,7 +609,7 @@
"code": "Code"
},
"validations": {
"code": "Code can't contain $+;=%{}[]|\/@ ~!^*&()?:'<>, characters"
"code": "Code can't contain $+;=%{}[]|@~!^*&()?'<>, characters"
},
"placeholders": {
"name": "Enter category name",
Expand All @@ -633,7 +633,7 @@
"seo-information-summary-undefined": "Seo information undefined"
},
"validations": {
"sku": "SKU can't contain $+;=%{}[]|\/@ ~!^*&()?:'<>, characters",
"sku": "SKU can't contain $+;=%{}[]|@~!^*&()?'<>, characters",
"sku-required": "Required",
"name-required": "Required"
},
Expand All @@ -654,7 +654,7 @@
"upload-images-summary": "{{ count }} image(s) uploaded"
},
"validations": {
"sku": "SKU can't contain $+;=%{}[]|\/@ ~!^*&()?:'<>, characters",
"sku": "SKU can't contain $+;=%{}[]|@~!^*&()?'<>, characters",
"sku-required": "Required",
"name-required": "Required"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('virtoCommerce.catalogModule')
angular.module('virtoCommerce.catalogModule')
.controller('virtoCommerce.catalogModule.categoryDetailController', ['$rootScope', '$scope', 'platformWebApp.bladeNavigationService', 'platformWebApp.settings', 'virtoCommerce.catalogModule.categories', 'virtoCommerce.catalogModule.catalogs', 'platformWebApp.metaFormsService', function ($rootScope, $scope, bladeNavigationService, settings, categories, catalogs, metaFormsService) {
var blade = $scope.blade;
blade.updatePermission = 'catalog:update';
Expand Down Expand Up @@ -38,7 +38,7 @@
};

blade.codeValidator = function (value) {
var pattern = /[$+;=%{}[\]|\\\/@ ~!^*&()?:'<>,]/;
var pattern = /[$+;=%{}[\]|@~!^*&()?'<>,]/;
return !pattern.test(value);
};

Expand Down
4 changes: 2 additions & 2 deletions VirtoCommerce.CatalogModule.Web/Scripts/blades/item-detail.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('virtoCommerce.catalogModule')
angular.module('virtoCommerce.catalogModule')
.controller('virtoCommerce.catalogModule.itemDetailController', ['$rootScope', '$scope', 'platformWebApp.bladeNavigationService', 'platformWebApp.settings', 'virtoCommerce.catalogModule.items', 'virtoCommerce.customerModule.members', 'virtoCommerce.catalogModule.catalogs', 'platformWebApp.metaFormsService', 'virtoCommerce.catalogModule.categories', function ($rootScope, $scope, bladeNavigationService, settings, items, members, catalogs, metaFormsService, categories) {
var blade = $scope.blade;
blade.updatePermission = 'catalog:update';
Expand Down Expand Up @@ -46,7 +46,7 @@


blade.codeValidator = function (value) {
var pattern = /[$+;=%{}[\]|\\\/@ ~!^*&()?:'<>,]/;
var pattern = /[$+;=%{}[\]|@~!^*&()?'<>,]/;
return !pattern.test(value);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('virtoCommerce.catalogModule')
angular.module('virtoCommerce.catalogModule')
.controller('virtoCommerce.catalogModule.newCategoryWizardController', ['$scope', 'platformWebApp.bladeNavigationService', 'platformWebApp.dialogService', 'virtoCommerce.catalogModule.categories', function ($scope, bladeNavigationService, dialogService, categories) {
var blade = $scope.blade;

Expand Down Expand Up @@ -46,7 +46,7 @@
}

$scope.codeValidator = function (value) {
var pattern = /[$+;=%{}[\]|\\\/@ ~!^*&()?:'<>,]/;
var pattern = /[$+;=%{}[\]|@~!^*&()?'<>,]/;
return !pattern.test(value);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('virtoCommerce.catalogModule')
angular.module('virtoCommerce.catalogModule')
.controller('virtoCommerce.catalogModule.newProductWizardController', ['$scope', 'platformWebApp.bladeNavigationService', '$http', 'virtoCommerce.storeModule.stores', 'virtoCommerce.catalogModule.catalogImagesFolderPathHelper', function ($scope, bladeNavigationService, $http, stores, catalogImgHelper) {
var blade = $scope.blade;
blade.headIcon = blade.item.productType === 'Digital' ? 'fa fa-file-archive-o' : 'fa fa-truck';
Expand Down Expand Up @@ -92,7 +92,7 @@
}

$scope.codeValidator = function (value) {
var pattern = /[$+;=%{}[\]|\\\/@ ~!^*&()?:'<>,]/;
var pattern = /[$+;=%{}[\]|@~!^*&()?'<>,]/;
return !pattern.test(value);
};

Expand Down

0 comments on commit de90ff6

Please sign in to comment.