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
32 changes: 16 additions & 16 deletions src/Aspire.Hosting/Dashboard/DashboardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using static Aspire.Hosting.ApplicationModel.Interaction;
using static Aspire.Hosting.Interaction;

namespace Aspire.Hosting.Dashboard;

Expand Down Expand Up @@ -117,7 +117,7 @@ async Task WatchInteractionsInternal(CancellationToken cancellationToken)

var inputInstances = inputs.Inputs.Select(input =>
{
var dto = new InteractionInput
var dto = new Aspire.DashboardService.Proto.V1.InteractionInput
{
InputType = MapInputType(input.InputType),
Required = input.Required
Expand Down Expand Up @@ -174,33 +174,33 @@ async Task WatchInteractionsInternal(CancellationToken cancellationToken)
}

#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
private static MessageIntent MapMessageIntent(ApplicationModel.MessageIntent? intent)
private static Aspire.DashboardService.Proto.V1.MessageIntent MapMessageIntent(Aspire.Hosting.MessageIntent? intent)
{
if (intent is null)
{
return MessageIntent.None;
return Aspire.DashboardService.Proto.V1.MessageIntent.None;
}

return intent.Value switch
{
ApplicationModel.MessageIntent.Success => MessageIntent.Success,
ApplicationModel.MessageIntent.Warning => MessageIntent.Warning,
ApplicationModel.MessageIntent.Error => MessageIntent.Error,
ApplicationModel.MessageIntent.Information => MessageIntent.Information,
ApplicationModel.MessageIntent.Confirmation => MessageIntent.Confirmation,
_ => MessageIntent.None,
Aspire.Hosting.MessageIntent.Success => Aspire.DashboardService.Proto.V1.MessageIntent.Success,
Aspire.Hosting.MessageIntent.Warning => Aspire.DashboardService.Proto.V1.MessageIntent.Warning,
Aspire.Hosting.MessageIntent.Error => Aspire.DashboardService.Proto.V1.MessageIntent.Error,
Aspire.Hosting.MessageIntent.Information => Aspire.DashboardService.Proto.V1.MessageIntent.Information,
Aspire.Hosting.MessageIntent.Confirmation => Aspire.DashboardService.Proto.V1.MessageIntent.Confirmation,
_ => Aspire.DashboardService.Proto.V1.MessageIntent.None,
};
}

private static InputType MapInputType(ApplicationModel.InputType inputType)
private static Aspire.DashboardService.Proto.V1.InputType MapInputType(Aspire.Hosting.InputType inputType)
{
return inputType switch
{
ApplicationModel.InputType.Text => InputType.Text,
ApplicationModel.InputType.SecretText => InputType.SecretText,
ApplicationModel.InputType.Choice => InputType.Choice,
ApplicationModel.InputType.Boolean => InputType.Boolean,
ApplicationModel.InputType.Number => InputType.Number,
Aspire.Hosting.InputType.Text => Aspire.DashboardService.Proto.V1.InputType.Text,
Aspire.Hosting.InputType.SecretText => Aspire.DashboardService.Proto.V1.InputType.SecretText,
Aspire.Hosting.InputType.Choice => Aspire.DashboardService.Proto.V1.InputType.Choice,
Aspire.Hosting.InputType.Boolean => Aspire.DashboardService.Proto.V1.InputType.Boolean,
Aspire.Hosting.InputType.Number => Aspire.DashboardService.Proto.V1.InputType.Number,
_ => throw new InvalidOperationException($"Unexpected input type: {inputType}"),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Diagnostics.CodeAnalysis;

namespace Aspire.Hosting.ApplicationModel;
namespace Aspire.Hosting;

#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Channels;
using Microsoft.Extensions.Logging;

namespace Aspire.Hosting.ApplicationModel;
namespace Aspire.Hosting;

#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Globalization;
using System.Threading.Channels;
using Aspire.Hosting.Backchannel;
using Aspire.Hosting.ApplicationModel;

namespace Aspire.Hosting.Publishing;

Expand Down
1 change: 0 additions & 1 deletion src/Aspire.Hosting/VersionChecking/VersionCheckService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Aspire.Hosting.ApplicationModel;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public async Task WatchInteractions_PromptInputAsync_CompleteOnCancelResponse()
var resultTask = interactionService.PromptInputAsync(
title: "Title!",
message: "Message!",
new ApplicationModel.InteractionInput { InputType = ApplicationModel.InputType.Text, Label = "Input" });
new Aspire.Hosting.InteractionInput { InputType = Aspire.Hosting.InputType.Text, Label = "Input" });

// Assert
logger.LogInformation("Reading result from writer.");
Expand Down