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 @@ -16,6 +16,9 @@ public partial class NotificationEntryComponent : ComponentBase
[Parameter]
public EventCallback OnDismiss { get; set; }

[CascadingParameter]
public FluentDialog Dialog { get; set; } = default!;

private string IntentClass => Entry.Intent switch
{
MessageIntent.Success => "intent-success",
Expand Down Expand Up @@ -49,7 +52,15 @@ private async Task HandlePrimaryAction()
{
if (Entry.PrimaryAction is { } primaryAction)
{
await primaryAction.OnClick();
try
{
Dialog.Hide();
await primaryAction.OnClick();
}
finally
{
Dialog.Show();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ internal MarkdownProcessor GetMarkdownProcessor()
return _markdownProcessor ??= new MarkdownProcessor(ControlsStringsLoc, safeUrlSchemes: MarkdownHelpers.SafeUrlSchemes, extensions: []);
}

public static async Task OpenDialogAsync(OpenTextVisualizerDialogOptions options)
public static async Task<IDialogReference> OpenDialogAsync(OpenTextVisualizerDialogOptions options)
{
var width = options.DialogService.IsDesktop ? "75vw" : "100vw";
var parameters = new DialogParameters
Expand All @@ -126,7 +126,7 @@ public static async Task OpenDialogAsync(OpenTextVisualizerDialogOptions options
PreventScroll = true,
};

await options.DialogService.ShowDialogAsync<TextVisualizerDialog>(
return await options.DialogService.ShowDialogAsync<TextVisualizerDialog>(
new TextVisualizerDialogViewModel(options.Value, options.ValueDescription, options.ContainsSecret, options.DownloadFileName, options.FixedFormat), parameters);
}

Expand Down
7 changes: 5 additions & 2 deletions src/Aspire.Dashboard/Model/DashboardCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,15 @@ private async Task OpenViewResponseDialogAsync(CommandViewModel command, Resourc
_ => null
};

await TextVisualizerDialog.OpenDialogAsync(new OpenTextVisualizerDialogOptions
var reference = await TextVisualizerDialog.OpenDialogAsync(new OpenTextVisualizerDialogOptions
{
DialogService = dialogService,
ValueDescription = command.GetDisplayName(),
Value = response.Result.Value,
FixedFormat = fixedFormat
}).ConfigureAwait(false);
}).ConfigureAwait(true);

// Await the result to wait here until the dialog is closed.
await reference.Result.ConfigureAwait(true);
}
}
Loading