Get custom theme and layout on a default install

This commit is contained in:
Pavel Vesely
2020-04-28 14:51:27 +02:00
parent 8523f0d719
commit 375c706029
3 changed files with 2 additions and 24 deletions

View File

@ -179,31 +179,8 @@
}; };
var installation = await InstallationService.Install(config); var installation = await InstallationService.Install(config);
//TODO: Should be moved to Database manager
if (installation.Success) if (installation.Success)
{ {
Site site = new Site();
site.TenantId = -1; // will be populated on server
site.Name = "Default Site";
site.LogoFileId = null;
site.FaviconFileId = null;
site.DefaultThemeType = Constants.DefaultTheme;
site.DefaultLayoutType = Constants.DefaultLayout;
site.DefaultContainerType = Constants.DefaultContainer;
site.PwaIsEnabled = false;
site.PwaAppIconFileId = null;
site.PwaSplashIconFileId = null;
site.AllowRegistration = false;
site = await SiteService.AddSiteAsync(site, null);
User user = new User();
user.SiteId = site.SiteId;
user.Username = _hostUsername;
user.Password = _hostPassword;
user.Email = _hostEmail;
user.DisplayName = _hostUsername;
user = await UserService.AddUserAsync(user);
NavigationManager.NavigateTo("", true); NavigationManager.NavigateTo("", true);
} }
else else

View File

@ -44,6 +44,7 @@ namespace Oqtane.Controllers
_config.Reload(); _config.Reload();
} }
_databaseManager.BuildDefaultSite(config.Password, config.HostEmail);
installation.Success = true; installation.Success = true;
return installation; return installation;
} }

View File

@ -315,7 +315,7 @@ namespace Oqtane.Infrastructure
} }
} }
private void BuildDefaultSite(string password, string email) public void BuildDefaultSite(string password, string email)
{ {
using (var scope = _serviceScopeFactory.CreateScope()) using (var scope = _serviceScopeFactory.CreateScope())
{ {