Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting management page should always visible to host side #15216

Merged
merged 3 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<ModalContent Size="ModalSize.Large" Centered="true">
<ModalHeader>
<ModalTitle>@L["Features"]</ModalTitle>
<CloseButton Clicked="CloseModal"/>
<CloseButton Clicked="CloseModal" />
</ModalHeader>
<ModalBody MaxHeight="50">
@if (Groups == null || !Groups.Any())
{
<span>@L["NoFeatureFoundMessage"]</span>
}
else
{
@if (Groups == null || !Groups.Any())
{
<span class="m-3">@L["NoFeatureFoundMessage"]</span>
}
else
{
<ModalBody MaxHeight="50">
<Tabs TabPosition="TabPosition.Start" Pills="true" @bind-SelectedTab="@SelectedTabName">
<Items>
@foreach (var group in Groups)
Expand All @@ -30,7 +30,7 @@
var index = i;
<TabPanel Name="@GetNormalizedGroupName(Groups[index].Name)">
<h4>@Groups[index].DisplayName</h4>
<hr class="mt-2 mb-3"/>
<hr class="mt-2 mb-3" />
@foreach (var feature in Groups[index].Features)
{
<div class="mt-2">
Expand All @@ -42,8 +42,8 @@
<Field Style="@GetFeatureStyles(feature)">
<FieldLabel>@feature.DisplayName</FieldLabel>
<TextEdit Disabled="@disabled"
Text="@feature.Value"
TextChanged="@(async (v) => await OnFeatureValueChangedAsync(v, feature))"/>
Text="@feature.Value"
TextChanged="@(async (v) => await OnFeatureValueChangedAsync(v, feature))" />
@if (feature.Description != null)
{
<div class="form-text">@feature.Description</div>
Expand All @@ -53,12 +53,12 @@

if (feature.ValueType is SelectionStringValueType)
{
var items = ((SelectionStringValueType) feature.ValueType).ItemSource.Items;
var items = ((SelectionStringValueType)feature.ValueType).ItemSource.Items;

<Field Style="@GetFeatureStyles(feature)">
<FieldLabel>@feature.DisplayName</FieldLabel>
<Select TValue="string"
@bind-SelectedValue="@SelectionStringValues[feature.Name]">
@bind-SelectedValue="@SelectionStringValues[feature.Name]">
@foreach (var item in items)
{
<SelectItem Value="@item.Value">
Expand All @@ -76,8 +76,7 @@
if (feature.ValueType is ToggleStringValueType)
{
<Field Style="@GetFeatureStyles(feature)">
<Check
TValue="bool" Checked="@ToggleValues[feature.Name]" CheckedChanged="@(async (v) => await OnSelectedValueChangedAsync(v, feature))">
<Check TValue="bool" Checked="@ToggleValues[feature.Name]" CheckedChanged="@(async (v) => await OnSelectedValueChangedAsync(v, feature))">
@feature.DisplayName
</Check>
@if (feature.Description != null)
Expand All @@ -94,12 +93,13 @@
}
</Content>
</Tabs>
}
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@(async () => await DeleteAsync(ProviderName,ProviderKey))">@L["ResetToDefault"]</Button>
<Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button>
<Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button>
</ModalFooter>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@(async () => await DeleteAsync(ProviderName,ProviderKey))">@L["ResetToDefault"]</Button>
<Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button>
<Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button>
</ModalFooter>
}

</ModalContent>
</Modal>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public override void Define(IFeatureDefinitionContext context)
"true",
L("Feature:SettingManagementEnable"),
L("Feature:SettingManagementEnableDescription"),
new ToggleStringValueType());
new ToggleStringValueType(),
isAvailableToHost: false);

settingEnableFeature.CreateChild(
SettingManagementFeatures.AllowChangingEmailSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class EmailingPageContributor : SettingPageContributorBase
{
public EmailingPageContributor()
{
RequiredFeatures(SettingManagementFeatures.Enable);
RequiredTenantSideFeatures(SettingManagementFeatures.Enable);
RequiredTenantSideFeatures(SettingManagementFeatures.AllowChangingEmailSettings);
RequiredPermissions(SettingManagementPermissions.Emailing);
}
Expand Down