5 instantiations of RelativeOrderMove
Aspire.Dashboard (1)
Model\ResourceDisplayStore.cs (1)
330move = new RelativeOrderMove(key,
Aspire.Dashboard.Tests (4)
Integration\StartupTests.cs (1)
110.Select(i => new RelativeOrderMove(groupKeys[i], groupKeys[i - 1], groupKeys[i + 1], PreferNext: true)).ToList();
Model\ResourceDisplayStoreTests.cs (3)
296[new("worker_0", PreviousKey: null, NextKey: "api_0", PreferNext: false)]); 311var first = new RelativeOrderMove("api_0", PreviousKey: "worker_0", NextKey: null, PreferNext: false); 312var second = new RelativeOrderMove("api_0", PreviousKey: null, NextKey: "worker_0", PreferNext: true);
34 references to RelativeOrderMove
Aspire.Dashboard (19)
Model\ResourceDisplayStore.cs (17)
27private readonly LocalStorageSetting<List<RelativeOrderMove>> _resourceOrder; 28private readonly LocalStorageSetting<Dictionary<string, List<RelativeOrderMove>>> _groupOrder; 253var result = CreateMove(resourceKey, anchorKey, after, siblingKeys, out var move); 271var result = CreateMove(key, anchor, after, orderedGroupKeys, out var move); 305private static ResourceOrderMoveResult CreateMove(string key, string anchor, bool after, IEnumerable<string> orderedKeys, out RelativeOrderMove? move) 337private static void ReplayMoves<T>(List<T> items, RelativeOrderMove[] moves, Func<T, string> getKey, Func<T, T, bool>? canMove) 339foreach (var move in moves) 368private static void CompactMoves(List<RelativeOrderMove> moves) 374var move = moves[i]; 394private static List<RelativeOrderMove> NormalizeMoves(List<RelativeOrderMove>? moves) 404private static List<RelativeOrderMove> NormalizeResourceOrder(List<RelativeOrderMove>? stored) 411private static Dictionary<string, List<RelativeOrderMove>> NormalizeGroupOrder(Dictionary<string, List<RelativeOrderMove>>? stored) 419private static void TrimResourceMoves(List<RelativeOrderMove> moves) 427private static void TrimGroupMoves(Dictionary<string, List<RelativeOrderMove>> order)
Serialization\DashboardJsonSerializerContext.cs (2)
41[JsonSerializable(typeof(List<RelativeOrderMove>))] 42[JsonSerializable(typeof(Dictionary<string, List<RelativeOrderMove>>))]
Aspire.Dashboard.Tests (15)
Integration\StartupTests.cs (1)
111await browser.Storage.SetAsync("groups", new Dictionary<string, List<RelativeOrderMove>> { ["Tags"] = moves });
Model\ResourceDisplayStoreTests.cs (14)
54var saved = Assert.Single((await _browser.Storage.GetAsync<List<RelativeOrderMove>>(s_resourceKey)).Value!); 56Assert.True((await _browser.Storage.GetUnprotectedAsync<List<RelativeOrderMove>>(s_resourceKey)).InvalidValue); 146var saved = (await _browser.Storage.GetAsync<List<RelativeOrderMove>>(s_resourceKey)).Value!; 165var savedResources = (await _browser.Storage.GetAsync<List<RelativeOrderMove>>(s_resourceKey)).Value!; 166var savedGroups = (await _browser.Storage.GetAsync<Dictionary<string, List<RelativeOrderMove>>>(s_groupKey)).Value!; 229var savedResources = (await _browser.Storage.GetAsync<List<RelativeOrderMove>>(s_resourceKey)).Value!; 230var savedGroups = (await _browser.Storage.GetAsync<Dictionary<string, List<RelativeOrderMove>>>(s_groupKey)).Value!; 249var saved = (await _browser.Storage.GetAsync<Dictionary<string, List<RelativeOrderMove>>>(s_groupKey)).Value!; 253Assert.True((await _browser.Storage.GetUnprotectedAsync<Dictionary<string, List<RelativeOrderMove>>>(s_groupKey)).InvalidValue); 295await _browser.Storage.SetUnprotectedAsync<List<RelativeOrderMove>>(s_resourceKey, 311var first = new RelativeOrderMove("api_0", PreviousKey: "worker_0", NextKey: null, PreferNext: false); 312var second = new RelativeOrderMove("api_0", PreviousKey: null, NextKey: "worker_0", PreferNext: true); 313await _browser.Storage.SetAsync<List<RelativeOrderMove>>(s_resourceKey, [first, second, first]);