Skip to content

Commit 14d62c3

Browse files
committed
feat(dashboard): search and trust notice on the Repositories view
Add a search box that filters connected repositories and their packages by name, kind, description, category, or tag, and a trust notice stating that connecting a repository runs its charts in the management cluster and that signatures are verified by the index at publication time, not at connect time. Both close gaps the design-conformance review found against #18/#23. Signed-off-by: IvanHunters <[email protected]>
1 parent eb6cee4 commit 14d62c3

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

  • packages/system/dashboard/images/console/apps/console/src/routes

‎packages/system/dashboard/images/console/apps/console/src/routes/TapsPage.tsx‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function TapsPage() {
1717

1818
const [url, setUrl] = useState("")
1919
const [secret, setSecret] = useState("")
20+
const [query, setQuery] = useState("")
2021

2122
const onConnect = async () => {
2223
const trimmed = url.trim()
@@ -48,6 +49,8 @@ export function TapsPage() {
4849
}
4950

5051
const taps = data?.items ?? []
52+
const q = query.trim().toLowerCase()
53+
const visibleTaps = q === "" ? taps : taps.filter((tap) => tapMatches(tap, q))
5154

5255
return (
5356
<div className="p-6">
@@ -58,6 +61,11 @@ export function TapsPage() {
5861
</p>
5962
</div>
6063

64+
<div className="mb-4 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800">
65+
Connecting a repository runs its charts in the management cluster. Connect only sources you
66+
trust. The index verifies signatures at publication time; connecting does not verify them.
67+
</div>
68+
6169
<div className="mb-6 flex flex-wrap items-end gap-2 rounded-lg border border-slate-200 bg-white p-4">
6270
<label className="flex flex-col text-xs font-medium text-slate-500">
6371
Repository (oci:// reference)
@@ -105,15 +113,43 @@ export function TapsPage() {
105113
</div>
106114
)}
107115

116+
{taps.length > 0 && (
117+
<input
118+
className="mb-3 w-96 rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900"
119+
placeholder="Search repositories and packages…"
120+
value={query}
121+
onChange={(e) => setQuery(e.target.value)}
122+
/>
123+
)}
124+
125+
{taps.length > 0 && visibleTaps.length === 0 && (
126+
<div className="rounded-lg border border-dashed border-slate-300 bg-white p-8 text-center text-sm text-slate-500">
127+
No repositories or packages match “{query}”.
128+
</div>
129+
)}
130+
108131
<div className="space-y-3">
109-
{taps.map((tap) => (
132+
{visibleTaps.map((tap) => (
110133
<TapCard key={tap.metadata.name} tap={tap} onDisconnect={onDisconnect} />
111134
))}
112135
</div>
113136
</div>
114137
)
115138
}
116139

140+
// tapMatches reports whether a tap's name, source, or any of its packages match
141+
// the lowercased query.
142+
function tapMatches(tap: Tap, q: string): boolean {
143+
if (tap.metadata.name.toLowerCase().includes(q)) return true
144+
const spec = tap.spec ?? {}
145+
if ((spec.source?.name ?? "").toLowerCase().includes(q)) return true
146+
return (spec.packages ?? []).some((p) =>
147+
[p.name, p.kind, p.description, p.category, ...(p.tags ?? [])]
148+
.filter(Boolean)
149+
.some((s) => (s as string).toLowerCase().includes(q)),
150+
)
151+
}
152+
117153
function TapCard({ tap, onDisconnect }: { tap: Tap; onDisconnect: (name: string) => void }) {
118154
const name = tap.metadata.name
119155
const spec = tap.spec ?? {}

0 commit comments

Comments
 (0)