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
@@ -1,66 +1,56 @@
@using Aspire.Dashboard.Model
@namespace Aspire.Dashboard.Components

@if (DisplayedEndpoints.Count > 0)
@if (DisplayedEndpoints.Count == 1)
{
<div class="endpoint-container">
<div class="endpoint-first">
@WriteEndpoint(DisplayedEndpoints[0])
@if (DisplayedEndpoints.Count > 1)
{
<span>,&nbsp;</span>
}
</div>
<div>
@if (DisplayedEndpoints.Count > 1)
@WriteEndpoint(DisplayedEndpoints[0])
}
else if (DisplayedEndpoints.Count > 1)
{
<FluentOverflow Class="endpoint-overflow">
<ChildContent>
@for (var i = 0; i < DisplayedEndpoints.Count; i++)
{
<FluentOverflow Class="endpoint-overflow">
<ChildContent>
@for (var i = 1; i < DisplayedEndpoints.Count; i++)
{
var displayedEndpoint = DisplayedEndpoints[i];
var isLast = i == DisplayedEndpoints.Count - 1;
var displayedEndpoint = DisplayedEndpoints[i];
var isLast = i == DisplayedEndpoints.Count - 1;

<FluentOverflowItem Data="displayedEndpoint">
@WriteEndpoint(displayedEndpoint)
<FluentOverflowItem Data="displayedEndpoint">
@WriteEndpoint(displayedEndpoint)

@if (!isLast)
{
<span>,</span>
}
</FluentOverflowItem>
}
</ChildContent>
<MoreButtonTemplate Context="overflow">
<FluentButton Appearance="Appearance.Accent" OnClick="() => _popoverVisible = !_popoverVisible" Class="endpoint-button">
@($"+{overflow.ItemsOverflow.Count()}")
</FluentButton>
</MoreButtonTemplate>
<OverflowTemplate Context="overflow">
@{
var items = overflow.ItemsOverflow.ToList();
}
<FluentPopover AnchorId="@overflow.IdMoreButton" @bind-Open="_popoverVisible" VerticalThreshold="200" AutoFocus="false">
<Header>
@Loc[Resources.Columns.EndpointsColumnDisplayOverflowTitle]
</Header>
<Body>
<div class="endpoint-popup">
@foreach (var item in items)
{
var d = (DisplayedEndpoint)item.Data!;
<div class="endpoint-link">
@WriteEndpoint(d)
</div>
}
</div>
</Body>
</FluentPopover>
</OverflowTemplate>
</FluentOverflow>
@if (!isLast)
{
<span>,</span>
}
</FluentOverflowItem>
}
</ChildContent>
<MoreButtonTemplate Context="overflow">
<FluentButton Appearance="Appearance.Accent" OnClick="() => _popoverVisible = !_popoverVisible" Class="endpoint-button">
@($"+{overflow.ItemsOverflow.Count()}")
</FluentButton>
</MoreButtonTemplate>
<OverflowTemplate Context="overflow">
@{
var items = overflow.ItemsOverflow.ToList();
}
</div>
</div>
<FluentPopover AnchorId="@overflow.IdMoreButton" @bind-Open="_popoverVisible" VerticalThreshold="200" AutoFocus="false">
<Header>
@Loc[Resources.Columns.EndpointsColumnDisplayOverflowTitle]
</Header>
<Body>
<div class="endpoint-popup">
@foreach (var item in items)
{
var d = (DisplayedEndpoint)item.Data!;
<div class="endpoint-link">
@WriteEndpoint(d)
</div>
}
</div>
</Body>
</FluentPopover>
</OverflowTemplate>
</FluentOverflow>
}

@if (!string.IsNullOrEmpty(AdditionalMessage))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
::deep.endpoint-container {
display: grid;
/*
Two columns:
-The first endpoint. Max width is the width of the endpoint text, min width is nothing so the overflow button is always displayed.
-The endpoint overflow. Max width is all remaining space, min width is the overflow button.
*/
grid-template-columns: minmax(0px, max-content) minmax(min-content, auto);
}

::deep.endpoint-first {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

::deep.endpoint-list {
margin: 0;
padding: 0;
Expand Down
3 changes: 0 additions & 3 deletions tests/Aspire.Workload.Tests/WorkloadTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ protected static async Task<ResourceRow[]> CheckDashboardHasResourcesAsync(IPage
.Select(t => t.Result.Trim(','))
.ToList();

var firstEndpoint = await rowLoc.Locator("//div[@class='endpoint-first']").InnerTextAsync();
endpointsFound.Insert(0, firstEndpoint.Trim().Trim(','));

if (expectedEndpoints.Length != endpointsFound.Count)
{
// _testOutput.WriteLine($"For resource '{resourceName}, found ")
Expand Down