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
1 change: 1 addition & 0 deletions src/NavigationDemo.Web/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://nexus2.esdm.co.uk/repository/ESDM-npm-proxy-cloudscribe/
4 changes: 2 additions & 2 deletions src/NavigationDemo.Web/NavigationDemo.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="cloudscribe.Web.Localization" Version="8.7.0" />
<PackageReference Include="cloudscribe.Web.Localization" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 1 addition & 5 deletions src/NavigationDemo.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddMvc()
.AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix)
.AddDataAnnotationsLocalization()
.AddRazorOptions(options =>
{

})
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddRazorOptions(options => {})
;

services.AddControllersWithViews();
Expand Down
2 changes: 1 addition & 1 deletion src/RazorPages.WebApp/RazorPages.WebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<UserSecretsId>aspnet-RazorPages.WebApp-0BEB55BD-36A5-4CAC-A1C9-81104294AB20</UserSecretsId>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<IsPackable>false</IsPackable>
Expand Down
7 changes: 1 addition & 6 deletions src/RazorPages.WebApp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddMvc()
.AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix)
.AddDataAnnotationsLocalization()
.AddRazorOptions(options =>
{

})
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
;
.AddRazorOptions(options => {});


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
IEnumerable<INavigationNodePermissionResolver> permissionResolvers,
IEnumerable<IFindCurrentNode> nodeFinders,
IUrlHelperFactory urlHelperFactory,
IActionContextAccessor actionContextAccesor,
INodeUrlPrefixProvider prefixProvider,
ILogger<NavigationViewComponent> logger,
IDOMTreeCache DomCache,
Expand All @@ -34,7 +33,6 @@
_permissionResolvers = permissionResolvers;
_nodeFinders = nodeFinders;
_urlHelperFactory = urlHelperFactory;
_actionContextAccesor = actionContextAccesor;
_prefixProvider = prefixProvider;
_log = logger;
_domCache = DomCache;
Expand All @@ -52,7 +50,6 @@
private IEnumerable<INavigationNodePermissionResolver> _permissionResolvers;
private IEnumerable<IFindCurrentNode> _nodeFinders;
private IUrlHelperFactory _urlHelperFactory;
private IActionContextAccessor _actionContextAccesor;
private INodeUrlPrefixProvider _prefixProvider;


Expand Down Expand Up @@ -101,7 +98,7 @@
model = await CreateNavigationTree(filterName, startingNodeKey);

ViewEngineResult viewResult = null;
var actionContext = _actionContextAccesor.ActionContext;
var actionContext = ViewContext;
var tempData = new TempDataDictionary(actionContext.HttpContext, _tempDataProvider);

string fullViewName = $"Components/CachingNavigation/{viewName}";
Expand Down Expand Up @@ -147,7 +144,7 @@
catch (Exception ex)
{
_log.LogError(ex, $"CachingNavigationViewComponent: Failed to render view for {fullViewName}");
throw (ex);

Check warning on line 147 in src/cloudscribe.Web.Navigation/CachingNavigationViewComponent.cs

View workflow job for this annotation

GitHub Actions / build

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)

Check warning on line 147 in src/cloudscribe.Web.Navigation/CachingNavigationViewComponent.cs

View workflow job for this annotation

GitHub Actions / build

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)
}
}
}
Expand All @@ -161,7 +158,7 @@
private async Task<NavigationViewModel> CreateNavigationTree(string filterName, string startingNodeKey)
{
var rootNode = await _builder.GetTree();
var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccesor.ActionContext);
var urlHelper = _urlHelperFactory.GetUrlHelper(ViewContext);
NavigationViewModel model = new NavigationViewModel(
startingNodeKey,
filterName,
Expand Down
5 changes: 1 addition & 4 deletions src/cloudscribe.Web.Navigation/NavigationViewComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ public NavigationViewComponent(
IEnumerable<INavigationNodePermissionResolver> permissionResolvers,
IEnumerable<IFindCurrentNode> nodeFinders,
IUrlHelperFactory urlHelperFactory,
IActionContextAccessor actionContextAccesor,
INodeUrlPrefixProvider prefixProvider,
ILogger<NavigationViewComponent> logger)
{
_builder = siteMapTreeBuilder;
_permissionResolvers = permissionResolvers;
_nodeFinders = nodeFinders;
_urlHelperFactory = urlHelperFactory;
_actionContextAccesor = actionContextAccesor;
_prefixProvider = prefixProvider;

_log = logger;
Expand All @@ -40,7 +38,6 @@ public NavigationViewComponent(
private IEnumerable<INavigationNodePermissionResolver> _permissionResolvers;
private IEnumerable<IFindCurrentNode> _nodeFinders;
private IUrlHelperFactory _urlHelperFactory;
private IActionContextAccessor _actionContextAccesor;
private INodeUrlPrefixProvider _prefixProvider;


Expand All @@ -53,7 +50,7 @@ public async Task<IViewComponentResult> InvokeAsync(string viewName, string filt
}

var rootNode = await _builder.GetTree();
var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccesor.ActionContext);
var urlHelper = _urlHelperFactory.GetUrlHelper(ViewContext);
NavigationViewModel model = new NavigationViewModel(
startingNodeKey,
filterName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public static IServiceCollection AddCloudscribeNavigation(
services.TryAddSingleton<NavigationOptions, NavigationOptions>();
}

services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>();
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.TryAddScoped<ITreeCacheKeyResolver, DefaultCacheKeyResolver>();

Expand Down
14 changes: 7 additions & 7 deletions src/cloudscribe.Web.Navigation/cloudscribe.Web.Navigation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<Description>an ASP.NET Core viewcomponent for menus and breadcrumbs</Description>
<Version>8.7.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Version>10.0.0</Version>
<TargetFramework>net10.0</TargetFramework>
<Authors>Joe Audette</Authors>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<PackageTags>cloudscribe;asp.net core;mvcsitemapprovider;navigation;menus;breadcrumbs;bootstrap</PackageTags>
Expand All @@ -29,11 +29,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.0" />

<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading;
Expand All @@ -32,21 +33,18 @@ public NavigationTreeSiteMapNodeService(
NavigationTreeBuilderService siteMapTreeBuilder,
IEnumerable<INavigationNodePermissionResolver> permissionResolvers,
IUrlHelperFactory urlHelperFactory,
IActionContextAccessor actionContextAccesor,
IHttpContextAccessor contextAccessor,
ILogger<NavigationTreeSiteMapNodeService> logger)
{
this.siteMapTreeBuilder = siteMapTreeBuilder;
this.urlHelperFactory = urlHelperFactory;
this.actionContextAccesor = actionContextAccesor;
this.contextAccessor = contextAccessor;
this.permissionResolvers = permissionResolvers;
log = logger;
}

private NavigationTreeBuilderService siteMapTreeBuilder;
private IUrlHelperFactory urlHelperFactory;
private IActionContextAccessor actionContextAccesor;
private ILogger log;
private IHttpContextAccessor contextAccessor;
private string baseUrl = string.Empty;
Expand Down Expand Up @@ -86,7 +84,8 @@ public async Task<IEnumerable<ISiteMapNode>> GetSiteMapNodes(
{
var rootNode = await siteMapTreeBuilder.GetTree();
var mapNodes = new List<SiteMapNode>();
var urlHelper = urlHelperFactory.GetUrlHelper(actionContextAccesor.ActionContext);
var actionContext = new ActionContext(contextAccessor.HttpContext, contextAccessor.HttpContext.GetRouteData(), new Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor());
var urlHelper = urlHelperFactory.GetUrlHelper(actionContext);
foreach (var navNode in rootNode.Flatten())
{
if (navNode.ExcludeFromSearchSiteMap) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<Description>cloudscribe.Web.SiteMap.FromNavigation a library that implements ISiteMapNodeService using existing tree of nodes from cloudscribe.Web.Navigation.NavigationTreeBuilderService</Description>
<Version>8.7.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Version>10.0.0</Version>
<TargetFramework>net10.0</TargetFramework>
<Authors>Joe Audette</Authors>
<PackageTags>cloudscribe;mvc;sitemap</PackageTags>
<PackageIcon>icon.png</PackageIcon>
Expand Down
8 changes: 4 additions & 4 deletions src/cloudscribe.Web.SiteMap/cloudscribe.Web.SiteMap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<Description>ASP.NET Core controller and models for generating an xml sitemap for search indexes http://www.sitemaps.org</Description>
<Version>8.7.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Version>10.0.0</Version>
<TargetFramework>net10.0</TargetFramework>

<Authors>Joe Audette</Authors>
<AssemblyName>cloudscribe.Web.SiteMap</AssemblyName>
Expand Down Expand Up @@ -31,8 +31,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>

</PropertyGroup>
Expand All @@ -11,10 +11,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="coverlet.collector" Version="1.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions update_version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
$directory = "src"

# Define the old & new versions
$oldVersion = '8\.6' # slash needed !
$newVersion = "8.7.0"
$newWildcardVersion = "8.7.*"
$oldVersion = '8\.7' # slash needed !
$newVersion = "8.8.0"
$newWildcardVersion = "8.8.*"


# Get all .csproj files in the directory and subdirectories
Expand Down
Loading