Skip to content

Commit 47027ae

Browse files
authored
VCST-4356: Move UrlExtensions and change invalid style for tags-input (#2970)
1 parent 24b9767 commit 47027ae

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System.Text;
2+
3+
namespace VirtoCommerce.Platform.Core.Extensions;
4+
5+
public static class UrlExtensions
6+
{
7+
public static string TrimLastSlash(this string url)
8+
{
9+
var result = url.EndsWith('/') ? url[..^1] : url;
10+
11+
return result;
12+
}
13+
14+
/// <summary>
15+
/// Normalize values like "/reset/" and "reset" to "/reset"
16+
/// </summary>
17+
public static string NormalizeUrlSuffix(this string urlSuffix)
18+
{
19+
if (urlSuffix == "/")
20+
{
21+
return urlSuffix;
22+
}
23+
24+
var result = new StringBuilder(urlSuffix);
25+
26+
if (!string.IsNullOrEmpty(urlSuffix))
27+
{
28+
if (!urlSuffix.StartsWith('/'))
29+
{
30+
result.Insert(0, '/');
31+
}
32+
33+
if (urlSuffix.EndsWith('/'))
34+
{
35+
result.Remove(result.Length - 1, 1);
36+
}
37+
}
38+
39+
return result.ToString();
40+
}
41+
}

src/VirtoCommerce.Platform.Web/wwwroot/css/themes/main/sass/modules/_forms.sass

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,4 +613,14 @@ i.fa-password
613613
float: right
614614
color: #319ED4
615615
padding-left: 26px
616-
616+
617+
/* Tags input */
618+
tags-input
619+
&.ng-invalid
620+
.tags
621+
border-color: #fce7e6
622+
background: #fef8f7
623+
box-shadow: none
624+
625+
input
626+
background: #fef8f7

0 commit comments

Comments
 (0)