refactoring of site groups
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
@inject ILogService logger
|
||||
@inject ISettingService SettingService
|
||||
@inject IJSRuntime jsRuntime
|
||||
@inject ISiteGroupDefinitionService SiteGroupDefinitionService
|
||||
@inject ISiteGroupService SiteGroupService
|
||||
@inject IServiceProvider ServiceProvider
|
||||
@inject ILogService LoggingService
|
||||
@inject IStringLocalizer<ControlPanelInteractive> Localizer
|
||||
@@ -35,7 +35,7 @@
|
||||
<button type="button" data-bs-dismiss="offcanvas" class="btn btn-primary col-12" @onclick=@(async () => Navigate("Admin"))>@Localizer["AdminDash"]</button>
|
||||
</div>
|
||||
</div>
|
||||
@if (_siteGroupDefinitions.Any(item => item.Synchronization))
|
||||
@if (_siteGroups.Any(item => item.Type == SiteGroupTypes.Synchronization))
|
||||
{
|
||||
<button type="button" class="btn btn-success col-12 mt-1" @onclick="SynchronizeSite">@Localizer["Synchronize"]</button>
|
||||
}
|
||||
@@ -262,7 +262,7 @@
|
||||
private List<Page> _pages = new List<Page>();
|
||||
private List<Module> _modules = new List<Module>();
|
||||
private List<ThemeControl> _containers = new List<ThemeControl>();
|
||||
private List<SiteGroupDefinition> _siteGroupDefinitions = new List<SiteGroupDefinition>();
|
||||
private List<SiteGroup> _siteGroups = new List<SiteGroup>();
|
||||
|
||||
private string _category = "Common";
|
||||
private string _pane = "";
|
||||
@@ -293,7 +293,7 @@
|
||||
_allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Page.SiteId);
|
||||
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(_category)).ToList();
|
||||
_categories = _allModuleDefinitions.SelectMany(m => m.Categories.Split(',', StringSplitOptions.RemoveEmptyEntries)).Distinct().Where(item => item != "Headless").ToList();
|
||||
_siteGroupDefinitions = await SiteGroupDefinitionService.GetSiteGroupDefinitionsAsync(PageState.Site.SiteId);
|
||||
_siteGroups = await SiteGroupService.GetSiteGroupsAsync(PageState.Site.SiteId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,10 +641,10 @@
|
||||
|
||||
private async Task SynchronizeSite()
|
||||
{
|
||||
foreach (var group in _siteGroupDefinitions.Where(item => item.Synchronization))
|
||||
foreach (var group in _siteGroups.Where(item => item.Type == SiteGroupTypes.Synchronization))
|
||||
{
|
||||
group.Synchronize = true;
|
||||
await SiteGroupDefinitionService.UpdateSiteGroupDefinitionAsync(group);
|
||||
await SiteGroupService.UpdateSiteGroupAsync(group);
|
||||
}
|
||||
NavigationManager.NavigateTo(Utilities.NavigateUrl(PageState.Alias.Path, PageState.Page.Path, ""), true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user