Skip to content

Commit 2ccfe77

Browse files
CopilotJamesNK
andcommitted
Move IInteractionService and related types from ApplicationModel to Aspire.Hosting namespace
Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
1 parent 478ca3b commit 2ccfe77

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

src/Aspire.Hosting/Dashboard/DashboardService.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Microsoft.AspNetCore.Authorization;
88
using Microsoft.Extensions.Hosting;
99
using Microsoft.Extensions.Logging;
10-
using static Aspire.Hosting.ApplicationModel.Interaction;
10+
using static Aspire.Hosting.Interaction;
1111

1212
namespace Aspire.Hosting.Dashboard;
1313

@@ -117,7 +117,7 @@ async Task WatchInteractionsInternal(CancellationToken cancellationToken)
117117

118118
var inputInstances = inputs.Inputs.Select(input =>
119119
{
120-
var dto = new InteractionInput
120+
var dto = new Aspire.DashboardService.Proto.V1.InteractionInput
121121
{
122122
InputType = MapInputType(input.InputType),
123123
Required = input.Required
@@ -174,33 +174,33 @@ async Task WatchInteractionsInternal(CancellationToken cancellationToken)
174174
}
175175

176176
#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.
177-
private static MessageIntent MapMessageIntent(ApplicationModel.MessageIntent? intent)
177+
private static Aspire.DashboardService.Proto.V1.MessageIntent MapMessageIntent(Aspire.Hosting.MessageIntent? intent)
178178
{
179179
if (intent is null)
180180
{
181-
return MessageIntent.None;
181+
return Aspire.DashboardService.Proto.V1.MessageIntent.None;
182182
}
183183

184184
return intent.Value switch
185185
{
186-
ApplicationModel.MessageIntent.Success => MessageIntent.Success,
187-
ApplicationModel.MessageIntent.Warning => MessageIntent.Warning,
188-
ApplicationModel.MessageIntent.Error => MessageIntent.Error,
189-
ApplicationModel.MessageIntent.Information => MessageIntent.Information,
190-
ApplicationModel.MessageIntent.Confirmation => MessageIntent.Confirmation,
191-
_ => MessageIntent.None,
186+
Aspire.Hosting.MessageIntent.Success => Aspire.DashboardService.Proto.V1.MessageIntent.Success,
187+
Aspire.Hosting.MessageIntent.Warning => Aspire.DashboardService.Proto.V1.MessageIntent.Warning,
188+
Aspire.Hosting.MessageIntent.Error => Aspire.DashboardService.Proto.V1.MessageIntent.Error,
189+
Aspire.Hosting.MessageIntent.Information => Aspire.DashboardService.Proto.V1.MessageIntent.Information,
190+
Aspire.Hosting.MessageIntent.Confirmation => Aspire.DashboardService.Proto.V1.MessageIntent.Confirmation,
191+
_ => Aspire.DashboardService.Proto.V1.MessageIntent.None,
192192
};
193193
}
194194

195-
private static InputType MapInputType(ApplicationModel.InputType inputType)
195+
private static Aspire.DashboardService.Proto.V1.InputType MapInputType(Aspire.Hosting.InputType inputType)
196196
{
197197
return inputType switch
198198
{
199-
ApplicationModel.InputType.Text => InputType.Text,
200-
ApplicationModel.InputType.SecretText => InputType.SecretText,
201-
ApplicationModel.InputType.Choice => InputType.Choice,
202-
ApplicationModel.InputType.Boolean => InputType.Boolean,
203-
ApplicationModel.InputType.Number => InputType.Number,
199+
Aspire.Hosting.InputType.Text => Aspire.DashboardService.Proto.V1.InputType.Text,
200+
Aspire.Hosting.InputType.SecretText => Aspire.DashboardService.Proto.V1.InputType.SecretText,
201+
Aspire.Hosting.InputType.Choice => Aspire.DashboardService.Proto.V1.InputType.Choice,
202+
Aspire.Hosting.InputType.Boolean => Aspire.DashboardService.Proto.V1.InputType.Boolean,
203+
Aspire.Hosting.InputType.Number => Aspire.DashboardService.Proto.V1.InputType.Number,
204204
_ => throw new InvalidOperationException($"Unexpected input type: {inputType}"),
205205
};
206206
}

src/Aspire.Hosting/ApplicationModel/IInteractionService.cs renamed to src/Aspire.Hosting/IInteractionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Diagnostics.CodeAnalysis;
55

6-
namespace Aspire.Hosting.ApplicationModel;
6+
namespace Aspire.Hosting;
77

88
#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.
99

src/Aspire.Hosting/ApplicationModel/InteractionService.cs renamed to src/Aspire.Hosting/InteractionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Threading.Channels;
88
using Microsoft.Extensions.Logging;
99

10-
namespace Aspire.Hosting.ApplicationModel;
10+
namespace Aspire.Hosting;
1111

1212
#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.
1313

src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Globalization;
99
using System.Threading.Channels;
1010
using Aspire.Hosting.Backchannel;
11-
using Aspire.Hosting.ApplicationModel;
1211

1312
namespace Aspire.Hosting.Publishing;
1413

src/Aspire.Hosting/VersionChecking/VersionCheckService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
using System.Diagnostics.CodeAnalysis;
77
using System.Globalization;
8-
using Aspire.Hosting.ApplicationModel;
98
using Microsoft.Extensions.Configuration;
109
using Microsoft.Extensions.Hosting;
1110
using Microsoft.Extensions.Logging;

tests/Aspire.Hosting.Tests/Dashboard/DashboardServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public async Task WatchInteractions_PromptInputAsync_CompleteOnCancelResponse()
315315
var resultTask = interactionService.PromptInputAsync(
316316
title: "Title!",
317317
message: "Message!",
318-
new ApplicationModel.InteractionInput { InputType = ApplicationModel.InputType.Text, Label = "Input" });
318+
new Aspire.Hosting.InteractionInput { InputType = Aspire.Hosting.InputType.Text, Label = "Input" });
319319

320320
// Assert
321321
logger.LogInformation("Reading result from writer.");

0 commit comments

Comments
 (0)