Limit the embedding name and type length

This commit is contained in:
tsommer committed 2024-12-27 13:14:49 +01:00
1 parent 81790b99de
commit 169e1cb601
2 files changed
+12

No files matched your search

@@ -12,6 +12,9 @@
AdornmentIcon="@Icons.Material.Filled.Label"
AdornmentColor="Color.Info"
Validation="@this.ValidateName"
Counter="26"
MaxLength="26"
Immediate="@true"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
/>
@@ -24,7 +27,10 @@
Adornment="Adornment.Start"
AdornmentIcon="@Icons.Material.Filled.Extension"
AdornmentColor="Color.Info"
Counter="56"
MaxLength="56"
Validation="@this.ValidateType"
Immediate="@true"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
/>
@@ -86,6 +86,9 @@ public partial class EmbeddingMethodDialog : ComponentBase
if (string.IsNullOrWhiteSpace(name))
return "The embedding name must not be empty. Please name the embedding.";
if (name.Length > 26)
return "The embedding name must not be longer than 26 characters.";
return null;
}
@@ -94,6 +97,9 @@ public partial class EmbeddingMethodDialog : ComponentBase
if (string.IsNullOrWhiteSpace(type))
return "The embedding type must not be empty. Please specify the embedding type.";
if (type.Length > 56)
return "The embedding type must not be longer than 56 characters.";
return null;
}