Skip to content

Commit

Permalink
feat: pull request #2253 from GlobalFishingWatch/fishing-map/test-new…
Browse files Browse the repository at this point in the history
…-sar-dataset-filters

Test new SAR dataset filters
  • Loading branch information
j8seangel authored Oct 17, 2023
2 parents 25c8e38 + 06ed9f4 commit 811a9d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/fishing-map/features/datasets/datasets.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ export const getIncompatibleFilterSelection = (
}
return incompatibilityDict.filter(({ id, value, disabled }) => {
const selectedFilterValue = dataview.config?.filters?.[id]
if (value === 'undefined' && selectedFilterValue === undefined) {
return disabled.includes(schema)
}
return (
disabled.includes(schema) &&
selectedFilterValue?.length === 1 &&
Expand Down
2 changes: 1 addition & 1 deletion apps/fishing-map/features/dataviews/dataviews.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dataview } from '@globalfishingwatch/api-types'
import { Dataview, DataviewCategory } from '@globalfishingwatch/api-types'

export const dataviews: Dataview[] = []

Expand Down
2 changes: 1 addition & 1 deletion libs/api-types/src/dataviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface DataviewEventsConfig {

export interface IncomatibleFilterConfig {
id: string // id of the filter
value: boolean // value to match
value: boolean | string // value to match
disabled: string[] // disabled filter on matches
}

Expand Down

0 comments on commit 811a9d6

Please sign in to comment.