Browse Source

Remove EditForm from feature management modal

pull/6008/head
Ahmet 6 years ago
parent
commit
151414208f
  1. 139
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor

139
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor

@ -1,6 +1,5 @@
@using Volo.Abp.Validation.StringValues @using Volo.Abp.Validation.StringValues
@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Localization
@using Microsoft.AspNetCore.Components.Forms
@inherits AbpFeatureManagementComponentBase @inherits AbpFeatureManagementComponentBase
@ -12,84 +11,80 @@
<CloseButton Clicked="CloseModal" /> <CloseButton Clicked="CloseModal" />
</ModalHeader> </ModalHeader>
<ModalBody MaxHeight="50"> <ModalBody MaxHeight="50">
<EditForm id="UpdateFeaturesForm" OnValidSubmit="SaveAsync"> @if (Groups == null)
@if (Groups == null) {
{ <span>@L["NoFeatureFoundMessage"]</span>
<span>@L["NoFeatureFoundMessage"]</span> }
} else
else {
{ <Tabs TabPosition="TabPosition.Left" Pills="true" @bind-SelectedTab="@SelectedTabName">
<Tabs TabPosition="TabPosition.Left" Pills="true" @bind-SelectedTab="@SelectedTabName"> <Items>
<Items> @foreach (var group in Groups)
@foreach (var group in Groups) {
{ <Tab Name="@GetNormalizedGroupName(group.Name)">
<Tab Name="@GetNormalizedGroupName(group.Name)"> <span>@group.DisplayName</span>
<span>@group.DisplayName</span> </Tab>
</Tab> }
} </Items>
</Items> <Content>
<Content> @foreach (var group in Groups)
@foreach (var group in Groups) {
{ <TabPanel Name="@GetNormalizedGroupName(group.Name)">
<TabPanel Name="@GetNormalizedGroupName(group.Name)"> <h4>@group.DisplayName</h4>
<h4>@group.DisplayName</h4>
@foreach (var feature in group.Features)
@foreach (var feature in group.Features) {
var disabled = IsDisabled(feature.Provider.Name);
if (feature.ValueType is FreeTextStringValueType)
{
<Field>
<FieldLabel>@feature.DisplayName</FieldLabel>
<TextEdit Disabled="@disabled"
Text="@feature.Value"
TextChanged="@(async(v) => await OnFeatureValueChangedAsync(v, feature))" />
@if (feature.Description != null)
{
<span>@feature.Description</span>
}
</Field>
}
if (feature.ValueType is SelectionStringValueType)
{ {
var disabled = IsDisabled(feature.Provider.Name); var items = ((SelectionStringValueType)feature.ValueType).ItemSource.Items;
if (feature.ValueType is FreeTextStringValueType) <Field>
{ <FieldLabel>@feature.DisplayName</FieldLabel>
<Field> <Select TValue="string"
<FieldLabel>@feature.DisplayName</FieldLabel> @bind-SelectedValue="@SelectionStringValues[feature.Name]">
<TextEdit @foreach (var item in items)
Disabled="@disabled"
Text="@feature.Value"
TextChanged="@(async(v) => await OnFeatureValueChangedAsync(v, feature))" />
@if (feature.Description != null)
{ {
<span>@feature.Description</span> <SelectItem Value="@item.Value">
@CreateStringLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name)
</SelectItem>
} }
</Field> </Select>
} </Field>
}
if (feature.ValueType is SelectionStringValueType)
{ if (feature.ValueType is ToggleStringValueType)
var items = ((SelectionStringValueType) feature.ValueType).ItemSource.Items; {
<Field>
<Field> <Check TValue="bool" @bind-checked="@ToggleValues[feature.Name]">@feature.DisplayName</Check>
<FieldLabel>@feature.DisplayName</FieldLabel> </Field>
<Select
TValue="string"
@bind-SelectedValue="@SelectionStringValues[feature.Name]">
@foreach (var item in items)
{
<SelectItem Value="@item.Value">
@CreateStringLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name)
</SelectItem>
}
</Select>
</Field>
}
if (feature.ValueType is ToggleStringValueType)
{
<Field>
<Check TValue="bool" @bind-checked="@ToggleValues[feature.Name]">@feature.DisplayName</Check>
</Field>
}
} }
}
</TabPanel>
} </TabPanel>
</Content> }
</Tabs> </Content>
} </Tabs>
</EditForm> }
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button> <Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button>
<Button form="UpdateFeaturesForm" Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button> <Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent>
</Modal> </Modal>
Loading…
Cancel
Save