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 Shipping.ShippingPoint - change type of project to Microsoft.NET.Sdk.Razor

KrzysztofPajakb85278cb78fd
diff --git a/src/Plugins/Shipping.ShippingPoint/Controllers/ShippingPointController.cs b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Controllers/ShippingPointController.cs
similarity index 93%
rename from src/Plugins/Shipping.ShippingPoint/Controllers/ShippingPointController.cs
rename to src/Plugins/Shipping.ShippingPoint/Areas/Admin/Controllers/ShippingPointController.cs
index 9415dc822..614b99dd7 100644
--- a/src/Plugins/Shipping.ShippingPoint/Controllers/ShippingPointController.cs
+++ b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Controllers/ShippingPointController.cs
@@ -51,7 +51,7 @@ namespace Shipping.ShippingPoint.Controllers
public IActionResult Configure()
{
- return View("~/Plugins/Shipping.ShippingPoint/Views/Configure.cshtml");
+ return View();
}
[HttpPost]
@@ -97,7 +97,7 @@ namespace Shipping.ShippingPoint.Controllers
{
var model = new ShippingPointModel();
await PrepareShippingPointModel(model);
- return View("~/Plugins/Shipping.ShippingPoint/Views/Create.cshtml", model);
+ return View(model);
}
[HttpPost]
@@ -113,7 +113,7 @@ namespace Shipping.ShippingPoint.Controllers
await PrepareShippingPointModel(model);
- return View("~/Plugins/Shipping.ShippingPoint/Views/Create.cshtml", model);
+ return View(model);
}
public async Task<IActionResult> Edit(string id)
@@ -121,7 +121,7 @@ namespace Shipping.ShippingPoint.Controllers
var shippingPoints = await _shippingPointService.GetStoreShippingPointById(id);
var model = shippingPoints.ToModel();
await PrepareShippingPointModel(model);
- return View("~/Plugins/Shipping.ShippingPoint/Views/Edit.cshtml", model);
+ return View(model);
}
[HttpPost]
@@ -137,7 +137,7 @@ namespace Shipping.ShippingPoint.Controllers
await PrepareShippingPointModel(model);
- return View("~/Plugins/Shipping.ShippingPoint/Views/Edit.cshtml", model);
+ return View(model);
}
[HttpPost]
diff --git a/src/Plugins/Shipping.ShippingPoint/Views/Configure.cshtml b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Configure.cshtml
similarity index 100%
rename from src/Plugins/Shipping.ShippingPoint/Views/Configure.cshtml
rename to src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Configure.cshtml
diff --git a/src/Plugins/Shipping.ShippingPoint/Views/Create.cshtml b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Create.cshtml
similarity index 90%
rename from src/Plugins/Shipping.ShippingPoint/Views/Create.cshtml
rename to src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Create.cshtml
index 104fb7163..c06f454a1 100644
--- a/src/Plugins/Shipping.ShippingPoint/Views/Create.cshtml
+++ b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Create.cshtml
@@ -26,7 +26,7 @@
</div>
<div class="content">
<div class="form-horizontal">
- <partial name="~/Plugins/Shipping.ShippingPoint/Views/_CreateOrUpdate.cshtml" model="Model" />
+ <partial name="_CreateOrUpdate" model="Model" />
</div>
</div>
</form>
\ No newline at end of file
diff --git a/src/Plugins/Shipping.ShippingPoint/Views/Edit.cshtml b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Edit.cshtml
similarity index 90%
rename from src/Plugins/Shipping.ShippingPoint/Views/Edit.cshtml
rename to src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Edit.cshtml
index 3d15ae7b4..f8ed522c6 100644
--- a/src/Plugins/Shipping.ShippingPoint/Views/Edit.cshtml
+++ b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/Edit.cshtml
@@ -26,7 +26,7 @@
</div>
<div class="content">
<div class="form-horizontal">
- <partial name="~/Plugins/Shipping.ShippingPoint/Views/_CreateOrUpdate.cshtml" model="Model" />
+ <partial name="_CreateOrUpdate" model="Model" />
</div>
</div>
</form>
\ No newline at end of file
diff --git a/src/Plugins/Shipping.ShippingPoint/Views/_CreateOrUpdate.cshtml b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/_CreateOrUpdate.cshtml
similarity index 100%
rename from src/Plugins/Shipping.ShippingPoint/Views/_CreateOrUpdate.cshtml
rename to src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/ShippingPoint/_CreateOrUpdate.cshtml
diff --git a/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/_ViewImports.cshtml b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/_ViewImports.cshtml
new file mode 100644
index 000000000..20cb126bd
--- /dev/null
+++ b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Views/_ViewImports.cshtml
@@ -0,0 +1,8 @@
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@addTagHelper *, Grand.Web.Common
+@addTagHelper *, Grand.Web
+
+@using Microsoft.AspNetCore.Mvc.ViewFeatures
+@using Grand.Infrastructure.Extensions
+@using Grand.Web.Common
+@inject Grand.Web.Common.Localization.LocService Loc
diff --git a/src/Plugins/Shipping.ShippingPoint/Components/SelectedShippingPointViewComponent.cs b/src/Plugins/Shipping.ShippingPoint/Components/SelectedShippingPointViewComponent.cs
index e8e6b3c18..07872d664 100644
--- a/src/Plugins/Shipping.ShippingPoint/Components/SelectedShippingPointViewComponent.cs
+++ b/src/Plugins/Shipping.ShippingPoint/Components/SelectedShippingPointViewComponent.cs
@@ -39,7 +39,7 @@ namespace Shipping.ShippingPoint.Components
shippingPointsModel.Add(new SelectListItem() { Value = shippingPoint.Id, Text = shippingPoint.ShippingPointName });
}
- return View("~/Plugins/Shipping.ShippingPoint/Views/FormComboBox.cshtml", shippingPointsModel);
+ return View(shippingPointsModel);
}
return Content("ShippingPointController: given Shipping Option doesn't exist");
diff --git a/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs b/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs
index 7f3c71108..3b8a9b1a7 100644
--- a/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs
+++ b/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs
@@ -24,8 +24,7 @@ namespace Shipping.ShippingPoint.Controllers
var shippingPoint = await _shippingPointService.GetStoreShippingPointById(shippingOptionId);
if (shippingPoint != null)
{
- var viewModel = new PointModel()
- {
+ var viewModel = new PointModel() {
ShippingPointName = shippingPoint.ShippingPointName,
Description = shippingPoint.Description,
PickupFee = _priceFormatter.FormatShippingPrice(shippingPoint.PickupFee),
@@ -35,7 +34,7 @@ namespace Shipping.ShippingPoint.Controllers
CountryName = (await _countryService.GetCountryById(shippingPoint.CountryId))?.Name,
ZipPostalCode = shippingPoint.ZipPostalCode,
};
- return View("~/Plugins/Shipping.ShippingPoint/Views/FormShippingOption.cshtml", viewModel);
+ return View(viewModel);
}
return Content("ShippingPointController: given Shipping Option doesn't exist");
}
diff --git a/src/Plugins/Shipping.ShippingPoint/Shipping.ShippingPoint.csproj b/src/Plugins/Shipping.ShippingPoint/Shipping.ShippingPoint.csproj
index bff8ec4d5..1be8c1a55 100644
--- a/src/Plugins/Shipping.ShippingPoint/Shipping.ShippingPoint.csproj
+++ b/src/Plugins/Shipping.ShippingPoint/Shipping.ShippingPoint.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)'=='Debug|AnyCPU'">
@@ -69,31 +70,9 @@
</ProjectReference>
</ItemGroup>
- <ItemGroup>
+ <ItemGroup>
<None Update="logo.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Update="Views\Configure.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\Create.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\Edit.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\FormComboBox.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\FormShippingOption.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\_CreateOrUpdate.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Update="Views\_ViewImports.cshtml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
</ItemGroup>
-
</Project>
\ No newline at end of file
diff --git a/src/Plugins/Shipping.ShippingPoint/Views/FormShippingOption.cshtml b/src/Plugins/Shipping.ShippingPoint/Views/SelectedShippingPoint/Get.cshtml
similarity index 95%
rename from src/Plugins/Shipping.ShippingPoint/Views/FormShippingOption.cshtml
rename to src/Plugins/Shipping.ShippingPoint/Views/SelectedShippingPoint/Get.cshtml
index e97f8779b..fae1ee58b 100644
--- a/src/Plugins/Shipping.ShippingPoint/Views/FormShippingOption.cshtml
+++ b/src/Plugins/Shipping.ShippingPoint/Views/SelectedShippingPoint/Get.cshtml
@@ -1,5 +1,7 @@
@model Shipping.ShippingPoint.Models.PointModel
-
+@{
+ Layout = "";
+}
<div class="form-horizontal">
<div class="form-body">
<div class="row">
diff --git a/src/Plugins/Shipping.ShippingPoint/Views/FormComboBox.cshtml b/src/Plugins/Shipping.ShippingPoint/Views/Shared/Components/ShippingPoint/Default.cshtml
similarity index 100%
rename from src/Plugins/Shipping.ShippingPoint/Views/FormComboBox.cshtml
rename to src/Plugins/Shipping.ShippingPoint/Views/Shared/Components/ShippingPoint/Default.cshtml