From 9e249c250ea2bb2369eb49c18c5ef415cda7d0de Mon Sep 17 00:00:00 2001 From: sobotama <77323555+sobotama@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:32:49 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed error messages, comment moved to more meaningfull place Co-authored-by: Zoltán Lehóczky --- .../Drivers/JavascriptConditionDisplayDriver.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/Drivers/JavascriptConditionDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Rules/Drivers/JavascriptConditionDisplayDriver.cs index 2e1ff4bfdd3..ec85a37b5db 100644 --- a/src/OrchardCore.Modules/OrchardCore.Rules/Drivers/JavascriptConditionDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Rules/Drivers/JavascriptConditionDisplayDriver.cs @@ -57,11 +57,12 @@ public override async Task UpdateAsync(JavascriptCondition condi var model = new JavascriptConditionViewModel(); await updater.TryUpdateModelAsync(model, Prefix); + // CodeMirror hides the textarea which displays the error when updater.ModelState.AddModelError() is used, + // that's why a notifier is used to show validation errors. if (string.IsNullOrWhiteSpace(model.Script)) { - updater.ModelState.AddModelError(Prefix, nameof(model.Script), S["The script is required"]); - // Codemirror hides the textarea which displays the error when updater.ModelState.AddModelError is used, that's why a notifier is used to show the error to user - await _notifier.ErrorAsync(H["The script is required"]); + updater.ModelState.AddModelError(Prefix, nameof(model.Script), S["Please provide a script."]); + await _notifier.ErrorAsync(H["Please provide a script."]); return Edit(condition); }