(DbContext context, TableConfig config
if (item is null) return string.Empty;
if (prop.IsListingProperty)
- return prop.Formatter!.Invoke(item);
+ return prop.Formatter!.Invoke(item, provider);
var propValue = value ?? prop.Info.GetValue(item);
if (propValue is null)
return string.Empty;
if (prop.Formatter is not null) {
- return prop.Formatter.Invoke(propValue);
+ return prop.Formatter.Invoke(propValue, provider);
}
if (prop.IsEnumerable) {
if (value is not null) {
if (prop.EnumerableFormatter is not null) {
- return prop.EnumerableFormatter.Invoke(value);
+ return prop.EnumerableFormatter.Invoke(value, provider);
}
return value.ToString() ?? string.Empty;
diff --git a/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor b/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor
index 1fc16ac..041929d 100644
--- a/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor
+++ b/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor
@@ -36,11 +36,11 @@
@if (!property.IsRequired) {
-
+
}
-
+
@@ -52,7 +52,7 @@
Label="@property.Name"
Value="GetPropertyValue(property)"
Style="width: 100%;"
- Disabled="@(!property.Editable)"
+ Disabled="@(_currentlyEditing && !property.Editable)"
Required="@property.IsRequired"
ValueChanged="@(async v => await SetPropertyValue(property, v, InputType.Number))" />
}
@@ -60,7 +60,7 @@
}
@@ -70,14 +70,14 @@
@@ -88,7 +88,7 @@
Label="@property.Name"
Value="GetPropertyValue(property).ToDateTime(TimeOnly.MinValue)"
Style="width: 100%"
- Disabled="@(!property.Editable)"
+ Disabled="@(_currentlyEditing && !property.Editable)"
Required="@property.IsRequired"
ValueChanged="@(async v => await SetPropertyValue(property, v, InputType.Date))" />
}
@@ -97,7 +97,7 @@
Label="@property.Name"
Value="GetPropertyValue(property).ToDateTime()"
Style="width: 100%"
- Disabled="@(!property.Editable)"
+ Disabled="@(_currentlyEditing && !property.Editable)"
Required="@property.IsRequired"
ValueChanged="@(async v => await SetPropertyValue(property, v, InputType.Time))" />
}
@@ -109,7 +109,7 @@
Value="@(GetPropertyValue(property))"
Style="width: 100%"
Height="250px"
- Disabled="@(!property.Editable)"
+ Disabled="@(_currentlyEditing && !property.Editable)"
Required="@property.IsRequired"
ValueChanged="@(async v => await SetPropertyValue(property, v, InputType.Enum))" />
}
@@ -123,23 +123,33 @@
Value="@(GetPropertyValue(property))"
Style="width: 100%"
Height="250px"
- Disabled="@(!property.Editable)"
+ Disabled="@(_currentlyEditing && !property.Editable)"
Required="@property.IsRequired"
ValueChanged="@(async v => await SetPropertyValue(property, v, InputType.Enum))" />
-
+
}
+ else if (property.TextArea) {
+
+ }
else {
}
@@ -151,9 +161,13 @@
}
+
+
@inject IContextExplorer Explorer
@inject IDialogService Dialogs
@inject IHopFrameAuthHandler Handler
+@inject IToastService Toasts
+@inject IServiceProvider Provider
@code {
[Parameter]
@@ -217,6 +231,13 @@
break;
case InputType.Text:
+ if (config.Info.PropertyType == typeof(Guid)) {
+ var success = Guid.TryParse((string)value, out var guid);
+ if (success) result = guid;
+ else Toasts.ShowError($"'{value}' is not a valid guid");
+ break;
+ }
+
result = Convert.ToString(value);
break;
@@ -254,6 +275,11 @@
result = ((IEnumerable)value).OfType