31 references to ResourceListDensity
Aspire.Dashboard (12)
Components\Controls\ApplicationSummary.razor.cs (2)
164
ResourceListDensity
.Spacious => "resource-card-grid-spacious",
165
ResourceListDensity
.Compact => "resource-card-grid-compact",
Components\Dialogs\SettingsDialog.razor.cs (4)
28
private IReadOnlyList<IconToggleOption<
ResourceListDensity
>> _densityOptions = [];
91
new(
ResourceListDensity
.Spacious, new Icons.Regular.Size20.TextBulletListLtr(), Loc[nameof(Dashboard.Resources.Dialogs.SettingsDialogResourceListDensitySpacious)]),
92
new(
ResourceListDensity
.Comfortable, new Icons.Regular.Size20.AppsListDetail(), Loc[nameof(Dashboard.Resources.Dialogs.SettingsDialogResourceListDensityComfortable)]),
93
new(
ResourceListDensity
.Compact, new Icons.Regular.Size20.AppsList(), Loc[nameof(Dashboard.Resources.Dialogs.SettingsDialogResourceListDensityCompact)]),
Components\Layout\ResourcesLayout.razor.cs (2)
1303
private bool IsCompact => ViewPreferences.Density ==
ResourceListDensity
.Compact;
1304
private bool IsSpacious => ViewPreferences.Density ==
ResourceListDensity
.Spacious;
Model\DashboardViewPreferences.cs (4)
86
public
ResourceListDensity
Density { get; private set; }
121
public async Task SetDensityAsync(
ResourceListDensity
density)
162
var
density = await ReadAsync<
ResourceListDensity
>(BrowserStorageKeys.ResourceListDensity).ConfigureAwait(false);
Aspire.Dashboard.Components.Tests (19)
Controls\ApplicationSummaryTests.cs (2)
96
await cut.InvokeAsync(() => preferences.SetDensityAsync(
ResourceListDensity
.Compact));
99
await cut.InvokeAsync(() => preferences.SetDensityAsync(
ResourceListDensity
.Spacious));
Dialogs\SettingsDialogTests.cs (1)
79
Assert.Equal(
ResourceListDensity
.Comfortable, preferences.Density);
Layout\ResourcesLayoutTests.cs (16)
395
await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(
ResourceListDensity
.Compact));
569
[InlineData(true,
ResourceListDensity
.Comfortable)]
570
[InlineData(true,
ResourceListDensity
.Compact)]
571
[InlineData(true,
ResourceListDensity
.Spacious)]
572
[InlineData(false,
ResourceListDensity
.Comfortable)]
573
public async Task RowTerminal_SelectsOnlyItsResourceAndPreservesViewState(bool desktop,
ResourceListDensity
density)
1057
[InlineData("Persistent",
ResourceListDensity
.Comfortable, "Container (persistent)")]
1058
[InlineData("Persistent",
ResourceListDensity
.Compact, "Container (persistent)")]
1059
[InlineData("Persistent",
ResourceListDensity
.Spacious, "Container (persistent)")]
1060
[InlineData("Session",
ResourceListDensity
.Comfortable, "Container")]
1061
[InlineData("Session",
ResourceListDensity
.Compact, "Container")]
1062
[InlineData("Session",
ResourceListDensity
.Spacious, "Container")]
1063
[InlineData(null,
ResourceListDensity
.Comfortable, "Container")]
1064
[InlineData(null,
ResourceListDensity
.Compact, "Container")]
1065
[InlineData(null,
ResourceListDensity
.Spacious, "Container")]
1066
public async Task AppHost_ContainerLifetimeQualifiesTypeAndBadgesResourceGlyph(string? lifetime,
ResourceListDensity
density, string expectedType)