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
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// // Licensed under the MIT License.

using Bunit;
using EventLogExpert.Components.Database;
using EventLogExpert.UI;
using EventLogExpert.UI.Models;

namespace EventLogExpert.Components.Tests;
namespace EventLogExpert.Components.Tests.Database;

public sealed class DatabaseEntryRowTests : BunitContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// // Licensed under the MIT License.

using Bunit;
using EventLogExpert.Components.Database;
using EventLogExpert.Eventing.Helpers;
using EventLogExpert.UI;
using EventLogExpert.UI.Interfaces;
using EventLogExpert.UI.Models;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;

namespace EventLogExpert.Components.Tests;
namespace EventLogExpert.Components.Tests.Database;

public sealed class DatabaseRecoveryDialogTests : BunitContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// // Licensed under the MIT License.

using Bunit;
using EventLogExpert.Components.Database;
using EventLogExpert.Eventing.Helpers;
using EventLogExpert.UI;
using EventLogExpert.UI.Interfaces;
using EventLogExpert.UI.Models;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;

namespace EventLogExpert.Components.Tests;
namespace EventLogExpert.Components.Tests.Database;

public sealed class DatabaseRecoveryHostTests : BunitContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
// // Licensed under the MIT License.

using Bunit;
using EventLogExpert.Components.Database;
using EventLogExpert.Eventing.Helpers;
using EventLogExpert.UI.Interfaces;
using EventLogExpert.UI.Models;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;

namespace EventLogExpert.Components.Tests;
namespace EventLogExpert.Components.Tests.Database;

public sealed class SettingsUpgradeProgressBannerTests : BunitContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Components.Base;
using EventLogExpert.UI.Interfaces;
using Fluxor.Blazor.Web.Components;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Base;
namespace EventLogExpert.Components.Base;

/// <summary>
/// Base for modals shown via <see cref="IModalService" />. Owns the per-show id handshake with the service and
Expand Down Expand Up @@ -68,9 +67,11 @@ public Task<InlineAlertResult> ShowInlineAlertAsync(InlineAlertRequest request,
}

// Route Esc/native-close through OnCancelAsync so all close paths share the same pipeline.
internal Task HandleDialogClosedByUserAsync() => OnCancelAsync();
// Protected so derived modals' .razor markup can wire OnDialogClosedByUser="HandleDialogClosedByUserAsync"
// even when the derived class lives in a different assembly than ModalBase.
protected Task HandleDialogClosedByUserAsync() => OnCancelAsync();

internal Task HandleInlineAlertResolvedAsync(InlineAlertResult result)
protected Task HandleInlineAlertResolvedAsync(InlineAlertResult result)
{
TryClearInlineAlert(null, result, false);
return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Components;
namespace EventLogExpert.Components.Database;

public sealed partial class DatabaseEntryRow : ComponentBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Components;
namespace EventLogExpert.Components.Database;

public sealed partial class DatabaseRecoveryDialog : ComponentBase, IAsyncDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Components;
namespace EventLogExpert.Components.Database;

public sealed partial class DatabaseRecoveryHost : ComponentBase, IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@namespace EventLogExpert.Components

@if (BannerService.SettingsProgress is { } progress)
{
<aside class="settings-upgrade-banner" role="status">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Components;
namespace EventLogExpert.Components.Database;

public sealed partial class SettingsUpgradeProgressBanner : ComponentBase, IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@inherits EditableFilterRowBase

<FilterRowChrome ErrorMessage="@ErrorMessage"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Shared.Base;
using EventLogExpert.Components.Filters.Base;
using EventLogExpert.UI.Models;
using EventLogExpert.UI.Store.FilterPane;

namespace EventLogExpert.Shared.Components.Filters;
namespace EventLogExpert.Components.Filters;

public sealed partial class AdvancedFilterRow : EditableFilterRowBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.AspNetCore.Components;
using IDispatcher = Fluxor.IDispatcher;

namespace EventLogExpert.Shared.Base;
namespace EventLogExpert.Components.Filters.Base;

/// <summary>
/// Base for filter rows that bind either to a saved <see cref="FilterModel" /> (via
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Base;
namespace EventLogExpert.Components.Filters.Base;

/// <summary>Generic base for filter rows: stable DOM <see cref="Id" /> and a typed <see cref="Value" />.</summary>
public abstract class FilterRowBase<TValue> : ComponentBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@using EventLogExpert.UI
@inherits EditableFilterRowBase

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Shared.Base;
using EventLogExpert.Components.Filters.Base;
using EventLogExpert.UI;
using EventLogExpert.UI.Models;
using EventLogExpert.UI.Store.FilterCache;
using EventLogExpert.UI.Store.FilterPane;
using Fluxor;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components.Filters;
namespace EventLogExpert.Components.Filters;

public sealed partial class FilterCacheRow : EditableFilterRowBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Microsoft.AspNetCore.Components;
using System.Collections.Immutable;

namespace EventLogExpert.Shared.Components.Filters;
namespace EventLogExpert.Components.Filters;

public sealed partial class FilterCategoryEditor : ComponentBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@inherits EditableFilterRowBase

<FilterRowChrome ErrorMessage="@ErrorMessage"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Shared.Base;
using EventLogExpert.Components.Filters.Base;
using EventLogExpert.UI;
using EventLogExpert.UI.Models;
using EventLogExpert.UI.Store.FilterGroup;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components.Filters;
namespace EventLogExpert.Components.Filters;

public sealed partial class FilterGroupRow : EditableFilterRowBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@inherits EditableFilterRowBase

<FilterRowChrome ErrorMessage="@ErrorMessage"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Shared.Base;
using EventLogExpert.Components.Filters.Base;
using EventLogExpert.UI;
using EventLogExpert.UI.Interfaces;
using EventLogExpert.UI.Models;
using EventLogExpert.UI.Store.FilterPane;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components.Filters;
namespace EventLogExpert.Components.Filters;

public sealed partial class FilterRow : EditableFilterRowBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components.Filters;
namespace EventLogExpert.Components.Filters;

/// <summary>
/// Reusable chrome for filter rows: handles the color picker, saved-state value display, action buttons, and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@inherits FilterRowBase<SubFilterDraft>

<div class="flex-center-aligned-row px-4">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Shared.Base;
using EventLogExpert.Components.Filters.Base;
using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components.Filters;
namespace EventLogExpert.Components.Filters;

public sealed partial class SubFilterRow : FilterRowBase<SubFilterDraft>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using EventLogExpert.Components.Base;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Components;
namespace EventLogExpert.Components.Inputs;

public sealed partial class BooleanSelect : InputComponent<bool>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using EventLogExpert.Components.Base;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components;
namespace EventLogExpert.Components.Inputs;

public partial class TextInput : InputComponent<string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;

namespace EventLogExpert.Shared.Components;
namespace EventLogExpert.Components.Inputs;

public sealed partial class ValueSelect<T> : InputComponent<T>, IAsyncDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components;
namespace EventLogExpert.Components.Inputs;

public sealed partial class ValueSelectItem<T> : IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using EventLogExpert.Eventing.Helpers;
using EventLogExpert.UI;
using EventLogExpert.UI.Interfaces;
using EventLogExpert.UI.Models;
using EventLogExpert.UI.Services;
using EventLogExpert.UI.Store.EventLog;
using EventLogExpert.UI.Store.FilterPane;
Expand All @@ -13,7 +14,7 @@
using Microsoft.JSInterop;
using System.Text;

namespace EventLogExpert.Shared.Components.Menu;
namespace EventLogExpert.Components.Menu;

public sealed partial class MenuBar : IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.JSInterop;
using System.Globalization;

namespace EventLogExpert.Shared.Components.Menu;
namespace EventLogExpert.Components.Menu;

public sealed partial class MenuHost : IAsyncDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.UI.Models;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;

namespace EventLogExpert.Shared.Components.Menu;
namespace EventLogExpert.Components.Menu;

public sealed partial class MenuRenderer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@inherits ModalBase<bool>

<ModalChrome AriaLabel="@AriaLabelText"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Shared.Base;
using EventLogExpert.Components.Base;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components.Alerts;
namespace EventLogExpert.Components.Modals.Alerts;

/// <summary>
/// Standalone alert modal used by <c>ModalAlertDialogService</c> when no host modal is active. Dismiss-only when
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@inherits ModalBase<string>

<ModalChrome AriaLabel="@AriaLabelText"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// // Copyright (c) Microsoft Corporation.
// // Licensed under the MIT License.

using EventLogExpert.Shared.Base;
using EventLogExpert.Components.Base;
using Microsoft.AspNetCore.Components;

namespace EventLogExpert.Shared.Components.Alerts;
namespace EventLogExpert.Components.Modals.Alerts;

/// <summary>
/// Standalone prompt modal used by <c>ModalAlertDialogService</c> when no host modal is active. Returns the input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using EventLogExpert.Shared.Base
@inherits ModalBase<bool>

<ModalChrome AriaLabel="Debug Log"
Expand Down
Loading
Loading