Skip to content

Commit 07427a9

Browse files
authored
Merge pull request #42 from phmatray/features/fix-warnings
refactor: simplify code
2 parents cf4ea47 + 38bf521 commit 07427a9

File tree

14 files changed

+316
-78
lines changed

14 files changed

+316
-78
lines changed

CLAUDE.md

Lines changed: 295 additions & 62 deletions
Large diffs are not rendered by default.

FormCraft.DemoBlazorApp/Components/Pages/FieldGroups.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private void ResetForm()
179179
if (!string.IsNullOrEmpty(_model.Biography))
180180
{
181181
var bio = _model.Biography.Length > 50
182-
? _model.Biography.Substring(0, 50) + "..."
182+
? _model.Biography[..50] + "..."
183183
: _model.Biography;
184184
items.Add(new() { Label = "Biography", Value = bio });
185185
}

FormCraft.DemoBlazorApp/Components/Pages/FileUploadDemo.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private void ResetForm()
154154
});
155155
}
156156

157-
if (_model.Certificates?.Any() == true)
157+
if (_model.Certificates.Any())
158158
{
159159
items.Add(new FormSuccessDisplay.DataDisplayItem
160160
{

FormCraft.DemoBlazorApp/Components/Pages/FormSlots.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public partial class FormSlots : IDisposable
1111
private IFormConfiguration<ContactModel> _formConfiguration = null!;
1212
private bool _isSubmitting;
1313
private bool _isSubmitted;
14-
private int _activeStep = 0;
14+
private int _activeStep;
1515
private bool _showCountdown = true;
1616
private string _countdownText = "";
1717
private System.Timers.Timer? _countdownTimer;

FormCraft.DemoBlazorApp/Components/Pages/SecurityDemo.razor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public partial class SecurityDemo
1616
private string _decryptedResult = "";
1717
private int _submissionCount;
1818
private const int _maxSubmissions = 3;
19-
private string _resetTime = "1 minute";
20-
19+
private const string _resetTime = "1 minute";
20+
2121
private readonly List<GuidelineItem> _securityGuidelines = new()
2222
{
2323
new()
@@ -240,8 +240,8 @@ private void ResetForm()
240240
{
241241
new() { Label = "Name", Value = _lastSubmission.Name },
242242
new() { Label = "Email", Value = _lastSubmission.Email },
243-
new() { Label = "SSN", Value = _lastSubmission.SSN.Length > 10 ? "***-**-" + _lastSubmission.SSN.Substring(_lastSubmission.SSN.Length - 4) : "Encrypted" },
244-
new() { Label = "Credit Card", Value = _lastSubmission.CreditCard.Length > 10 ? "****-****-****-" + _lastSubmission.CreditCard.Substring(_lastSubmission.CreditCard.Length - 4) : "Encrypted" },
243+
new() { Label = "SSN", Value = _lastSubmission.SSN.Length > 10 ? "***-**-" + _lastSubmission.SSN[^4..] : "Encrypted" },
244+
new() { Label = "Credit Card", Value = _lastSubmission.CreditCard.Length > 10 ? "****-****-****-" + _lastSubmission.CreditCard[^4..] : "Encrypted" },
245245
new() { Label = "Birth Date", Value = _lastSubmission.BirthDate.ToShortDateString() }
246246
};
247247
}

FormCraft.DemoBlazorApp/Helpers/GuidelineHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static GuidelineItem CreateGuideline(string feature, string usage, string
1717

1818
public static GuidelineItem CreateCodeGuideline(string feature, string usage, string example)
1919
{
20-
return CreateGuideline(feature, usage, example, true);
20+
return CreateGuideline(feature, usage, example);
2121
}
2222

2323
public static GuidelineItem CreateTextGuideline(string feature, string usage, string example)

FormCraft.DemoBlazorApp/Services/VersionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public async Task<string> GetFormCraftVersionAsync()
7575
// Remove 'v' prefix if present
7676
if (version.StartsWith("v"))
7777
{
78-
version = version.Substring(1);
78+
version = version[1..];
7979
}
8080
_cachedVersion = version;
8181
_cacheExpiry = DateTime.UtcNow.AddHours(1);

FormCraft.ForMudBlazor/Features/CustomFields/MudBlazorRatingComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333

3434
private int GetMaxRating()
3535
{
36-
return GetAttribute<int>("MaxRating", 5);
36+
return GetAttribute("MaxRating", 5);
3737
}
3838
}

FormCraft.ForMudBlazor/Fields/TextField/MudBlazorTextFieldComponent.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected override void OnInitialized()
1414
base.OnInitialized();
1515

1616
// Load configuration from additional attributes
17-
Lines = GetAttribute<int>("Lines", 1);
17+
Lines = GetAttribute("Lines", 1);
1818
MaxLength = GetAttribute<int?>("MaxLength");
1919
InputType = GetAttribute("InputType", "text") ?? "text";
2020
Mask = GetAttribute<string?>("Mask");

FormCraft.sln.DotSettings.user

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExceptionDispatchInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fbf9021a960b74107a7e141aa06bc9d8a0a53c929178c2fb95b1597be8af8dc_003FExceptionDispatchInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
33
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMemberExpression_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F22fcf6bc98d86f46d35d502592ddd281e5a9fc65b1ad2eec19898153ffa47_003FMemberExpression_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
44
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARenderTreeBuilder_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fcba2da7d9d9c9a4959d387508945f8ac78aac1812d1fc0a5f82e38ca8a3b4374_003FRenderTreeBuilder_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
5-
<s:String x:Key="/Default/CodeInspection/Highlighting/SweaWarningsMode/@EntryValue">DoNotShowAndRun</s:String>
5+
<s:String x:Key="/Default/CodeInspection/Highlighting/SweaWarningsMode/@EntryValue">ShowAndRun</s:String>
66

77
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=017026e3_002Db1e5_002D47e9_002Dbaf0_002Db4c86c281b07/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="All tests from &amp;lt;src&amp;gt;\&amp;lt;tests&amp;gt;\&amp;lt;FormCraft.UnitTests&amp;gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
88
&lt;Project Location="/Users/phmatray/Repositories/github-phm/FormCraft/FormCraft.UnitTests" Presentation="&amp;lt;src&amp;gt;\&amp;lt;tests&amp;gt;\&amp;lt;FormCraft.UnitTests&amp;gt;" /&gt;
@@ -14,4 +14,9 @@
1414
&lt;Project Location="/Users/phmatray/Repositories/github-phm/FormCraft" Presentation="&amp;lt;src&amp;gt;" /&gt;
1515
&lt;/SessionState&gt;</s:String>
1616

17+
18+
19+
20+
21+
1722
</wpf:ResourceDictionary>

0 commit comments

Comments
 (0)