Skip to content

Commit c1b7f55

Browse files
committed
Address code problems flagged by rider, mostly due to improved non nullabilty of navigation items
1 parent fdd41a5 commit c1b7f55

File tree

77 files changed

+21
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+21
-121
lines changed

src/Elastic.Documentation.Configuration/Assembler/AssemblyConfiguration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See the LICENSE file in the project root for more information
44

55
using System.Text.RegularExpressions;
6-
using Elastic.Documentation.Serialization;
76
using YamlDotNet.Serialization;
87
using YamlStaticContext = Elastic.Documentation.Configuration.Serialization.YamlStaticContext;
98

src/Elastic.Documentation.LinkIndex/LinkIndexReader.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Net;
65
using Amazon.Runtime;
76
using Amazon.S3;
87
using Amazon.S3.Model;

src/Elastic.Documentation.LinkIndex/LinkIndexReaderWriter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See the LICENSE file in the project root for more information
44

55
using System.Net;
6-
using Amazon.Runtime;
76
using Amazon.S3;
87
using Amazon.S3.Model;
98
using Elastic.Documentation.Links;

src/Elastic.Documentation.Site/FileProviders/Preloader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Reflection;
66
using System.Text.RegularExpressions;
77

8-
namespace Elastic.Markdown.Helpers;
8+
namespace Elastic.Documentation.Site.FileProviders;
99

1010
public static partial class FontPreloader
1111
{

src/Elastic.Documentation.Site/Layout/_Head.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@inherits RazorSlice<Elastic.Documentation.Site.GlobalLayoutViewModel>
2-
@using Elastic.Markdown.Helpers
2+
@using FontPreloader = Elastic.Documentation.Site.FileProviders.FontPreloader
33
<head hx-head="merge">
44
<meta charset="utf-8">
55
<title>@Model.Title</title>

src/Elastic.Documentation.Site/Navigation/IsolatedBuildNavigationHtmlWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public async Task<string> RenderNavigation(INodeNavigationItem<INavigationModel,
3030
private NavigationViewModel CreateNavigationModel(INodeNavigationItem<INavigationModel, INavigationItem> navigation) =>
3131
new()
3232
{
33-
Title = navigation.NavigationTitle ?? "Docs",
34-
TitleUrl = navigation.Url ?? context.UrlPathPrefix ?? "/",
33+
Title = navigation.NavigationTitle,
34+
TitleUrl = navigation.Url,
3535
Tree = navigation,
3636
IsPrimaryNavEnabled = context.Configuration.Features.IsPrimaryNavEnabled,
3737
IsGlobalAssemblyBuild = false,

src/Elastic.Documentation.Site/Navigation/_TocTreeNav.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
<li class="flex flex-wrap group-navigation @(isTopLevel ? "mt-6" : "mt-4")">
2424
<div class="peer grid grid-cols-[1fr_auto] w-full">
2525
<a
26-
href="@(g.Url ?? "")"
26+
href="@(g.Url)"
2727
@Htmx.GetNavHxAttributes(Model.IsPrimaryNavEnabled && g.NavigationRoot.Id == Model.RootNavigationId || true)
2828
class="sidebar-link pr-2 content-center @(isTopLevel ? "font-semibold" : "")">
29-
@(g.NavigationTitle ?? "Untitled")
29+
@(g.NavigationTitle)
3030
</a>
3131
<label for="@folder.Id" class="group/label flex mr-2 items-start">
3232
<div class="hover:bg-grey-20 rounded-sm p-1 cursor-pointer">

src/Elastic.Documentation/Links/LinkRegistry.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Diagnostics.CodeAnalysis;
65
using System.Text.Json;
76
using System.Text.Json.Serialization;
87
using Elastic.Documentation.Serialization;
@@ -34,9 +33,7 @@ public LinkRegistry WithLinkRegistryEntry(LinkRegistryEntry entry)
3433
}
3534
// branch does not exist in the repository entry
3635
else
37-
{
3836
existingRepositoryEntry[branch] = entry;
39-
}
4037
}
4138
// onboarding new repository
4239
else

src/Elastic.Markdown/Diagnostics/ProcessorDiagnosticExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.IO.Abstractions;
6-
using Elastic.Documentation;
75
using Elastic.Documentation.Diagnostics;
86
using Elastic.Markdown.Myst;
97
using Elastic.Markdown.Myst.Directives;

src/Elastic.Markdown/DocumentationGenerator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See the LICENSE file in the project root for more information
44

55
using System.IO.Abstractions;
6-
using System.Reflection;
76
using System.Text.Json;
87
using Elastic.Documentation.Configuration;
98
using Elastic.Documentation.Legacy;

0 commit comments

Comments
 (0)