remove feed url from publisher dashboard
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.

This commit is contained in:
Abel Luck 2026-06-02 10:56:36 +02:00
parent e4a5246ab3
commit 2147d9c999
3 changed files with 27 additions and 11 deletions

View file

@ -93,7 +93,9 @@ def operational_snapshot(*, snapshot: Mapping[str, str] | None = None) -> Render
] ]
def _source_feed_row(source_feed: Mapping[str, object]) -> tuple[Node, ...]: def _source_feed_row(
source_feed: Mapping[str, object], *, show_feed_url: bool
) -> tuple[Node, ...]:
last_updated_iso = source_feed.get("last_updated_iso") last_updated_iso = source_feed.get("last_updated_iso")
last_updated = ( last_updated = (
h.time( h.time(
@ -117,6 +119,19 @@ def _source_feed_row(source_feed: Mapping[str, object]) -> tuple[Node, ...]:
if next_run_iso is not None if next_run_iso is not None
else h.p(class_="font-medium text-slate-900")[str(source_feed["next_run"])] else h.p(class_="font-medium text-slate-900")[str(source_feed["next_run"])]
) )
feed_url_cells = (
(
h.div(class_="min-w-64")[
inline_link(
href=str(source_feed["feed_href"]),
label=str(source_feed["feed_href"]),
tone="amber",
)
],
)
if show_feed_url
else ()
)
return ( return (
h.div[ h.div[
h.div(class_="font-semibold text-slate-950")[str(source_feed["source"])], h.div(class_="font-semibold text-slate-950")[str(source_feed["source"])],
@ -124,13 +139,7 @@ def _source_feed_row(source_feed: Mapping[str, object]) -> tuple[Node, ...]:
str(source_feed["slug"]) str(source_feed["slug"])
], ],
], ],
h.div(class_="min-w-64")[ *feed_url_cells,
inline_link(
href=str(source_feed["feed_href"]),
label=str(source_feed["feed_href"]),
tone="amber",
)
],
status_badge( status_badge(
label=str(source_feed["feed_status_label"]), label=str(source_feed["feed_status_label"]),
tone=str(source_feed["feed_status_tone"]), tone=str(source_feed["feed_status_tone"]),
@ -150,15 +159,20 @@ def published_feeds_table(
source_feeds: tuple[Mapping[str, object], ...] | None = None, source_feeds: tuple[Mapping[str, object], ...] | None = None,
manage_sources_href: str | None = "/admin/sources", manage_sources_href: str | None = "/admin/sources",
show_heading: bool = True, show_heading: bool = True,
show_feed_url: bool = True,
) -> Renderable: ) -> Renderable:
rows = tuple(_source_feed_row(source_feed) for source_feed in (source_feeds or ())) rows = tuple(
_source_feed_row(source_feed, show_feed_url=show_feed_url)
for source_feed in (source_feeds or ())
)
feed_url_headers = ("Feed URL",) if show_feed_url else ()
return table_section( return table_section(
eyebrow="Published feeds" if show_heading else None, eyebrow="Published feeds" if show_heading else None,
title="Published feeds" if show_heading else None, title="Published feeds" if show_heading else None,
empty_message="No feeds have been published yet.", empty_message="No feeds have been published yet.",
headers=( headers=(
"Source", "Source",
"Feed URL", *feed_url_headers,
"Status", "Status",
"Last updated", "Last updated",
"Next run", "Next run",

View file

@ -46,6 +46,7 @@ def publisher_page(
source_feeds=source_feeds, source_feeds=source_feeds,
manage_sources_href=None, manage_sources_href=None,
show_heading=False, show_heading=False,
show_feed_url=False,
), ),
live_work_section( live_work_section(
running_executions=running_executions, running_executions=running_executions,

View file

@ -1149,7 +1149,8 @@ def test_render_publisher_shows_published_feeds_with_publisher_actions(
assert body.count("Published feeds") == 1 assert body.count("Published feeds") == 1
assert "Publisher source" in body assert "Publisher source" in body
assert 'href="/feeds/publisher-source/feed.rss"' in body assert "Feed URL" not in body
assert 'href="/feeds/publisher-source/feed.rss"' not in body
assert "Available" in body assert "Available" in body
assert "Next run" in body assert "Next run" in body
assert "Disk usage" not in body assert "Disk usage" not in body