refine(operators): wave code back in the fleet row; drop a dead helper
The fleet row named the wave by its short name only ("PILOT-2") while the
detail view and the filter carry the full label ("P2 — PILOT-2"). An operator
matching a row against a work order speaks in codes, so the row carries the
full label now -- still named once, which the row test asserts.
Also takes the console agent's leftover: a dead state_style helper removed and
the unit convention on ALL_TOKENS documented (lengths are unitless; Tk padding
is already pixels, the parity test strips the CSS unit).
This commit is contained in:
parent
8dde8dff3a
commit
b6a14ca8e0
3 changed files with 5 additions and 7 deletions
|
|
@ -255,6 +255,9 @@ METRIC_TOKENS: Mapping[str, int] = {
|
||||||
}
|
}
|
||||||
|
|
||||||
#: Every mirrored value, by CSS token name (used by the parity test).
|
#: Every mirrored value, by CSS token name (used by the parity test).
|
||||||
|
#: Lengths are stored WITHOUT their unit: the unit is the token's (px at
|
||||||
|
#: 96 dpi), and the console passes the number straight to Tk padding, which is
|
||||||
|
#: already in pixels. The parity test strips the CSS unit to compare.
|
||||||
ALL_TOKENS: Mapping[str, str] = {
|
ALL_TOKENS: Mapping[str, str] = {
|
||||||
**TOKENS,
|
**TOKENS,
|
||||||
**{name: str(value) for name, value in SPACE_TOKENS.items()},
|
**{name: str(value) for name, value in SPACE_TOKENS.items()},
|
||||||
|
|
@ -347,11 +350,6 @@ def data_font(size: int = SIZE_SM, weight: str = "normal") -> tuple:
|
||||||
return (data_family(), point_size(size), weight)
|
return (data_family(), point_size(size), weight)
|
||||||
|
|
||||||
|
|
||||||
def state_style(state: str) -> str:
|
|
||||||
"""ttk style name for a state badge ("KURULDU" ...)."""
|
|
||||||
return f"State{state.capitalize()}.Badge.TLabel"
|
|
||||||
|
|
||||||
|
|
||||||
#: State key -> badge style, built from STATE_WORDS so the word and the colour
|
#: State key -> badge style, built from STATE_WORDS so the word and the colour
|
||||||
#: can never be paired up wrongly on one surface.
|
#: can never be paired up wrongly on one surface.
|
||||||
STATE_BADGE_STYLE: Mapping[str, str] = {
|
STATE_BADGE_STYLE: Mapping[str, str] = {
|
||||||
|
|
|
||||||
|
|
@ -904,7 +904,7 @@ class TestFleetPage(PanelCase):
|
||||||
cells = re.findall(r"<td[^>]*>(.*?)</td>", row, flags=re.S)
|
cells = re.findall(r"<td[^>]*>(.*?)</td>", row, flags=re.S)
|
||||||
self.assertEqual(len(cells), 5, row[:200])
|
self.assertEqual(len(cells), 5, row[:200])
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
cells[3], f'<span class="mono">{device.wave.label}</span>', row[:200]
|
cells[3], f'<span class="mono">{device.wave_label}</span>', row[:200]
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_rows_are_sorted_non_ready_first(self) -> None:
|
def test_rows_are_sorted_non_ready_first(self) -> None:
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
<td><span class="badge badge--state-$state_token_suffix" title="$state_meaning">$state_label</span></td>
|
<td><span class="badge badge--state-$state_token_suffix" title="$state_meaning">$state_label</span></td>
|
||||||
<td class="mono"><a class="row-select" href="$select_href">$device_id</a></td>
|
<td class="mono"><a class="row-select" href="$select_href">$device_id</a></td>
|
||||||
<td class="mono">$hostname</td>
|
<td class="mono">$hostname</td>
|
||||||
<td><span class="mono">$wave_name</span></td>
|
<td><span class="mono">$wave_label</span></td>
|
||||||
<td class="mono">$last_seen_text</td>
|
<td class="mono">$last_seen_text</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue