Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Dec 7, 2023
1 parent e551209 commit e36812b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ else
{
<h5>@Loc[ControlsStrings.ChartContainerOptionsHeader]</h5>
<div>
<FluentSwitch Label="@Loc[ControlsStrings.ChartContainerOptionsShowCountLabel]" @bind-Value="_showMeasurementCount" @bind-Value:after="ShowMeasurementCountChanged" />
<FluentSwitch Label="@Loc[ControlsStrings.ChartContainerOptionsShowCountLabel]" @bind-Value="_showCount" @bind-Value:after="ShowCountChanged" />
</div>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class ChartContainer : ComponentBase, IAsyncDisposable
private int _renderedDimensionsCount;
private string? _previousMeterName;
private string? _previousInstrumentName;
private bool _showMeasurementCount;
private bool _showCount;
private readonly InstrumentViewModel _instrumentViewModel = new InstrumentViewModel();

[Parameter, EditorRequired]
Expand Down Expand Up @@ -244,8 +244,8 @@ private List<DimensionFilterViewModel> CreateUpdatedFilters(bool hasInstrumentCh
return filters;
}

private void ShowMeasurementCountChanged()
private void ShowCountChanged()
{
_instrumentViewModel.ShowCount = _showMeasurementCount;
_instrumentViewModel.ShowCount = _showCount;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,13 @@ private async Task UpdateChart(bool tickUpdate, DateTime inProgressDataTime)
Debug.Assert(InstrumentViewModel.Instrument != null);
Debug.Assert(InstrumentViewModel.MatchedDimensions != null);

// Unit comes from the instrument and they're not localized.
// The hardcoded "Count" label isn't localized for consistency.
const string CountUnit = "Count";

var unit = !InstrumentViewModel.ShowCount
? GetDisplayedUnit(InstrumentViewModel.Instrument)
: "Count";
: CountUnit;

List<Trace> traces;
List<DateTime> xValues;
Expand Down
1 change: 0 additions & 1 deletion src/Aspire.Dashboard/Model/InstrumentViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Aspire.Dashboard.Model;
public class InstrumentViewModel
{
public OtlpInstrument? Instrument { get; private set; }

public List<DimensionScope>? MatchedDimensions { get; private set; }

public Func<Task>? OnDataUpdate { get; set; }
Expand Down

0 comments on commit e36812b

Please sign in to comment.