Skip to content

Commit

Permalink
Add Alias to ValidationResult (#12875)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt authored Nov 29, 2022
1 parent b9c2d51 commit d1b9528
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public static async IAsyncEnumerable<ValidationResult> ValidateAsync(this AliasP
{
if (part.Alias.Length > AliasPart.MaxAliasLength)
{
yield return new ValidationResult(S["Your alias is too long. The alias can only be up to {0} characters.", AliasPart.MaxAliasLength], new string[] { nameof(part.Alias) });
yield return new ValidationResult(S["Your alias is too long. The alias can only be up to {0} characters. \"{1}\"", AliasPart.MaxAliasLength, part.Alias], new string[] { nameof(part.Alias) });
}

if (!await IsAliasUniqueAsync(part, session, part.Alias))
{
yield return new ValidationResult(S["Your alias is already in use."], new[] { nameof(part.Alias) });
yield return new ValidationResult(S["Your alias is already in use. \"{0}\"", part.Alias], new[] { nameof(part.Alias) });
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.field-validation-error, .has-validation-error {
@extend .text-danger;
}
}

span.field-validation-error {
width: 100%;
}
6 changes: 6 additions & 0 deletions src/OrchardCore.Themes/TheAdmin/wwwroot/css/TheAdmin.css
Original file line number Diff line number Diff line change
Expand Up @@ -27667,6 +27667,9 @@ html[dir][data-theme=default] div.editor-widget.find-widget .button.codicon:acti
background-color: transparent;
border-color: transparent;
}
html[data-theme=default] span.field-validation-error {
width: 100%;
}
html[dir][data-theme=default] .has-filter .btn:not(.show), html[dir][data-theme=darkmode] .bootstrap-select .popover-header html[data-theme=default] .has-filter .close:not(.show), html[dir][data-theme=default] .has-filter .button:not(.show), html[dir][data-theme=default] .has-filter .bootstrap-select .popover-header .close:not(.show), html[dir][data-theme=default] .bootstrap-select .popover-header .has-filter .close:not(.show) {
border-color: #ced4da !important;
}
Expand Down Expand Up @@ -57103,6 +57106,9 @@ html[dir][data-theme=darkmode] div.editor-widget.find-widget .button.codicon:act
background-color: transparent;
border-color: transparent;
}
html[data-theme=darkmode] span.field-validation-error {
width: 100%;
}
html[dir][data-theme=darkmode] .has-filter .btn:not(.show), html[dir][data-theme=darkmode] .has-filter .button:not(.show), html[dir][data-theme=default] .bootstrap-select .popover-header html[data-theme=darkmode] .has-filter .close:not(.show), html[dir][data-theme=darkmode] .has-filter .bootstrap-select .popover-header .close:not(.show), html[dir][data-theme=darkmode] .bootstrap-select .popover-header .has-filter .close:not(.show) {
border-color: #3C4144 !important;
}
Expand Down
4 changes: 2 additions & 2 deletions src/OrchardCore.Themes/TheAdmin/wwwroot/css/TheAdmin.min.css

Large diffs are not rendered by default.

0 comments on commit d1b9528

Please sign in to comment.