Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Revert "Application installation process - allow to skip create indexes"
KrzysztofPajakb6a76406aafc
diff --git a/src/Business/Grand.Business.System/Interfaces/Installation/IInstallationService.cs b/src/Business/Grand.Business.System/Interfaces/Installation/IInstallationService.csindex 792708850..1ce89121f 100644--- a/src/Business/Grand.Business.System/Interfaces/Installation/IInstallationService.cs+++ b/src/Business/Grand.Business.System/Interfaces/Installation/IInstallationService.cs@@ -4,6 +4,6 @@ namespace Grand.Business.System.Interfaces.Installation{public partial interface IInstallationService{- Task InstallData(string defaultUserEmail, string defaultUserPassword, string collation, bool skipCreateIndex = false, bool installSampleData = true, string companyName = "", string companyAddress = "", string companyPhoneNumber = "", string companyEmail = "");+ Task InstallData(string defaultUserEmail, string defaultUserPassword, string collation, bool installSampleData = true, string companyName = "", string companyAddress = "", string companyPhoneNumber = "", string companyEmail = "");}}diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs b/src/Business/Grand.Business.System/Services/Installation/InstallationService.csindex b166e9ff4..bb12944af 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs@@ -550,7 +550,7 @@ namespace Grand.Business.System.Services.Installation}- private async Task CreateTables(string local, bool skipCreateIndex)+ private async Task CreateTables(string local){try{@@ -565,8 +565,7 @@ namespace Grand.Business.System.Services.Installationif (item.BaseType != null && item.IsClass && item.BaseType == typeof(BaseEntity))await dbContext.CreateTable(item.Name, local);}- if (!skipCreateIndex)- await CreateIndexes(dbContext);+ await CreateIndexes(dbContext);}catch (Exception ex)@@ -581,12 +580,12 @@ namespace Grand.Business.System.Services.Installationpublic virtual async Task InstallData(string defaultUserEmail,- string defaultUserPassword, string collation, bool skipCreateIndex = false, bool installSampleData = true, string companyName = "", string companyAddress = "",+ string defaultUserPassword, string collation, bool installSampleData = true, string companyName = "", string companyAddress = "",string companyPhoneNumber = "", string companyEmail = ""){defaultUserEmail = defaultUserEmail.ToLower();- await CreateTables(collation, skipCreateIndex);+ await CreateTables(collation);await InstallVersion();await InstallMenuAdminSiteMap();await InstallStores(companyName, companyAddress, companyPhoneNumber, companyEmail);diff --git a/src/Web/Grand.Web/App_Data/Resources/Installation/installation.en.xml b/src/Web/Grand.Web/App_Data/Resources/Installation/installation.en.xmlindex 43db50984..4ca36ba41 100644--- a/src/Web/Grand.Web/App_Data/Resources/Installation/installation.en.xml+++ b/src/Web/Grand.Web/App_Data/Resources/Installation/installation.en.xml@@ -140,9 +140,6 @@<LocaleResource Name="StoreInformation"><Value>Store information</Value></LocaleResource>- <LocaleResource Name="SkipCreateIndex">- <Value>Skip create indexes</Value>- </LocaleResource><LocaleResource Name="Title"><Value>grandnode installation</Value></LocaleResource>diff --git a/src/Web/Grand.Web/App_Data/Resources/Installation/installation.pl.xml b/src/Web/Grand.Web/App_Data/Resources/Installation/installation.pl.xmlindex 3e8d41251..6b5ee51bd 100644--- a/src/Web/Grand.Web/App_Data/Resources/Installation/installation.pl.xml+++ b/src/Web/Grand.Web/App_Data/Resources/Installation/installation.pl.xml@@ -143,9 +143,6 @@<LocaleResource Name="Title"><Value>grandnode instalacja</Value></LocaleResource>- <LocaleResource Name="SkipCreateIndex">- <Value>Pomin tworzenie indeksów</Value>- </LocaleResource><LocaleResource Name="Tooltip1"><Value>grandnode jest w pełni funkcjonalną platformą e-commerce, stworzoną w oparciu o ASP.NET. Ten kreator poprowadzi cię przez proces instalacji i konfiguracji grandnode</Value></LocaleResource>diff --git a/src/Web/Grand.Web/Controllers/InstallController.cs b/src/Web/Grand.Web/Controllers/InstallController.csindex 2674ce59d..d96b4fc0a 100644--- a/src/Web/Grand.Web/Controllers/InstallController.cs+++ b/src/Web/Grand.Web/Controllers/InstallController.cs@@ -65,7 +65,6 @@ namespace Grand.Web.ControllersAdminEmail = "[email protected]",InstallSampleData = false,DatabaseConnectionString = "",- SkipCreateIndex = false,};model.AvailableProviders = Enum.GetValues(typeof(DbProvider)).Cast<DbProvider>().Select(v => new SelectListItem {@@ -164,7 +163,7 @@ namespace Grand.Web.Controllersawait DataSettingsManager.SaveSettings(settings);var installationService = _serviceProvider.GetRequiredService<IInstallationService>();- await installationService.InstallData(model.AdminEmail, model.AdminPassword, model.Collation, model.SkipCreateIndex,+ await installationService.InstallData(model.AdminEmail, model.AdminPassword, model.Collation,model.InstallSampleData, model.CompanyName, model.CompanyAddress, model.CompanyPhoneNumber, model.CompanyEmail);//reset cachediff --git a/src/Web/Grand.Web/Models/Install/InstallModel.cs b/src/Web/Grand.Web/Models/Install/InstallModel.csindex bf6b0237b..e5231a754 100644--- a/src/Web/Grand.Web/Models/Install/InstallModel.cs+++ b/src/Web/Grand.Web/Models/Install/InstallModel.cs@@ -30,7 +30,6 @@ namespace Grand.Web.Models.Installpublic string MongoDBPassword { get; set; }public bool DisableSampleDataOption { get; set; }public bool InstallSampleData { get; set; }- public bool SkipCreateIndex { get; set; }public bool Installed { get; set; }public string Collation { get; set; }public List<SelectListItem> AvailableLanguages { get; set; }diff --git a/src/Web/Grand.Web/Views/Install/Index.cshtml b/src/Web/Grand.Web/Views/Install/Index.cshtmlindex ef9dae5cc..8935edd64 100644--- a/src/Web/Grand.Web/Views/Install/Index.cshtml+++ b/src/Web/Grand.Web/Views/Install/Index.cshtml@@ -18,207 +18,200 @@<div class="container">@if (!Model.Installed){- <form asp-action="Index" asp-controller="Install" id="installation-form" method="post" autocomplete="off">- <div class="row flex-row">- <div class="col-xl-5 col-lg-6 col-md-12 logo-container">- <img class="img-fluid" title="" alt="grandNode" src="~/logo.png" />- </div>- <div class="col-xl-7 col-lg-6 col-md-12">- <div class="row">- <div class="col-md">- <h1 class="generalTitle">@LocalizedService.GetResource("Title")</h1>- </div>- <div class="col-md-3 col-5 pt-3">- @Html.DropDownList("language", Model.AvailableLanguages, new { @class = "custom-select", onchange = "window.location.href = this.value;" })- </div>- </div>- </div>+ <form asp-action="Index" asp-controller="Install" id="installation-form" method="post" autocomplete="off">+ <div class="row flex-row">+ <div class="col-xl-5 col-lg-6 col-md-12 logo-container">+ <img class="img-fluid" title="" alt="grandNode" src="~/logo.png" /></div>- <div class="content">- <p>- @LocalizedService.GetResource("Tooltip2")- <div style="color: Red;">- @Html.ValidationSummary(false)+ <div class="col-xl-7 col-lg-6 col-md-12">+ <div class="row">+ <div class="col-md">+ <h1 class="generalTitle">@LocalizedService.GetResource("Title")</h1></div>- </p>- </div>- <div class="card">- <a href="https://bit.ly/3cD1drT" target="_blank"><img class="img-fluid" title="" alt="GrandNode Support Services" src="~/banner.jpg" /></a>+ <div class="col-md-3 col-5 pt-3">+ @Html.DropDownList("language", Model.AvailableLanguages, new { @class = "custom-select", onchange = "window.location.href = this.value;" })+ </div>+ </div></div>- <div class="card">- <h3 class="card-header">- @LocalizedService.GetResource("CompanyInformation")- </h3>- <div class="card-body">+ </div>+ <div class="content">+ <p>+ @LocalizedService.GetResource("Tooltip2")+ <div style="color: Red;">+ @Html.ValidationSummary(false)+ </div>+ </p>+ </div>+ <div class="card">+ <a href="https://bit.ly/3cD1drT" target="_blank"><img class="img-fluid" title="" alt="GrandNode Support Services" src="~/banner.jpg" /></a>+ </div>+ <div class="card">+ <h3 class="card-header">+ @LocalizedService.GetResource("CompanyInformation")+ </h3>+ <div class="card-body">- <div class="row">- <div class="col-md-6 col-12">- <label for="AdminPassword">- @LocalizedService.GetResource("CompanyName"):- </label>- <input asp-for="CompanyName" class="form-control" />- </div>- <div class="col-md-6">- <label for="ConfirmPassword">- @LocalizedService.GetResource("CompanyAddress"):- </label>- <input asp-for="CompanyAddress" class="form-control" />- </div>+ <div class="row">+ <div class="col-md-6 col-12">+ <label for="AdminPassword">+ @LocalizedService.GetResource("CompanyName"):+ </label>+ <input asp-for="CompanyName" class="form-control" /></div>- <div class="row">- <div class="col-md-6 col-12">- <label for="AdminPassword">- @LocalizedService.GetResource("CompanyPhoneNumber"):- </label>- <input asp-for="CompanyPhoneNumber" class="form-control" />- </div>- <div class="col-md-6">- <label for="ConfirmPassword">- @LocalizedService.GetResource("CompanyEmail"):- </label>- <input asp-for="CompanyEmail" class="form-control" />- </div>+ <div class="col-md-6">+ <label for="ConfirmPassword">+ @LocalizedService.GetResource("CompanyAddress"):+ </label>+ <input asp-for="CompanyAddress" class="form-control" /></div></div>- </div>- <div class="card">- <h3 class="card-header">- @LocalizedService.GetResource("StoreInformation")- </h3>- <div class="card-body">- <label for="AdminEmail" class="col-form-label">- @LocalizedService.GetResource("AdminEmail"):- </label>- <input asp-for="AdminEmail" class="form-control" required />- <div class="row">- <div class="col-md-6 col-12">- <label for="AdminPassword">- @LocalizedService.GetResource("AdminPassword"):- </label>- <input asp-for="AdminPassword" class="form-control password" required />- </div>- <div class="col-md-6">- <label for="ConfirmPassword">- @LocalizedService.GetResource("ConfirmPassword"):- </label>- <input asp-for="ConfirmPassword" class="form-control password" required />- </div>+ <div class="row">+ <div class="col-md-6 col-12">+ <label for="AdminPassword">+ @LocalizedService.GetResource("CompanyPhoneNumber"):+ </label>+ <input asp-for="CompanyPhoneNumber" class="form-control" />+ </div>+ <div class="col-md-6">+ <label for="ConfirmPassword">+ @LocalizedService.GetResource("CompanyEmail"):+ </label>+ <input asp-for="CompanyEmail" class="form-control" /></div></div></div>- <div class="card">- <h3 class="card-header">- @LocalizedService.GetResource("DataProvider")- </h3>- <div class="card-body">- @Html.DropDownList("DataProvider", Model.AvailableProviders, new { @class = "custom-select", onchange = "DataProviderChange(this.value);" })- <label class="custom-control custom-checkbox my-3">- <input asp-for="SkipCreateIndex" class="custom-control-input" />- <span class="custom-control-label"></span>- <span class="custom-control-description">@LocalizedService.GetResource("SkipCreateIndex")</span>- </label>+ </div>+ <div class="card">+ <h3 class="card-header">+ @LocalizedService.GetResource("StoreInformation")+ </h3>+ <div class="card-body">+ <label for="AdminEmail" class="col-form-label">+ @LocalizedService.GetResource("AdminEmail"):+ </label>+ <input asp-for="AdminEmail" class="form-control" required />+ <div class="row">+ <div class="col-md-6 col-12">+ <label for="AdminPassword">+ @LocalizedService.GetResource("AdminPassword"):+ </label>+ <input asp-for="AdminPassword" class="form-control password" required />+ </div>+ <div class="col-md-6">+ <label for="ConfirmPassword">+ @LocalizedService.GetResource("ConfirmPassword"):+ </label>+ <input asp-for="ConfirmPassword" class="form-control password" required />+ </div></div></div>- @if (!Model.DisableSampleDataOption)- {- <div nowrap="nowrap" align="left">- <label class="custom-control custom-checkbox my-3">- <input asp-for="InstallSampleData" class="custom-control-input" />- <span class="custom-control-label"></span>- <span class="custom-control-description">@LocalizedService.GetResource("CreateSampleData")</span>- </label>- </div>- }- <section id="ConnectionInformation">- <div id="DBSampleData">- <div class="card">- <h3 class="card-header">- @LocalizedService.GetResource("DatabaseInformation")- </h3>- <div class="card-body">- <label for="MongoDBServerName">- @LocalizedService.GetResource("MongoDBServerName"):- </label>- <input asp-for="MongoDBServerName" class="form-control" />- <div class="row mongoDBDatabaseName">- <div class="col-6">- <label for="MongoDBDatabaseName">- @LocalizedService.GetResource("DatabaseName"):- </label>- <input asp-for="MongoDBDatabaseName" class="form-control" />- </div>- <div class="col-6 collation" id="collation">- <label for="Collation">- @LocalizedService.GetResource("Collation"):- </label>- @Html.DropDownList("Collation", Model.AvailableCollation, new { @class = "custom-select" })- </div>+ </div>+ <div class="card">+ <h3 class="card-header">+ @LocalizedService.GetResource("DataProvider")+ </h3>+ <div class="card-body">+ @Html.DropDownList("DataProvider", Model.AvailableProviders, new { @class = "custom-select", onchange = "DataProviderChange(this.value);" })+ </div>+ </div>+ @if (!Model.DisableSampleDataOption)+ {+ <div nowrap="nowrap" align="left">+ <label class="custom-control custom-checkbox my-3">+ <input asp-for="InstallSampleData" class="custom-control-input" />+ <span class="custom-control-label"></span>+ <span class="custom-control-description">@LocalizedService.GetResource("CreateSampleData")</span>+ </label>+ </div>+ }+ <section id="ConnectionInformation">+ <div id="DBSampleData">+ <div class="card">+ <h3 class="card-header">+ @LocalizedService.GetResource("DatabaseInformation")+ </h3>+ <div class="card-body">+ <label for="MongoDBServerName">+ @LocalizedService.GetResource("MongoDBServerName"):+ </label>+ <input asp-for="MongoDBServerName" class="form-control" />+ <div class="row mongoDBDatabaseName">+ <div class="col-6">+ <label for="MongoDBDatabaseName">+ @LocalizedService.GetResource("DatabaseName"):+ </label>+ <input asp-for="MongoDBDatabaseName" class="form-control" /></div>- <div class="row">- <div class="col-6">- <label for="MongoDBUsername">- @LocalizedService.GetResource("MongoDBUsername"):- </label>- <input asp-for="MongoDBUsername" class="form-control" />- </div>- <div class="col-6">- <label for="MongoDBPassword">- @LocalizedService.GetResource("MongoDBPassword"):- </label>- <input asp-for="MongoDBPassword" class="form-control password" />- </div>+ <div class="col-6 collation" id="collation">+ <label for="Collation">+ @LocalizedService.GetResource("Collation"):+ </label>+ @Html.DropDownList("Collation", Model.AvailableCollation, new { @class = "custom-select" })+ </div>+ </div>+ <div class="row">+ <div class="col-6">+ <label for="MongoDBUsername">+ @LocalizedService.GetResource("MongoDBUsername"):+ </label>+ <input asp-for="MongoDBUsername" class="form-control" />+ </div>+ <div class="col-6">+ <label for="MongoDBPassword">+ @LocalizedService.GetResource("MongoDBPassword"):+ </label>+ <input asp-for="MongoDBPassword" class="form-control password" /></div></div></div></div>+ </div>- <label class="custom-control custom-checkbox my-3">- <input asp-for="ConnectionInfo" onchange="toggleMongoDBConnectionInfo()" class="custom-control-input" />- <span class="custom-control-label"></span>- <span class="custom-control-description">@LocalizedService.GetResource("ConnectionString"):</span>- </label>- <div id="DatabaseConnectionString" class="connection-string-container" style="display:none;">- <span style="white-space: nowrap;">- <input asp-for="DatabaseConnectionString" class="textbox form-control" />- </span>- <span class="hint">- @LocalizedService.GetResource("Example"):<br />- For MongoDB: @Html.Raw("mongodb://[username:password@]host1[:port1]/databaseName")- (Find more info <a href="https://docs.mongodb.org/manual/reference/connection-string/" target="_blank">here</a>)- <br />- For Amazon DocumentDB - you can't use Collation - is not supported- </span>- </div>- </section>- <div class="row">- <div class="col-12">- @LocalizedService.GetResource("Documentation1") <a href="https://docs.grandnode.com/" target="_blank">@LocalizedService.GetResource("Documentation2")</a>.- </div>- <div class="col-6 text-left">- <input class="btn btn-success" type="button" id="installation" name="installation" value="@LocalizedService.GetResource("Install")" style="width: 100px;" />- </div>- <div class="col-6 text-right">- <a class="btn btn-secondary" href="@Url.Action("RestartInstall", "Install")" title="@LocalizedService.GetResource("RestartInstallationTooltip")">- @LocalizedService.GetResource("RestartInstallation")- </a>- </div>+ <label class="custom-control custom-checkbox my-3">+ <input asp-for="ConnectionInfo" onchange="toggleMongoDBConnectionInfo()" class="custom-control-input" />+ <span class="custom-control-label"></span>+ <span class="custom-control-description">@LocalizedService.GetResource("ConnectionString"):</span>+ </label>+ <div id="DatabaseConnectionString" class="connection-string-container" style="display:none;">+ <span style="white-space: nowrap;">+ <input asp-for="DatabaseConnectionString" class="textbox form-control" />+ </span>+ <span class="hint">+ @LocalizedService.GetResource("Example"):<br />+ For MongoDB: @Html.Raw("mongodb://[username:password@]host1[:port1]/databaseName")+ (Find more info <a href="https://docs.mongodb.org/manual/reference/connection-string/" target="_blank">here</a>)+ </span></div>- <div class="throbber">- <div class="curtain">- </div>- <div class="curtain-content">- <div>- <h1 class="throbber-header">@LocalizedService.GetResource("Installing")</h1>- <div class="spinner active">- <svg style="width:100px; height:100px" viewBox="0 0 64 64">- <circle cx="32" cy="32" r="29" fill="none" stroke-width="3" stroke-miterlimit="10"></circle>- </svg>- </div>+ </section>+ <div class="row">+ <div class="col-12">+ @LocalizedService.GetResource("Documentation1") <a href="https://docs.grandnode.com/" target="_blank">@LocalizedService.GetResource("Documentation2")</a>.+ </div>+ <div class="col-6 text-left">+ <input class="btn btn-success" type="button" id="installation" name="installation" value="@LocalizedService.GetResource("Install")" style="width: 100px;" />+ </div>+ <div class="col-6 text-right">+ <a class="btn btn-secondary" href="@Url.Action("RestartInstall", "Install")" title="@LocalizedService.GetResource("RestartInstallationTooltip")">+ @LocalizedService.GetResource("RestartInstallation")+ </a>+ </div>+ </div>+ <div class="throbber">+ <div class="curtain">+ </div>+ <div class="curtain-content">+ <div>+ <h1 class="throbber-header">@LocalizedService.GetResource("Installing")</h1>+ <div class="spinner active">+ <svg style="width:100px; height:100px" viewBox="0 0 64 64">+ <circle cx="32" cy="32" r="29" fill="none" stroke-width="3" stroke-miterlimit="10"></circle>+ </svg></div></div></div>- </form>+ </div>+ </form>}else{diff --git a/src/Web/Grand.Web/wwwroot/assets/install/install.js b/src/Web/Grand.Web/wwwroot/assets/install/install.jsindex 35070dfd4..0c2942070 100644--- a/src/Web/Grand.Web/wwwroot/assets/install/install.js+++ b/src/Web/Grand.Web/wwwroot/assets/install/install.js@@ -22,10 +22,6 @@ function DataProviderChange(provider) {if (!elm.checked) {elm.click();}- let collation = document.getElementById('Collation');- if (collation.value != "") {- collation.value = "";- }}else {var elm = document.getElementById('ConnectionInfo');