Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 54 additions & 49 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,75 +5,80 @@
<ItemGroup>
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.6.0" />
<PackageVersion Include="ExcelMapper" Version="6.0.641" />
<PackageVersion Include="HtmlSanitizer" Version="9.2.995" />
<PackageVersion Include="Microsoft.Build.Tasks.Git" Version="10.0.401" />
<PackageVersion Include="HtmlSanitizer" Version="9.2.1039" />
<PackageVersion Include="MessagePack" Version="3.1.8" />
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.11" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.10" />
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.6.0" />
<PackageVersion Include="Microsoft.OpenApi" Version="2.11.0" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.16.16" />
<PackageVersion Include="Scryber.Core" Version="9.5.0" />
<PackageVersion Include="Scryber.Core.OpenType" Version="9.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.13" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.12" />
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.7.0" />
<PackageVersion Include="Microsoft.OpenApi" Version="2.12.2" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.17.3" />
<PackageVersion Include="Scryber.Core" Version="9.7.4.2" />
<PackageVersion Include="Scryber.Core.OpenType" Version="9.7.4" />
<PackageVersion Include="MailKit" Version="4.17.0" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.100.9" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.101.5" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.29.1" />
<PackageVersion Include="SkiaSharp" Version="4.150.1" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="4.150.1" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.102.5" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.103.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.29.2" />
<PackageVersion Include="SkiaSharp" Version="4.152.0" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="4.152.0" />
<PackageVersion Include="LiteDB" Version="5.0.21" />
<PackageVersion Include="MongoDB.Bson" Version="3.10.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.10.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.11.2" />
<PackageVersion Include="MongoDB.Driver" Version="3.11.2" />
<PackageVersion Include="DotLiquid" Version="2.3.197" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
<PackageVersion Include="GoogleAuthenticator" Version="3.2.0" />
<PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.5.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="10.0.10" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.6.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.6.0" />
<PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.6.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.12" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.12" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.12" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="10.0.12" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.9.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.9.0" />
<PackageVersion Include="Scrutor" Version="7.0.0" />
<PackageVersion Include="StackExchange.Redis" Version="3.0.17" />
<PackageVersion Include="StackExchange.Redis" Version="3.2.0" />
<PackageVersion Include="FluentValidation" Version="12.1.1" />
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch.SystemTextJson" Version="10.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="10.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="10.0.10" />
<PackageVersion Include="Braintree" Version="5.39.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="10.0.10" />
<PackageVersion Include="System.Linq.Dynamic.Core" Version="1.7.3" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="10.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch.SystemTextJson" Version="10.0.12" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="10.0.12" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="10.0.12" />
<PackageVersion Include="Braintree" Version="5.41.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="10.0.12" />
<PackageVersion Include="System.Linq.Dynamic.Core" Version="1.7.4" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="10.0.12" />
<PackageVersion Include="System.Xml.XPath.XmlDocument" Version="4.7.0" />
<PackageVersion Include="Stripe.net" Version="51.1.0" />
<PackageVersion Include="Stripe.net" Version="52.4.2" />
<PackageVersion Include="elFinder.Net.AspNetCore" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Core" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Drivers.FileSystem" Version="1.5.0" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.5.3" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.3" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.5.4" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.4" />
<PackageVersion Include="Azure.Identity" Version="1.21.0" />
<PackageVersion Include="Flurl.Http" Version="4.0.2" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="10.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="10.0.12" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.3.1" />
<PackageVersion Include="Wangkanai.Detection" Version="8.20.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.10" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.12" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.10.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="MSTest.TestAdapter" Version="4.3.3" />
<PackageVersion Include="MSTest.TestFramework" Version="4.3.3" />
<PackageVersion Include="MSTest.TestAdapter" Version="4.4.0" />
<PackageVersion Include="MSTest.TestFramework" Version="4.4.0" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="NUnit" Version="4.6.1" />
<PackageVersion Include="Verify.MSTest" Version="31.27.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.4.6" />
<PackageVersion Include="Aspire.Hosting.MongoDB" Version="13.4.6" />
<PackageVersion Include="Aspire.Hosting.Redis" Version="13.4.6" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.8.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.8.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.17.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.17.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.17.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.17.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.17.0" />
<PackageVersion Include="Verify.MSTest" Version="32.0.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.5.3" />
<PackageVersion Include="Aspire.Hosting.MongoDB" Version="13.5.3" />
<PackageVersion Include="Aspire.Hosting.Redis" Version="13.5.3" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.10.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.10.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.18.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.18.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.18.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.18.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.18.0" />
<PackageVersion Include="Aspire.Dashboard.Sdk.$(NETCoreSdkRuntimeIdentifier)" Version="13.4.6" />
<PackageVersion Include="Aspire.Hosting.Orchestration.$(NETCoreSdkRuntimeIdentifier)" Version="13.4.6" />
</ItemGroup>
<ItemGroup>
<PackageVersion Update="Aspire.Dashboard.Sdk.win-x64" Version="13.5.3" />
<PackageVersion Update="Aspire.Hosting.Orchestration.win-x64" Version="13.5.3" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\Build\Grand.Common.props" />
<ItemGroup>
<PackageReference Include="ExcelMapper" />
<PackageReference Include="ExcelMapper" />
<PackageReference Include="Microsoft.Build.Tasks.Git" PrivateAssets="All" />
<PackageReference Include="Scryber.Core" />
<PackageReference Include="Scryber.Core.OpenType" />
<PackageReference Include="System.Security.Cryptography.Xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ namespace Grand.Business.Common.Utilities;

internal static class PowerExcelExtensions
{
[Obsolete("This method is obsolete. Use the new method instead.")]
internal static IEnumerable<IRow> Rows(this ISheet sheet)
{
var e = sheet.GetRowEnumerator();
while (e.MoveNext())
yield return e.Current as IRow;
}

internal static bool IsIdenticalTo(this MemberInfo memberInfo, MemberInfo other)
{
if (memberInfo == null || other == null) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private IEnumerable Fetch(ISheet sheet, Type type, Func<string, object, object>
var firstRowNumber = HeaderRowNumber;

if (!HeaderRow)
firstRowNumber = sheet.Rows().Where(r => r.RowNum >= MinRowNumber && r.RowNum <= MaxRowNumber)
firstRowNumber = sheet.Where(r => r.RowNum >= MinRowNumber && r.RowNum <= MaxRowNumber)
.OrderByDescending(r => r.LastCellNum).FirstOrDefault()?.RowNum ?? 0;

var firstRow = sheet.GetRow(firstRowNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public async Task PublishAsync_SubscriberThrows_DoesNotPropagateException()
{
_subscriberMock.Setup(s =>
s.PublishAsync(It.IsAny<RedisChannel>(), It.IsAny<RedisValue>(), It.IsAny<CommandFlags>()))
.ThrowsAsync(new RedisConnectionException(ConnectionFailureType.SocketFailure, "connection lost"));
.ThrowsAsync(new RedisConnectionException(ConnectionFailureType.SocketFailure, CommandFlags.None,
"connection lost", null, CommandStatus.Unknown));

await _bus.PublishAsync(new MessageEvent { Key = "key", MessageType = (int)MessageEventType.RemoveKey });
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Common;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Business.Core.Interfaces.Catalog.Directory;
using Grand.Business.Core.Interfaces.Checkout.CheckoutAttributes;
using Grand.Business.Core.Interfaces.Common.Directory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Business.Core.Interfaces.Catalog.Brands;
using Grand.Business.Core.Interfaces.Catalog.Categories;
using Grand.Business.Core.Interfaces.Catalog.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Messages;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Domain.Blogs;
using Grand.Web.AdminShared.Interfaces;
using Grand.Web.AdminShared.Services;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Domain.Blogs;
using Grand.Web.AdminShared.Interfaces;
using Grand.Web.AdminShared.Services;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Domain.Customers;
using Grand.Domain.Messages;
using Grand.Infrastructure;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Grand.Domain.Customers;
using Grand.Domain.Tax;
using Grand.Infrastructure;
Expand Down
20 changes: 10 additions & 10 deletions src/Web/Grand.Web.Admin/Controllers/DiscountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public class DiscountController(
public async Task<IActionResult> VendorList(DataSourceRequest command, string discountId,
[FromServices] IVendorService vendorService)
{
var discount = await discountService.GetDiscountById(discountId);
var discount = await DiscountService.GetDiscountById(discountId);
if (discount == null)
throw new Exception("No discount found with the specified id");
if (!await scope.CanView(discount))
if (!await Scope.CanView(discount))
return new JsonResult(new DataSourceResult { Errors = "Access denied" });

var vendors = await vendorService.GetAllVendorsByDiscount(discount.Id);
Expand All @@ -73,18 +73,18 @@ public async Task<IActionResult> VendorList(DataSourceRequest command, string di
public async Task<IActionResult> VendorDelete(string discountId, string vendorId,
[FromServices] IVendorService vendorService)
{
var discount = await discountService.GetDiscountById(discountId);
var discount = await DiscountService.GetDiscountById(discountId);
if (discount == null)
throw new Exception("No discount found with the specified id");
if (!await scope.HasAccess(discount))
if (!await Scope.HasAccess(discount))
return new JsonResult(new DataSourceResult { Errors = "Access denied" });

var vendor = await vendorService.GetVendorById(vendorId);
if (vendor == null)
throw new Exception("No vendor found with the specified id");
if (ModelState.IsValid)
{
await discountViewModelService.DeleteVendor(discount, vendor);
await DiscountViewModelService.DeleteVendor(discount, vendor);
return new JsonResult("");
}
return ErrorForKendoGridJson(ModelState);
Expand All @@ -93,10 +93,10 @@ public async Task<IActionResult> VendorDelete(string discountId, string vendorId
[PermissionAuthorizeAction(PermissionActionName.Edit)]
public async Task<IActionResult> VendorAddPopup(string discountId)
{
var discount = await discountService.GetDiscountById(discountId);
var discount = await DiscountService.GetDiscountById(discountId);
if (discount == null)
throw new Exception("No discount found with the specified id");
if (!await scope.HasAccess(discount))
if (!await Scope.HasAccess(discount))
return new JsonResult(new DataSourceResult { Errors = "Access denied" });

return View(new DiscountModel.AddVendorToDiscountModel());
Expand All @@ -122,13 +122,13 @@ public async Task<IActionResult> VendorAddPopupList(DataSourceRequest command,
[HttpPost]
public async Task<IActionResult> VendorAddPopup(DiscountModel.AddVendorToDiscountModel model)
{
var discount = await discountService.GetDiscountById(model.DiscountId);
var discount = await DiscountService.GetDiscountById(model.DiscountId);
if (discount == null)
throw new Exception("No discount found with the specified id");
if (!await scope.HasAccess(discount))
if (!await Scope.HasAccess(discount))
return Content("Access denied");

if (model.SelectedVendorIds != null) await discountViewModelService.InsertVendorToDiscountModel(model);
if (model.SelectedVendorIds != null) await DiscountViewModelService.InsertVendorToDiscountModel(model);
return Content("");
}

Expand Down
4 changes: 2 additions & 2 deletions src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public IActionResult List()
[PermissionAuthorizeAction(PermissionActionName.List)]
public async Task<IActionResult> List(DataSourceRequest command)
{
var emailAccounts = await emailAccountService.GetAllEmailAccounts(scope.DefaultStoreId ?? "",
var emailAccounts = await EmailAccountService.GetAllEmailAccounts(Scope.DefaultStoreId ?? "",
pageIndex: command.Page - 1, pageSize: command.PageSize);
var emailAccountModels = emailAccounts.Select(x => x.ToModel()).ToList();
foreach (var eam in emailAccountModels)
Expand All @@ -59,7 +59,7 @@ public async Task<IActionResult> List(DataSourceRequest command)
[PermissionAuthorizeAction(PermissionActionName.Edit)]
public async Task<IActionResult> MarkAsDefaultEmail(string id)
{
var defaultEmailAccount = await emailAccountService.GetEmailAccountById(id);
var defaultEmailAccount = await EmailAccountService.GetEmailAccountById(id);
if (defaultEmailAccount != null)
{
emailAccountSettings.DefaultEmailAccountId = defaultEmailAccount.Id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task<IActionResult> List()
{
var model = new MessageTemplateListModel();
model.AvailableStores.Add(new SelectListItem
{ Text = translationService.GetResource("Admin.Common.All"), Value = "" });
{ Text = TranslationService.GetResource("Admin.Common.All"), Value = "" });
foreach (var s in await storeService.GetAllStores())
model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });

Expand All @@ -54,7 +54,7 @@ public async Task<IActionResult> List()
[HttpPost]
public async Task<IActionResult> List(DataSourceRequest command, MessageTemplateListModel model)
{
var messageTemplates = await messageTemplateService.GetAllMessageTemplates(
var messageTemplates = await MessageTemplateService.GetAllMessageTemplates(
model.SearchStoreId,
keywords: model.Name,
pageIndex: command.Page - 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ public class OnlineCustomerController(
IContextAccessor contextAccessor)
: BaseOnlineCustomerController(customerService, dateTimeService, customerSettings, translationService, contextAccessor)
{
protected override string SalesEmployeeIdFilter => contextAccessor.WorkContext.CurrentCustomer.SeId;
protected override string SalesEmployeeIdFilter => ContextAccessor.WorkContext.CurrentCustomer.SeId;
}
Loading
Loading