Skip to content

VCST-3299: Update catalog module #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 10, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,16 @@ public static bool ProductHasPropertyValues(this CatalogProduct product, Diction
return propertyValues.Where(x => x.Key != null).All(kvp =>
{
// return true if no specific property values were selected, treating it as all properties
if (kvp.Value.IsNullOrEmpty()) return true;

var productProperty = product.Properties.FirstOrDefault(x => x.Name.EqualsInvariant(kvp.Key));
if (productProperty == null) return false;
if (kvp.Value.IsNullOrEmpty())
{
return true;
}

var productProperty = product.Properties.FirstOrDefault(x => x.Name.EqualsIgnoreCase(kvp.Key));
if (productProperty == null)
{
return false;
}

var productPropertyValues = productProperty.Values.Where(x => x.Value != null).Select(x => x.Value.ToString()).Distinct().ToList();
return kvp.Value.Intersect(productPropertyValues, StringComparer.OrdinalIgnoreCase).Any();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ public class AssociationRuleTreePrototype : ConditionTree
public AssociationRuleTreePrototype()
{
var matchingRules = new BlockMatchingRules()
.WithAvailConditions(
.WithAvailableChildren(
new ConditionProductCategory(),
new ConditionPropertyValues()
);
var resultingRules = new BlockResultingRules()
.WithAvailConditions(
.WithAvailableChildren(
new ConditionProductCategory(),
new ConditionPropertyValues()
);
var outputTuning = new BlockOutputTuning();

WithAvailConditions(
WithAvailableChildren(
matchingRules,
resultingRules,
outputTuning
);
WithChildrens(
WithChildren(
matchingRules,
resultingRules,
outputTuning
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand All @@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.CatalogModule.Core" Version="3.822.0" />
<PackageReference Include="VirtoCommerce.CoreModule.Core" Version="3.808.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.853.0" />
<PackageReference Include="VirtoCommerce.CatalogModule.Core" Version="3.868.0" />
<PackageReference Include="VirtoCommerce.CoreModule.Core" Version="3.821.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.889.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="VirtoCommerce.Platform.Data.MySql" Version="3.853.0" />
<PackageReference Include="VirtoCommerce.Platform.Data.MySql" Version="3.889.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.DynamicAssociationsModule.Data\VirtoCommerce.DynamicAssociationsModule.Data.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="VirtoCommerce.Platform.Data.PostgreSql" Version="3.853.0" />
<PackageReference Include="VirtoCommerce.Platform.Data.PostgreSql" Version="3.889.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.DynamicAssociationsModule.Data\VirtoCommerce.DynamicAssociationsModule.Data.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="VirtoCommerce.Platform.Data.SqlServer" Version="3.853.0" />
<PackageReference Include="VirtoCommerce.Platform.Data.SqlServer" Version="3.889.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.DynamicAssociationsModule.Data\VirtoCommerce.DynamicAssociationsModule.Data.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.Platform.Data" Version="3.853.0" />
<PackageReference Include="VirtoCommerce.Platform.Hangfire" Version="3.853.0" />
<PackageReference Include="VirtoCommerce.StoreModule.Core" Version="3.809.0" />
<PackageReference Include="VirtoCommerce.Platform.Data" Version="3.889.0" />
<PackageReference Include="VirtoCommerce.Platform.Hangfire" Version="3.889.0" />
<PackageReference Include="VirtoCommerce.StoreModule.Core" Version="3.818.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.DynamicAssociationsModule.Core\VirtoCommerce.DynamicAssociationsModule.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected override async Task HandleRequirementAsync(AuthorizationHandlerContext
{
var categories = await _categoryService.GetAsync(categoryIds, $"{CategoryResponseGroup.WithOutlines}");

if ((catalogId == null || allowedCatalogIds.Any(x => x.EqualsInvariant(catalogId))) && categories.All(x => IsCategoryLocatedInCatalogs(x, allowedCatalogIds)))
if ((catalogId == null || allowedCatalogIds.Any(x => x.EqualsIgnoreCase(catalogId))) && categories.All(x => IsCategoryLocatedInCatalogs(x, allowedCatalogIds)))
{
context.Succeed(requirement);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<SonarQubeTestProject>false</SonarQubeTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="VirtoCommerce.CatalogModule.Data" Version="3.822.0" />
<PackageReference Include="VirtoCommerce.Platform.Security" Version="3.853.0" />
<PackageReference Include="VirtoCommerce.CatalogModule.Data" Version="3.868.0-alpha.2357-vcst-3299" />
<PackageReference Include="VirtoCommerce.Platform.Security" Version="3.889.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.DynamicAssociationsModule.Data.MySql\VirtoCommerce.DynamicAssociationsModule.Data.MySql.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions src/VirtoCommerce.DynamicAssociationsModule.Web/module.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<version>3.807.0</version>
<version-tag />

<platformVersion>3.853.0</platformVersion>
<platformVersion>3.889.0</platformVersion>
<dependencies>
<dependency id="VirtoCommerce.Catalog" version="3.822.0" />
<dependency id="VirtoCommerce.Core" version="3.808.0" />
<dependency id="VirtoCommerce.Catalog" version="3.868.0" />
<dependency id="VirtoCommerce.Core" version="3.821.0" />
<dependency id="VirtoCommerce.Marketing" version="3.812.0" />
<dependency id="VirtoCommerce.Store" version="3.809.0" />
<dependency id="VirtoCommerce.Store" version="3.818.0" />
</dependencies>

<title>Dynamic Associations</title>
Expand All @@ -25,7 +25,7 @@
<projectUrl>https://github.com/VirtoCommerce/vc-module-dynamic-associations</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>First version.</releaseNotes>
<copyright>Copyright © 2011-2024 Virto Commerce. All rights reserved</copyright>
<copyright>Copyright © 2011-2025 Virto Commerce. All rights reserved</copyright>
<tags>dynamicAssociations</tags>
<assemblyFile>VirtoCommerce.DynamicAssociationsModule.Web.dll</assemblyFile>
<moduleType>VirtoCommerce.DynamicAssociationsModule.Web.Module, VirtoCommerce.DynamicAssociationsModule.Web</moduleType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using VirtoCommerce.CatalogModule.Core.Model;
using VirtoCommerce.CatalogModule.Core.Outlines;
using VirtoCommerce.CatalogModule.Core.Services;
using VirtoCommerce.CatalogModule.Data.Authorization;
using VirtoCommerce.CoreModule.Core.Outlines;
using VirtoCommerce.DynamicAssociationsModule.Core.Model;
using VirtoCommerce.DynamicAssociationsModule.Core.Model.Search;
using VirtoCommerce.DynamicAssociationsModule.Web.Authorization;
Expand Down Expand Up @@ -769,7 +769,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
}
else
{
var tryCreateInstance = typeof(AbstractTypeFactory<>).MakeGenericType(objectType).GetMethods().FirstOrDefault(x => x.Name.EqualsInvariant("TryCreateInstance") && x.GetParameters().Length == 0);
var tryCreateInstance = typeof(AbstractTypeFactory<>).MakeGenericType(objectType).GetMethods().FirstOrDefault(x => x.Name.EqualsIgnoreCase("TryCreateInstance") && x.GetParameters().Length == 0);
result = tryCreateInstance?.Invoke(null, null);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using VirtoCommerce.CatalogModule.Core.Model;
using VirtoCommerce.CoreModule.Core.Outlines;
using VirtoCommerce.CatalogModule.Core.Outlines;
using VirtoCommerce.DynamicAssociationsModule.Core.Model;
using Xunit;

Expand Down
Loading