-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add indicators list view (#432)
* feat: add indicators list view * feat: add filters to the list * chore: remove default filters * chore: lint error check
- Loading branch information
1 parent
e2dc678
commit 16814c1
Showing
8 changed files
with
51 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/components/sectionList/filters/filterSelectors/IndicatorFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
import { useSectionListFilter } from '../../../../lib' | ||
import { createFilterDataQuery } from './createFilterDataQuery' | ||
import { ModelFilterSelect } from './ModelFilter' | ||
|
||
const query = createFilterDataQuery('indicatorTypes') | ||
|
||
export const IndicatorFilter = () => { | ||
const [filter, setFilter] = useSectionListFilter('indicatorType') | ||
|
||
const selected = filter?.[0] | ||
|
||
return ( | ||
<ModelFilterSelect | ||
placeholder={i18n.t('Indicator Type')} | ||
query={query} | ||
selected={selected} | ||
onChange={({ selected }) => | ||
setFilter(selected ? [selected] : undefined) | ||
} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import React from 'react' | ||
import { DefaultSectionList } from '../DefaultSectionList' | ||
|
||
export const Component = () => <DefaultSectionList /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters