diff --git a/frontend/src/lib/components/PathCleanFilters/PathCleanFilters.tsx b/frontend/src/lib/components/PathCleanFilters/PathCleanFilters.tsx index 65659c978711c..932c0b63a3b6e 100644 --- a/frontend/src/lib/components/PathCleanFilters/PathCleanFilters.tsx +++ b/frontend/src/lib/components/PathCleanFilters/PathCleanFilters.tsx @@ -9,11 +9,12 @@ import { PathCleanFilterAddItemButton } from './PathCleanFilterAddItemButton' import { PathCleanFilterItem } from './PathCleanFilterItem' export interface PathCleanFiltersProps { - filters?: PathCleaningFilter[] + filters?: PathCleaningFilter[] | null setFilters: (filters: PathCleaningFilter[]) => void } -export function PathCleanFilters({ filters = [], setFilters: _setFilters }: PathCleanFiltersProps): JSX.Element { +export function PathCleanFilters({ filters: _filters, setFilters: _setFilters }: PathCleanFiltersProps): JSX.Element { + const filters = _filters != null ? _filters : [] const [localFilters, setLocalFilters] = useState(filters) const updateFilters = (filters: PathCleaningFilter[]): void => { diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index 70330efd9efad..f9ae902856944 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -7806,10 +7806,17 @@ "type": "array" }, "localPathCleaningFilters": { - "items": { - "$ref": "#/definitions/PathCleaningFilter" - }, - "type": "array" + "anyOf": [ + { + "items": { + "$ref": "#/definitions/PathCleaningFilter" + }, + "type": "array" + }, + { + "type": "null" + } + ] }, "maxEdgeWeight": { "type": "integer" @@ -7880,10 +7887,17 @@ "type": "array" }, "local_path_cleaning_filters": { - "items": { - "$ref": "#/definitions/PathCleaningFilter" - }, - "type": "array" + "anyOf": [ + { + "items": { + "$ref": "#/definitions/PathCleaningFilter" + }, + "type": "array" + }, + { + "type": "null" + } + ] }, "max_edge_weight": { "type": "integer" diff --git a/frontend/src/queries/schema.ts b/frontend/src/queries/schema.ts index 140549729eb52..2a0efde43bd24 100644 --- a/frontend/src/queries/schema.ts +++ b/frontend/src/queries/schema.ts @@ -1100,7 +1100,7 @@ export type PathsFilter = { /** @default 5 */ stepLimit?: integer pathReplacements?: PathsFilterLegacy['path_replacements'] - localPathCleaningFilters?: PathsFilterLegacy['local_path_cleaning_filters'] + localPathCleaningFilters?: PathsFilterLegacy['local_path_cleaning_filters'] | null minEdgeWeight?: PathsFilterLegacy['min_edge_weight'] maxEdgeWeight?: PathsFilterLegacy['max_edge_weight'] diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 6b6c2b161c442..14d8f9263fd8a 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -2356,7 +2356,7 @@ export interface PathsFilterType extends FilterType { /** @asType integer */ step_limit?: number // Paths Step Limit path_replacements?: boolean - local_path_cleaning_filters?: PathCleaningFilter[] + local_path_cleaning_filters?: PathCleaningFilter[] | null /** @asType integer */ edge_limit?: number | undefined // Paths edge limit /** @asType integer */