diff --git a/.idea/.idea.HopFrame/.idea/workspace.xml b/.idea/.idea.HopFrame/.idea/workspace.xml
index 92837c1..3cdfe0c 100644
--- a/.idea/.idea.HopFrame/.idea/workspace.xml
+++ b/.idea/.idea.HopFrame/.idea/workspace.xml
@@ -11,13 +11,9 @@
-
+
-
-
-
-
@@ -38,7 +34,7 @@
@@ -78,6 +74,7 @@
+
{}
{
@@ -106,7 +103,7 @@
"RunOnceActivity.git.unshallow": "true",
"b5f11219-dfc4-47a1-b02c-90ab603034fb.executor": "Debug",
"dcdf1689-dc07-47e4-8824-2e60a4fbf301.executor": "Debug",
- "git-widget-placeholder": "!22 on feature/async-delegates",
+ "git-widget-placeholder": "!23 on feature/max-length",
"list.type.of.created.stylesheet": "CSS",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
@@ -211,7 +208,8 @@
-
+
+
@@ -405,7 +403,15 @@
1737995782424
-
+
+
+ 1737997122807
+
+
+
+ 1737997122807
+
+
@@ -480,6 +486,7 @@
-
+
+
\ No newline at end of file
diff --git a/src/HopFrame.Core/Config/PropertyConfig.cs b/src/HopFrame.Core/Config/PropertyConfig.cs
index 2001433..7c8070c 100644
--- a/src/HopFrame.Core/Config/PropertyConfig.cs
+++ b/src/HopFrame.Core/Config/PropertyConfig.cs
@@ -25,6 +25,7 @@ public class PropertyConfig(PropertyInfo info, TableConfig table, int nthPropert
public bool IsEnumerable { get; internal set; }
public bool IsListingProperty { get; set; }
public int Order { get; set; } = nthProperty;
+ public int DisplayLength { get; set; } = 32;
}
///
@@ -190,4 +191,13 @@ public class PropertyConfigurator(PropertyConfig config) {
InnerConfig.Order = index;
return this;
}
+
+ ///
+ /// Sets the maximum character length displayed in the admin ui (not in the editor dialog)
+ ///
+ /// The maximum length of characters to be displayed
+ public PropertyConfigurator SetDisplayLength(int maxLength) {
+ InnerConfig.DisplayLength = maxLength;
+ return this;
+ }
}
diff --git a/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor b/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor
index 7ce31ef..a03d4b2 100644
--- a/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor
+++ b/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor
@@ -54,7 +54,7 @@
@foreach (var property in _config!.Properties.Where(prop => prop.List).OrderBy(prop => prop.Order)) {
}
@@ -283,4 +283,13 @@
_allSelected = selected;
}
+
+ private async Task DisplayProperty(PropertyConfig config, object entry) {
+ var display = await _manager!.DisplayProperty(entry, config);
+
+ if (display.Length > config.DisplayLength)
+ display = display.Substring(0, config.DisplayLength) + "...";
+
+ return display;
+ }
}
\ No newline at end of file
diff --git a/testing/HopFrame.Testing/Program.cs b/testing/HopFrame.Testing/Program.cs
index 28ec112..d743d3b 100644
--- a/testing/HopFrame.Testing/Program.cs
+++ b/testing/HopFrame.Testing/Program.cs
@@ -60,6 +60,7 @@ builder.Services.AddHopFrame(options => {
context.Table()
.Property(p => p.Content)
+ .SetDisplayLength(100)
.IsTextArea(true)
/*.Validator(input => {
var errors = new List();