mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-15 08:33:03 +00:00
Hide Reset on storage filter row when source is externally forced
StoragePageControls.showClearAll fed the actual sourceFilter() into
hasActiveStorageFilters even when the parent forced the scope via
suppressSourceFilter (e.g. Proxmox/Storage mounts StorageSurface
with forcedSourceFilter='proxmox-pve'). Because 'proxmox-pve' is not
the global DEFAULT_STORAGE_SOURCE_FILTER ('all'), the active-filter
check returned true on first paint and the Reset button showed
unconditionally — even though no user-controllable filter had been
changed.
Treat the source filter as DEFAULT_STORAGE_SOURCE_FILTER inside the
active check when suppressSourceFilter is set; the user can't change
that filter on a scoped storage tab, so it must not surface Reset.
suppressNodeFilter was already handled symmetrically; this aligns
sourceFilter with that contract.
This commit is contained in:
@@ -116,7 +116,13 @@ export const StoragePageControls: Component<StoragePageControlsProps> = (props)
|
||||
sortDirection: props.sortDirection(),
|
||||
groupBy: props.storageFilterGroupBy(),
|
||||
statusFilter: props.statusFilter(),
|
||||
sourceFilter: props.sourceFilter(),
|
||||
// When the Source filter is suppressed (a platform page like
|
||||
// Proxmox/Storage forces it to its own scope via
|
||||
// `forcedSourceFilter`), the user cannot change it — so it must not
|
||||
// count as an "active filter" that surfaces the Reset button.
|
||||
sourceFilter: props.suppressSourceFilter
|
||||
? DEFAULT_STORAGE_SOURCE_FILTER
|
||||
: props.sourceFilter(),
|
||||
diskRoleFilter: props.diskRoleFilter?.(),
|
||||
diskGroupFilter: props.diskGroupFilter?.(),
|
||||
}) ||
|
||||
|
||||
Reference in New Issue
Block a user