Skip to content

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.

Plugin Widgets.GoogleAnalytics - change type of project to Microsoft.NET.Sdk.Razor

KrzysztofPajak4bafb9570fc1
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Controllers/WidgetsGoogleAnalyticsController.cs b/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Controllers/WidgetsGoogleAnalyticsController.cs
similarity index 97%
rename from src/Plugins/Widgets.GoogleAnalytics/Controllers/WidgetsGoogleAnalyticsController.cs
rename to src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Controllers/WidgetsGoogleAnalyticsController.cs
index 49b15cb29..15b9b10eb 100644
--- a/src/Plugins/Widgets.GoogleAnalytics/Controllers/WidgetsGoogleAnalyticsController.cs
+++ b/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Controllers/WidgetsGoogleAnalyticsController.cs
@@ -66,7 +66,7 @@ namespace Widgets.GoogleAnalytics.Controllers
model.ConsentDescription = googleAnalyticsSettings.ConsentDescription;
model.StoreScope = storeScope;
- return View("~/Plugins/Widgets.GoogleAnalytics/Views/Configure.cshtml", model);
+ return View(model);
}
[HttpPost]
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Views/Configure.cshtml b/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Views/WidgetsGoogleAnalytics/Configure.cshtml
similarity index 100%
rename from src/Plugins/Widgets.GoogleAnalytics/Views/Configure.cshtml
rename to src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Views/WidgetsGoogleAnalytics/Configure.cshtml
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Views/_ViewImports.cshtml b/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Views/_ViewImports.cshtml
similarity index 100%
rename from src/Plugins/Widgets.GoogleAnalytics/Views/_ViewImports.cshtml
rename to src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Views/_ViewImports.cshtml
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs b/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs
index 9a2e58e53..77017c9cb 100644
--- a/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs
+++ b/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs
@@ -76,8 +76,7 @@ namespace Widgets.GoogleAnalytics.Components
{
await _logger.InsertLog(LogLevel.Error, "Error creating scripts for google ecommerce tracking", ex.ToString());
}
-
- return View("~/Plugins/Widgets.GoogleAnalytics/Views/PublicInfo.cshtml", globalScript);
+ return View("Default", globalScript);
}
private async Task<Order> GetLastOrder()
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Views/PublicInfo.cshtml b/src/Plugins/Widgets.GoogleAnalytics/Views/Shared/Components/WidgetsGoogleAnalytics/Default.cshtml
similarity index 100%
rename from src/Plugins/Widgets.GoogleAnalytics/Views/PublicInfo.cshtml
rename to src/Plugins/Widgets.GoogleAnalytics/Views/Shared/Components/WidgetsGoogleAnalytics/Default.cshtml
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Widgets.GoogleAnalytics.csproj b/src/Plugins/Widgets.GoogleAnalytics/Widgets.GoogleAnalytics.csproj
index ee0ac4935..dbd36ca1f 100644
--- a/src/Plugins/Widgets.GoogleAnalytics/Widgets.GoogleAnalytics.csproj
+++ b/src/Plugins/Widgets.GoogleAnalytics/Widgets.GoogleAnalytics.csproj
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
@@ -7,6 +7,7 @@
<Authors>UNIT-SOFT Sp. z o.o.</Authors>
<PackageProjectUrl>https://grandnode.com/</PackageProjectUrl>
<TieredCompilation>true</TieredCompilation>
+ <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -72,16 +73,7 @@
<ItemGroup>
<None Update="logo.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\PublicInfo.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\Configure.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\_ViewImports.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
+ </None>
</ItemGroup>
</Project>