diff --git a/src/main/frontend/src/utils/CatalogUtils.js b/src/main/frontend/src/utils/CatalogUtils.js index 4e3c22684..4b0de16f4 100644 --- a/src/main/frontend/src/utils/CatalogUtils.js +++ b/src/main/frontend/src/utils/CatalogUtils.js @@ -15,7 +15,7 @@ var CatalogUtils = { return input; } - if (! /^\s*[0-9]+[-\/][0-9]+(,[ ]*[0-9]+([-\/][0-9]+)?)*\s*$/.test(input)) { + if (! /^(\s*[0-9]+,)*\s*[0-9]+[-\/][0-9]+(,[ ]*[0-9]+([-\/][0-9]+)?)*\s*$/.test(input)) { return input; } diff --git a/src/main/frontend/src/utils/CatalogUtils.test.js b/src/main/frontend/src/utils/CatalogUtils.test.js index e265dad61..8660f8ebc 100644 --- a/src/main/frontend/src/utils/CatalogUtils.test.js +++ b/src/main/frontend/src/utils/CatalogUtils.test.js @@ -62,6 +62,14 @@ describe("CatalogUtils.expandNumbers()", function() { expect(CatalogUtils.expandNumbers("1-3,5-6,8-9")).toEqual("1,2,3,5,6,8,9"); }); + it("should return '989,1166,1167' for '989,1166-1167'", function() { + expect(CatalogUtils.expandNumbers("989,1166-1167")).toEqual("989,1166,1167"); + }); + + it("should return '989,1166,1167' for '989,1166-1167'", function() { + expect(CatalogUtils.expandNumbers(" 989,1166-1167")).toEqual("989,1166,1167"); + }); + it("should return 'test 1-3' for 'test 1-3'", function() { expect(CatalogUtils.expandNumbers("test 1-3")).toEqual("test 1-3"); }); diff --git a/src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java b/src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java index a90fe20ac..20c00b8c6 100644 --- a/src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java +++ b/src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java @@ -32,7 +32,7 @@ public final class ResourceUrl { public static final String STATIC_RESOURCES_URL = "https://stamps.filezz.ru"; // MUST be updated when any of our resources were modified - public static final String RESOURCES_VERSION = "v0.4.6.0"; + public static final String RESOURCES_VERSION = "v0.4.6.1"; // CheckStyle: ignore LineLength for next 17 lines private static final String CATALOG_UTILS_JS = "/public/js/" + RESOURCES_VERSION + "/utils/CatalogUtils.min.js";