mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Standardizes boolean naming across the stack
This commit is contained in:
1 parent
6bd0cf6d42
commit
37dff6039d
78 files changed
+252
-252
No files matched your search
+1
-1
@@ -49,7 +49,7 @@ public class GetDirectoriesEndpoint : BaseEndpoint<GetDirectoriesRequest, IResul
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(GetDirectoriesRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
DirectoryDto[] response = await _apiHttpClient.GetAsync<DirectoryDto[]>($"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
DirectoryDto[] response = await _apiHttpClient.GetAsync<DirectoryDto[]>($"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess(response);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -24,11 +24,11 @@ public class GetDirectoriesEndpointSummary : Summary<GetDirectoriesEndpoint, Get
|
||||
Description = "Retrieves the directories of the file system path identified by the request.";
|
||||
|
||||
RequestParam(r => r.Path, "The file system path for which to get the directories. Required.");
|
||||
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
|
||||
RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
|
||||
|
||||
ExampleRequest = new GetDirectoriesRequest(
|
||||
Path: "/media/movies/",
|
||||
IncludeHiddenElements: true
|
||||
ShouldIncludeHiddenElements: true
|
||||
);
|
||||
|
||||
Response(200, "The directories of the file system path are returned.", example: new SuccessResponse<DirectoryDto[]>(true, default));
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class GetFilesEndpoint : BaseEndpoint<GetFilesRequest, IResult>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(GetFilesRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
FileDto[] response = await _apiHttpClient.GetAsync<FileDto[]>($"{ApiRoutes.Files.GET_FILES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
FileDto[] response = await _apiHttpClient.GetAsync<FileDto[]>($"{ApiRoutes.Files.GET_FILES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess(response);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -24,11 +24,11 @@ public class GetFilesEndpointSummary : Summary<GetFilesEndpoint, GetFilesRequest
|
||||
Description = "Retrieves the files of the file system path identified by the request.";
|
||||
|
||||
RequestParam(r => r.Path, "The file system path for which to get the files. Required.");
|
||||
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
|
||||
RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
|
||||
|
||||
ExampleRequest = new GetFilesRequest(
|
||||
Path: "/media/movies/",
|
||||
IncludeHiddenElements: true
|
||||
ShouldIncludeHiddenElements: true
|
||||
);
|
||||
|
||||
Response(200, "The files of the file system path are returned.", example: new SuccessResponse<FileDto[]>(true, default));
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class GetTreeFilesEndpoint : BaseEndpoint<GetTreeFilesRequest, IResult>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(GetTreeFilesRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
FileSystemTreeNodeDto[] response = await _apiHttpClient.GetAsync<FileSystemTreeNodeDto[]>($"{ApiRoutes.Files.GET_TREE_FILES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
FileSystemTreeNodeDto[] response = await _apiHttpClient.GetAsync<FileSystemTreeNodeDto[]>($"{ApiRoutes.Files.GET_TREE_FILES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess(response);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -24,11 +24,11 @@ public class GetTreeFilesEndpointSummary : Summary<GetTreeFilesEndpoint, GetTree
|
||||
Description = "Retrieves the file system tree of the file system path identified by the request.";
|
||||
|
||||
RequestParam(r => r.Path, "The file system path for which to get the tree files. Required.");
|
||||
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
|
||||
RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden file system elements or not. Optional.");
|
||||
|
||||
ExampleRequest = new GetTreeFilesRequest(
|
||||
Path: "/media/movies/",
|
||||
IncludeHiddenElements: true
|
||||
ShouldIncludeHiddenElements: true
|
||||
);
|
||||
|
||||
Response(200, "The file system tree of the file system path is returned.", example: new SuccessResponse<FileSystemTreeNodeDto[]>(true, default));
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class CheckPathExistsEndpoint : BaseEndpoint<CheckPathExistsRequest, IRes
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task<IResult> ExecuteAsync(CheckPathExistsRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
PathExistsDto response = await _apiHttpClient.GetAsync<PathExistsDto>($"{ApiRoutes.Path.CHECK_PATH_EXISTS}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
PathExistsDto response = await _apiHttpClient.GetAsync<PathExistsDto>($"{ApiRoutes.Path.CHECK_PATH_EXISTS}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false);
|
||||
return JsonSuccess(new { exists = response.Exists });
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -22,11 +22,11 @@ public class CheckPathExistsEndpointSummary : Summary<CheckPathExistsEndpoint, C
|
||||
Description = "Checks whether the file system path identified by the request exists.";
|
||||
|
||||
RequestParam(r => r.Path, "The file system path to check the existence of. Required.");
|
||||
RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden elements in the search results, or not. Optional.");
|
||||
RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden elements in the search results, or not. Optional.");
|
||||
|
||||
ExampleRequest = new CheckPathExistsRequest(
|
||||
Path: "/media/movies/",
|
||||
IncludeHiddenElements: true
|
||||
ShouldIncludeHiddenElements: true
|
||||
);
|
||||
|
||||
Response(200, "Whether the file system path exists is returned.", example: new { success = true, data = new { exists = true } });
|
||||
|
||||
@@ -49,7 +49,7 @@ public sealed class ThemeTemplateEngine
|
||||
ThemeSectionNodeDto? scriptsSection = null;
|
||||
foreach (ThemeTemplateNodeDto node in parseResult.Value)
|
||||
{
|
||||
if (node is ThemeSectionNodeDto { Inverted: false } section
|
||||
if (node is ThemeSectionNodeDto { IsInverted: false } section
|
||||
&& scriptsSection is null
|
||||
&& string.Equals(section.Expression, "scripts", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -146,7 +146,7 @@ public sealed class ThemeTemplateEngine
|
||||
if (childrenResult.IsFailure)
|
||||
return childrenResult.Errors;
|
||||
|
||||
nodes.Add(new ThemeSectionNodeDto(expression, Inverted: tag[0] == '^', Children: childrenResult.Value));
|
||||
nodes.Add(new ThemeSectionNodeDto(expression, IsInverted: tag[0] == '^', Children: childrenResult.Value));
|
||||
break;
|
||||
}
|
||||
case '/':
|
||||
@@ -247,16 +247,16 @@ public sealed class ThemeTemplateEngine
|
||||
private static Result<Success> RenderSection(ThemeSectionNodeDto section, ThemeRenderScopeDto scope, StringBuilder output)
|
||||
{
|
||||
object? value = Resolve(section.Expression, scope);
|
||||
bool truthy = IsTruthy(value);
|
||||
if (section.Inverted)
|
||||
bool isTruthy = IsTruthy(value);
|
||||
if (section.IsInverted)
|
||||
{
|
||||
if (!truthy)
|
||||
if (!isTruthy)
|
||||
return RenderNodes(section.Children, scope, output);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
if (!truthy)
|
||||
if (!isTruthy)
|
||||
return Result.Success;
|
||||
|
||||
if (value is bool)
|
||||
@@ -425,7 +425,7 @@ public sealed class ThemeTemplateEngine
|
||||
return value switch
|
||||
{
|
||||
null => string.Empty,
|
||||
bool boolean => boolean ? "true" : "false",
|
||||
bool isBoolean => isBoolean ? "true" : "false",
|
||||
DateTime dateTime => dateTime.ToString("O", CultureInfo.InvariantCulture),
|
||||
DateTimeOffset dateTimeOffset => dateTimeOffset.ToString("O", CultureInfo.InvariantCulture),
|
||||
IFormattable formattable => formattable.ToString(null, CultureInfo.InvariantCulture) ?? string.Empty,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
@if (Model.ShouldShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
|
||||
Reference in new issue
Block a user