}
@@ -69,20 +69,16 @@
@if (feature.ValueType is FreeTextStringValueType)
{
- var type = "text";
- if(feature.ValueType.Validator is NumericValueValidator)
- {
- type = "number";
- }
-
- @if (feature.Description != null)
+ var type = feature.ValueType.Validator is NumericValueValidator ? "number" : "text";
+
+ if (feature.Description != null)
{
@feature.Description
}
@@ -90,20 +86,13 @@
@if (feature.ValueType is SelectionStringValueType selectType)
{
- var disabled = Model.IsDisabled(feature) ? "disabled" : "";
-
}
-
+
}
diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs
index a96a0c0f88..a9366da30e 100644
--- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs
+++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs
@@ -69,7 +69,7 @@ public class FeatureManagementModal : AbpPageModel
{
var features = new UpdateFeaturesDto
{
- Features = FeatureGroups.SelectMany(g => g.Features).Where(x => !x.Value.IsNullOrWhiteSpace() || x.BoolValue.HasValue).Select(f => new UpdateFeatureDto
+ Features = FeatureGroups.SelectMany(g => g.Features).Where(x => !x.IsDisabled).Select(f => new UpdateFeatureDto
{
Name = f.Name,
Value = f.Type == nameof(ToggleStringValueType) ? f.BoolValue.ToString() : f.Value
@@ -97,11 +97,13 @@ public class FeatureManagementModal : AbpPageModel
public class FeatureViewModel
{
+ public bool IsDisabled { get; set; }
+
public string Name { get; set; }
public string Value { get; set; }
- public bool? BoolValue { get; set; }
+ public bool BoolValue { get; set; }
public string Type { get; set; }
}