50 references to ResourceListDensity
Aspire.Dashboard (14)
Components\Dialogs\SettingsDialog.razor.cs (3)
28
private IReadOnlyList<IconToggleOption<
ResourceListDensity
>> _densityOptions = [];
91
new(
ResourceListDensity
.Comfortable, new Icons.Regular.Size20.AppsListDetail(), Loc[nameof(Dashboard.Resources.Dialogs.SettingsDialogResourceListDensityComfortable)]),
92
new(
ResourceListDensity
.Compact, new Icons.Regular.Size20.AppsList(), Loc[nameof(Dashboard.Resources.Dialogs.SettingsDialogResourceListDensityCompact)]),
Components\Layout\ResourcesLayout.razor.cs (1)
1848
private bool IsCompact => ViewPreferences.Density ==
ResourceListDensity
.Compact;
Model\DashboardViewPreferences.cs (10)
71
private const
ResourceListDensity
DefaultDensity =
ResourceListDensity
.Compact;
76
public
ResourceListDensity
Density { get; private set; } = DefaultDensity;
111
public async Task SetDensityAsync(
ResourceListDensity
density)
152
var
density = await ReadDensityAsync().ConfigureAwait(false);
170
private async Task<
ResourceListDensity
> ReadDensityAsync()
177
await localStorage.SetUnprotectedAsync(BrowserStorageKeys.ResourceListDensity, nameof(
ResourceListDensity
.Comfortable)).ConfigureAwait(false);
178
return
ResourceListDensity
.Comfortable;
181
return result.Success && Enum.TryParse<
ResourceListDensity
>(result.Value, out
var
value) && Enum.IsDefined(value) ? value : DefaultDensity;
Aspire.Dashboard.Components.Tests (35)
Dialogs\SettingsDialogTests.cs (1)
99
Assert.Equal(
ResourceListDensity
.Comfortable, preferences.Density);
Layout\ResourceRowAvailabilityTests.cs (2)
87
await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(
ResourceListDensity
.Compact));
441
cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(
ResourceListDensity
.Comfortable));
Layout\ResourcesLayoutTests.cs (29)
413
await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(
ResourceListDensity
.Comfortable));
455
await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(
ResourceListDensity
.Comfortable));
461
[InlineData(
ResourceListDensity
.Compact)]
462
[InlineData(
ResourceListDensity
.Comfortable)]
463
public async Task WideRowMetadata_PreservesRuntimeStateAndAccessibleHealthWithRelativeStart(
ResourceListDensity
density)
506
var compact = density is
ResourceListDensity
.Compact;
1161
await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(
ResourceListDensity
.Comfortable));
1255
await cut.InvokeAsync(() => preferences.SetDensityAsync(
ResourceListDensity
.Comfortable));
1258
await cut.InvokeAsync(() => preferences.SetDensityAsync(
ResourceListDensity
.Compact));
1644
[InlineData(CommandViewModelState.Enabled, false, false,
ResourceListDensity
.Comfortable)]
1645
[InlineData(CommandViewModelState.Enabled, true, false,
ResourceListDensity
.Compact)]
1646
[InlineData(CommandViewModelState.Disabled, true, false,
ResourceListDensity
.Comfortable)]
1647
[InlineData(CommandViewModelState.Enabled, true, true,
ResourceListDensity
.Compact)]
1648
[InlineData(CommandViewModelState.Hidden, true, false,
ResourceListDensity
.Comfortable)]
1649
[InlineData(null, false, false,
ResourceListDensity
.Compact)]
1651
CommandViewModelState? setState, bool highlighted, bool readOnly,
ResourceListDensity
density)
1815
[InlineData(true,
ResourceListDensity
.Comfortable)]
1816
[InlineData(true,
ResourceListDensity
.Compact)]
1817
[InlineData(false,
ResourceListDensity
.Comfortable)]
1818
public async Task RowMenuTerminal_SelectsOnlyItsResourceAndPreservesViewState(bool desktop,
ResourceListDensity
density)
1847
var spacer = density ==
ResourceListDensity
.Compact ? rail[^1] : rail[0];
2510
[InlineData("Persistent",
ResourceListDensity
.Comfortable, "Container (persistent)")]
2511
[InlineData("Persistent",
ResourceListDensity
.Compact, "Container (persistent)")]
2512
[InlineData("Session",
ResourceListDensity
.Comfortable, "Container")]
2513
[InlineData("Session",
ResourceListDensity
.Compact, "Container")]
2514
[InlineData(null,
ResourceListDensity
.Comfortable, "Container")]
2515
[InlineData(null,
ResourceListDensity
.Compact, "Container")]
2516
public async Task AppHost_ContainerLifetimeQualifiesTypeAndBadgesResourceGlyph(string? lifetime,
ResourceListDensity
density, string expectedType)
2531
Assert.Equal(density is
ResourceListDensity
.Compact ? [expectedType] : [],
Model\DashboardViewPreferencesTests.cs (3)
67
Assert.Equal(
ResourceListDensity
.Comfortable, preferences.Density);
74
Assert.Equal(
ResourceListDensity
.Comfortable, reopenedPreferences.Density);
104
Assert.Equal(
ResourceListDensity
.Compact, preferences.Density);
Aspire.Dashboard.Playwright.Tests (1)
Integration\Playwright\Infrastructure\PlaywrightTestsBase.cs (1)
50
localStorage.setItem('{{BrowserStorageKeys.ResourceListDensity}}', '"{{nameof(
ResourceListDensity
.Comfortable)}}"');