Skip to content

Commit f152e05

Browse files
authored
Merge pull request #54 from Mythetech/regex-tester
feat: add regex tester tool
2 parents ed2d491 + da6f2db commit f152e05

File tree

7 files changed

+584
-2
lines changed

7 files changed

+584
-2
lines changed

Apollo.Components/Editor/ToolsMenu.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<MudMenuItem Icon="@ApolloIcons.NuGet" OnClick="@(async () => await Bus.PublishAsync(new OpenNuGetDialog()))">
99
NuGet Packages
1010
</MudMenuItem>
11+
<MudMenuItem Icon="@ApolloIcons.Search" OnClick="@(async () => await Bus.PublishAsync(new OpenRegexTesterDialog()))">
12+
Regex Tester
13+
</MudMenuItem>
1114
<MudMenu StartIcon="@ApolloIcons.Guid" Label="Generate GUID">
1215
<MudMenuItem Icon="@ApolloIcons.Guid" OnClick="@(async () => await Bus.PublishAsync(new GenerateGuid()))">
1316
GUID

Apollo.Components/NuGet/PackageCard.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
<MudSelect T="string"
2525
@bind-Value="_selectedVersion"
2626
Dense
27-
Variant="Variant.Outlined"
27+
Variant="Variant.Text"
2828
Style="min-width: 120px;"
2929
AnchorOrigin="Origin.BottomCenter">
3030
@foreach (var version in Package.Versions.Take(10))
3131
{
3232
<MudSelectItem Value="@version">@version</MudSelectItem>
3333
}
3434
</MudSelect>
35+
36+
<MudDivider Vertical="true" />
3537

3638
@if (IsInstalling)
3739
{
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace Apollo.Components.Tools.Commands;
2+
3+
public record OpenRegexTesterDialog();
4+
5+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Apollo.Components.Infrastructure.MessageBus;
2+
using Apollo.Components.Tools.Commands;
3+
using MudBlazor;
4+
5+
namespace Apollo.Components.Tools.Consumers;
6+
7+
public sealed class RegexTesterDialogOpener : IConsumer<OpenRegexTesterDialog>
8+
{
9+
private readonly IDialogService _dialogService;
10+
11+
public RegexTesterDialogOpener(IDialogService dialogService)
12+
{
13+
_dialogService = dialogService;
14+
}
15+
16+
public async Task Consume(OpenRegexTesterDialog message)
17+
{
18+
var options = new DialogOptions
19+
{
20+
CloseOnEscapeKey = true,
21+
NoHeader = true,
22+
MaxWidth = MaxWidth.ExtraLarge,
23+
FullWidth = true,
24+
25+
};
26+
27+
await _dialogService.ShowAsync<RegexTesterDialog>("Regex Tester", options);
28+
}
29+
}
30+
31+

0 commit comments

Comments
 (0)