Skip to content

Commit

Permalink
organize files, add BreadcrumbHelperTests
Browse files Browse the repository at this point in the history
  • Loading branch information
kentico-ericd committed Nov 17, 2023
1 parent 24be03f commit b33ffc5
Show file tree
Hide file tree
Showing 23 changed files with 2,876 additions and 53 deletions.
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
"editor.semanticHighlighting.enabled": true,
"editor.defaultFormatter": "ms-dotnettools.csharp"
},

"omnisharp.defaultLaunchSolution": "./XperienceCoreBreadcrumbs.sln",
"omnisharp.organizeImportsOnFormat": true,
"omnisharp.useEditorFormattingSettings": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableImportCompletion": true,
"omnisharp.useModernNet": true
"omnisharp.useModernNet": true,
"dotnet.defaultSolution": "./XperienceCoreBreadcrumbs.sln",
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
}
28 changes: 10 additions & 18 deletions XperienceCoreBreadcrumbs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32421.90
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DA5907AB-51CA-4F62-9704-62076FAE976E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6AAD1707-DDA9-4E63-AF71-0DFBFC2F816F}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
Expand All @@ -13,34 +11,28 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{89019A0F-B5BB-4AE6-A4C6-551269F5D487}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xperience.Core.Breadcrumbs.Tests", "tests\Xperience.Core.Breadcrumbs.Tests\Xperience.Core.Breadcrumbs.Tests.csproj", "{FC39051D-0F42-48CC-B648-20C5B324A41F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xperience.Core.Breadcrumbs", "src\Xperience.Core.Breadcrumbs.csproj", "{CDCA5A09-9F32-4483-9396-249605F3536E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xperience.Core.Breadcrumbs", "src\Xperience.Core.Breadcrumbs\Xperience.Core.Breadcrumbs.csproj", "{F48F46B0-25FA-4362-801E-82A176458CC6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xperience.Core.Breadcrumbs.Tests", "tests\Xperience.Core.Breadcrumbs.Tests.csproj", "{5FFAADC2-499D-4C97-962D-810B643732B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Release|Any CPU.Build.0 = Release|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Release|Any CPU.Build.0 = Release|Any CPU
{CDCA5A09-9F32-4483-9396-249605F3536E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDCA5A09-9F32-4483-9396-249605F3536E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDCA5A09-9F32-4483-9396-249605F3536E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDCA5A09-9F32-4483-9396-249605F3536E}.Release|Any CPU.Build.0 = Release|Any CPU
{5FFAADC2-499D-4C97-962D-810B643732B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FFAADC2-499D-4C97-962D-810B643732B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FFAADC2-499D-4C97-962D-810B643732B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FFAADC2-499D-4C97-962D-810B643732B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FC39051D-0F42-48CC-B648-20C5B324A41F} = {89019A0F-B5BB-4AE6-A4C6-551269F5D487}
{F48F46B0-25FA-4362-801E-82A176458CC6} = {DA5907AB-51CA-4F62-9704-62076FAE976E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F39B990D-E00C-4A3A-8354-F87303EA22C1}
EndGlobalSection
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<ItemGroup Label="StaticCodeAnalysis">
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.41.0.50478">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,11 @@ private IEnumerable<BreadcrumbItem> BuildHierarchyInternal(TreeNode current, Bre
var nodeLevel = current.NodeLevel - 1;
while (nodeLevel > 0)
{
var parent = pages.Where(p => p.NodeLevel == nodeLevel).FirstOrDefault();
var parent = pages.FirstOrDefault(p => p.NodeLevel == nodeLevel);
var type = DataClassInfoProvider.GetDataClassInfo(parent.ClassName);
if (type != null)
if (type != null && (type.ClassHasURL || (!type.ClassIsCoupledClass && props.ShowContainers)))
{
if (type.ClassHasURL ||
(!type.ClassIsCoupledClass && props.ShowContainers))
{
ret.Add(breadcrumbItemMapper.MapPage(parent));
}
ret.Add(breadcrumbItemMapper.MapPage(parent));
}
cacheDependencies.Add($"documentid|{current.DocumentID}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Xperience.Core.Breadcrumbs
/// <summary>
/// Default implementation of <see cref="IBreadcrumbItemMapper"/>.
/// </summary>
internal class DefaultBreadcrumbItemMapper : IBreadcrumbItemMapper
public class DefaultBreadcrumbItemMapper : IBreadcrumbItemMapper
{
private readonly IPageUrlRetriever pageUrlRetriever;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Xperience.Core.Breadcrumbs
/// <summary>
/// Default implementation of <see cref="IBreadcrumbsRenderer"/>.
/// </summary>
internal class DefaultBreadcrumbsRenderer : IBreadcrumbsRenderer
public class DefaultBreadcrumbsRenderer : IBreadcrumbsRenderer
{
public string RenderClosingTag()
{
Expand Down
File renamed without changes.
Loading

0 comments on commit b33ffc5

Please sign in to comment.