-
Notifications
You must be signed in to change notification settings - Fork 863
Dashboard: Add InfoPopover for state column with clickable links #15996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e55832f
7f9bd63
8217c09
d42e4a4
b6de936
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| @using Aspire.Dashboard.Resources | ||
| @inject IStringLocalizer<Columns> Loc | ||
|
|
||
| @{ | ||
| var buttonId = $"info-popover-{AnchorId}"; | ||
| } | ||
|
|
||
| <span @onclick:stopPropagation="true" class="info-popover-container"> | ||
| <FluentButton Id="@buttonId" | ||
| Appearance="Appearance.Stealth" | ||
| Class="info-popover-button" | ||
| OnClick="@(() => _popoverVisible = !_popoverVisible)" | ||
| aria-label="@Loc[nameof(Columns.StateColumnResourceInfoButton)]"> | ||
| <FluentIcon Value="@(new Icons.Regular.Size16.Info())" Color="Color.Neutral" /> | ||
| </FluentButton> | ||
| <FluentPopover AnchorId="@buttonId" @bind-Open="_popoverVisible" VerticalThreshold="200" AutoFocus="false"> | ||
| <Body> | ||
| <div class="info-popover-content"> | ||
| @ChildContent | ||
| </div> | ||
| </Body> | ||
| </FluentPopover> | ||
| </span> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Microsoft.AspNetCore.Components; | ||
|
|
||
| namespace Aspire.Dashboard.Components.Controls; | ||
|
|
||
| public partial class InfoPopover | ||
| { | ||
| private bool _popoverVisible; | ||
|
|
||
| [Parameter, EditorRequired] | ||
| public required string AnchorId { get; set; } | ||
|
|
||
| [Parameter, EditorRequired] | ||
| public required RenderFragment ChildContent { get; set; } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| .info-popover-container { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| margin-left: 4px; | ||
| } | ||
|
|
||
| ::deep .info-popover-button { | ||
| min-width: unset; | ||
| padding: 0; | ||
| height: 20px; | ||
| width: 20px; | ||
| } | ||
|
|
||
| ::deep fluent-popover { | ||
| width: auto; | ||
| max-width: 500px; | ||
| cursor: default; | ||
| } | ||
|
|
||
| ::deep fluent-popover *, | ||
| ::deep .fluent-popover-body { | ||
| cursor: default; | ||
| white-space: normal; | ||
| word-wrap: break-word; | ||
| max-width: 400px; | ||
| } | ||
|
|
||
| .info-popover-content { | ||
| max-width: 400px; | ||
| white-space: normal; | ||
| word-wrap: break-word; | ||
| cursor: default; | ||
| } | ||
|
|
||
| .info-popover-content a { | ||
| color: var(--accent-fill-rest); | ||
| text-decoration: underline; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .info-popover-content a:hover { | ||
| color: var(--accent-fill-hover); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| .state-column-cell { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated but useful change, we have hundreds of projects so we should not automatically restore in the aspire repo