-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make all pages accessible to low vision on reflow (#5200)
* Make all pages accessible to low vision on reflow * avoid recreating ChartContainer to avoid state loss * hide level, don't hide message on structured logs * clean up * more cleanup * fix test * Disable copy button for very low viewport width * add missing argument in tests * fix extra parameter after merge * Dynamically resize graph * address some pr comments * update comment, re-add row click attributes * add grid column manager * implement gridcolumnmanager in resources * fix invalid comment * Avoid horizontal scrolling * use grid manager in tracedetail * use grid column manager in traces * use column manager in structured logs data grid * make metrics select a resource a link on mobile * Move conditional rendering logic of columns into AspireProperty/TemplateColumn * Remove structured logs level column on mobile * remove accidentally-kept comment * Fix toolbar layout, remove viewport info from column manager * assert no duplicate columns, rename param * remove using * Fix tests --------- Co-authored-by: James Newton-King <james@newtonking.com> Co-authored-by: Drew Noakes <git@drewnoakes.com>
- Loading branch information
1 parent
3a41098
commit 31ac767
Showing
95 changed files
with
931 additions
and
461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/Aspire.Dashboard/Components/Controls/Chart/PlotlyChart.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
@using Aspire.Dashboard.Resources | ||
@namespace Aspire.Dashboard.Components | ||
@namespace Aspire.Dashboard.Components | ||
|
||
@inherits Aspire.Dashboard.Components.Controls.Chart.ChartBase; | ||
|
||
<div id="@ChartDivId" class="plotly-chart-container" style="width:650px; height:450px;"></div> | ||
<div id="@ChartDivId" class="plotly-chart-container"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 27 additions & 2 deletions
29
src/Aspire.Dashboard/Components/Controls/Grid/AspirePropertyColumn.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,39 @@ | ||
// 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; | ||
using Microsoft.FluentUI.AspNetCore.Components; | ||
|
||
namespace Aspire.Dashboard.Components.Controls.Grid; | ||
|
||
public class AspirePropertyColumn<TGridItem, TProp> : PropertyColumn<TGridItem, TProp> | ||
public class AspirePropertyColumn<TGridItem, TProp> : PropertyColumn<TGridItem, TProp>, IAspireColumn | ||
{ | ||
[Parameter] | ||
public GridColumnManager? ColumnManager { get; set; } | ||
|
||
[Parameter] | ||
public string? ColumnId { get; set; } | ||
|
||
[Parameter] | ||
public bool UseCustomHeaderTemplate { get; set; } = true; | ||
|
||
protected override void OnParametersSet() | ||
{ | ||
HeaderCellItemTemplate = AspireFluentDataGridHeaderCell.RenderHeaderContent(Grid); | ||
base.OnParametersSet(); | ||
|
||
if (UseCustomHeaderTemplate) | ||
{ | ||
HeaderCellItemTemplate = AspireFluentDataGridHeaderCell.RenderHeaderContent(Grid); | ||
} | ||
} | ||
|
||
protected override bool ShouldRender() | ||
{ | ||
if (ColumnManager is not null && ColumnId is not null && !ColumnManager.IsColumnVisible(ColumnId)) | ||
{ | ||
return false; | ||
} | ||
|
||
return base.ShouldRender(); | ||
} | ||
} |
29 changes: 27 additions & 2 deletions
29
src/Aspire.Dashboard/Components/Controls/Grid/AspireTemplateColumn.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,39 @@ | ||
// 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; | ||
using Microsoft.FluentUI.AspNetCore.Components; | ||
|
||
namespace Aspire.Dashboard.Components.Controls.Grid; | ||
|
||
public class AspireTemplateColumn<TGridItem> : TemplateColumn<TGridItem> | ||
public class AspireTemplateColumn<TGridItem> : TemplateColumn<TGridItem>, IAspireColumn | ||
{ | ||
[Parameter] | ||
public GridColumnManager? ColumnManager { get; set; } | ||
|
||
[Parameter] | ||
public string? ColumnId { get; set; } | ||
|
||
[Parameter] | ||
public bool UseCustomHeaderTemplate { get; set; } = true; | ||
|
||
protected override void OnParametersSet() | ||
{ | ||
HeaderCellItemTemplate = AspireFluentDataGridHeaderCell.RenderHeaderContent(Grid); | ||
base.OnParametersSet(); | ||
|
||
if (UseCustomHeaderTemplate) | ||
{ | ||
HeaderCellItemTemplate = AspireFluentDataGridHeaderCell.RenderHeaderContent(Grid); | ||
} | ||
} | ||
|
||
protected override bool ShouldRender() | ||
{ | ||
if (ColumnManager is not null && ColumnId is not null && !ColumnManager.IsColumnVisible(ColumnId)) | ||
{ | ||
return false; | ||
} | ||
|
||
return base.ShouldRender(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Aspire.Dashboard/Components/Controls/Grid/IAspireColumn.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Aspire.Dashboard.Components.Controls.Grid; | ||
|
||
internal interface IAspireColumn | ||
{ | ||
public GridColumnManager? ColumnManager { get; set; } | ||
|
||
public string? ColumnId { get; set; } | ||
|
||
public bool UseCustomHeaderTemplate { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Aspire.Dashboard/Components/Controls/TreeMetricSelector.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@using Aspire.Dashboard.Components.Pages | ||
|
||
<FluentTreeView Id="metric-selector" Class="metrics-tree" @bind-CurrentSelected="@PageViewModel.SelectedTreeItem" @bind-CurrentSelected:after="HandleSelectedTreeItemChangedAsync"> | ||
<ChildContent> | ||
@foreach (var meterGroup in PageViewModel.Instruments!.GroupBy(i => i.Parent).OrderBy(g => g.Key.MeterName)) | ||
{ | ||
<FluentTreeItem @key="meterGroup.Key" Text="@meterGroup.Key.MeterName" Data="@meterGroup.Key" title="@meterGroup.Key.MeterName" InitiallyExpanded="true" InitiallySelected="@(PageViewModel.SelectedInstrument == null && meterGroup.Key.MeterName == PageViewModel.SelectedMeter?.MeterName)"> | ||
@foreach (var instrument in meterGroup.OrderBy(i => i.Name)) | ||
{ | ||
<FluentTreeItem @key="instrument" Class="nested" Text="@instrument.Name" Data="@instrument" title="@instrument.Name" InitiallySelected="@(instrument.Name == PageViewModel.SelectedInstrument?.Name && instrument.Parent.MeterName == PageViewModel.SelectedMeter?.MeterName)"/> | ||
} | ||
</FluentTreeItem> | ||
} | ||
</ChildContent> | ||
</FluentTreeView> | ||
|
||
@code { | ||
[Parameter, EditorRequired] | ||
public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; } | ||
|
||
[Parameter, EditorRequired] | ||
public required Metrics.MetricsViewModel PageViewModel { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.