swarm-ui: show, sort and filter the hive domain by one value, say when the roster is empty, keep the schedule agent picker current
The domain column showed a dash unless a hive had a dashboard but sorted and filtered on the domain alone, so rows looked mis-sorted. It now shows the domain as text when there is no dashboard to link. An empty hive roster says so. The schedule form's agent names reload with the schedules and the form says when that load failed.
This commit is contained in:
parent
885c051b33
commit
8c67ac01fe
8 changed files with 140 additions and 32 deletions
27
frontend/packages/swarm-ui/test/agent-options.test.mjs
Normal file
27
frontend/packages/swarm-ui/test/agent-options.test.mjs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import {
|
||||
agentNamesFrom,
|
||||
agentOptionsFor,
|
||||
} from "../src/pages/schedules/agent-options.ts";
|
||||
|
||||
test("agentNamesFrom: sorted names, empty before the roster loads", () => {
|
||||
assert.deepEqual(agentNamesFrom([{ name: "b" }, { name: "a" }]), ["a", "b"]);
|
||||
assert.deepEqual(agentNamesFrom(null), []);
|
||||
});
|
||||
|
||||
test("agentOptionsFor: roster names alone for a new schedule", () => {
|
||||
assert.deepEqual(agentOptionsFor(["b", "a"]), ["a", "b"]);
|
||||
});
|
||||
|
||||
test("agentOptionsFor: keeps an agent that left the roster, once", () => {
|
||||
assert.deepEqual(agentOptionsFor(["a", "b"], { agents: ["b", "gone"] }), [
|
||||
"a",
|
||||
"b",
|
||||
"gone",
|
||||
]);
|
||||
});
|
||||
|
||||
test("agentOptionsFor: an empty roster still offers the schedule's agents", () => {
|
||||
assert.deepEqual(agentOptionsFor([], { agents: ["x"] }), ["x"]);
|
||||
});
|
||||
Loading…
Reference in a new issue