mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-20 00:07:01 +00:00
fix: keep every owner chip on the trigger lists while one is selected (#12485)
Selecting an owner chip on a trigger list page (HTTP routes, WebSocket, Kafka, Postgres and the other kinds) filtered the rows the chips are built from, so every other chip disappeared and switching owners took two clicks. Apply the owner filter after the chips are computed, as the home page does.
This commit is contained in:
@@ -434,16 +434,13 @@
|
||||
return !path.startsWith('u/') || path.startsWith('u/' + operatingUser.current?.username + '/')
|
||||
}
|
||||
|
||||
const preFilteredItems = $derived(
|
||||
triggers.filter(
|
||||
(x) =>
|
||||
(ownerFilter == undefined ||
|
||||
(selectedFilterKind === 'trigger' ? x.path : x.script_path).startsWith(
|
||||
ownerFilter + '/'
|
||||
)) &&
|
||||
filterItemsPathsBaseOnUserFilters(x)
|
||||
)
|
||||
)
|
||||
function ownerPath(item: TriggerRow) {
|
||||
return selectedFilterKind === 'trigger' ? item.path : item.script_path
|
||||
}
|
||||
|
||||
// The owner filter applies last: the chips are how you switch owners, so the rows they are
|
||||
// built from must not be narrowed to the selected one.
|
||||
const preFilteredItems = $derived(triggers.filter((x) => filterItemsPathsBaseOnUserFilters(x)))
|
||||
|
||||
let lastWorkspace = untrack(() => $operatingWorkspace)
|
||||
$effect.pre(() => {
|
||||
@@ -457,14 +454,18 @@
|
||||
Array.from(
|
||||
new Set(
|
||||
(filteredItems ?? [])
|
||||
.map((x) => (selectedFilterKind === 'trigger' ? x.path : x.script_path))
|
||||
.map(ownerPath)
|
||||
.filter(Boolean)
|
||||
.map((p) => p.split('/').slice(0, 2).join('/'))
|
||||
)
|
||||
).sort()
|
||||
)
|
||||
|
||||
const items = $derived(filter !== '' ? filteredItems : preFilteredItems)
|
||||
const items = $derived(
|
||||
(filter !== '' ? filteredItems : preFilteredItems)?.filter(
|
||||
(x) => ownerFilter == undefined || ownerPath(x).startsWith(ownerFilter + '/')
|
||||
)
|
||||
)
|
||||
|
||||
// A push delivery has no connection to report and no consumer to suspend: it is an endpoint.
|
||||
function isLive(row: TriggerRow): boolean {
|
||||
|
||||
Reference in New Issue
Block a user