diff --git a/i18n/en.pot b/i18n/en.pot index 357200cc..04dcc9a4 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-11-12T08:30:18.816Z\n" -"PO-Revision-Date: 2024-11-12T08:30:18.816Z\n" +"POT-Creation-Date: 2024-11-13T12:57:12.003Z\n" +"PO-Revision-Date: 2024-11-13T12:57:12.004Z\n" msgid "schemas" msgstr "schemas" @@ -306,6 +306,9 @@ msgstr "Type to filter options" msgid "No matches" msgstr "No matches" +msgid "Data set" +msgstr "Data set" + msgid "Search by name, code or ID" msgstr "Search by name, code or ID" @@ -477,9 +480,6 @@ msgstr "Data element group set" msgid "Data element group sets" msgstr "Data element group sets" -msgid "Data set" -msgstr "Data set" - msgid "Data sets" msgstr "Data sets" @@ -849,6 +849,12 @@ msgstr "MultiPolygon" msgid "GeometryCollection" msgstr "GeometryCollection" +msgid "Section" +msgstr "Section" + +msgid "Section Multi-org" +msgstr "Section Multi-org" + msgid "Aggregation type" msgstr "Aggregation type" @@ -861,6 +867,9 @@ msgstr "Form name" msgid "Domain type" msgstr "Domain type" +msgid "Form type" +msgstr "Form type" + msgid "Sharing" msgstr "Sharing" @@ -900,9 +909,6 @@ msgstr "Created successfully" msgid "Required" msgstr "Required" -msgid "Form type" -msgstr "Form type" - msgid "Period type" msgstr "Period type" diff --git a/src/components/sectionList/filters/FilterWrapper.tsx b/src/components/sectionList/filters/FilterWrapper.tsx index 1c79c88c..c0fc047b 100644 --- a/src/components/sectionList/filters/FilterWrapper.tsx +++ b/src/components/sectionList/filters/FilterWrapper.tsx @@ -2,7 +2,7 @@ import i18n from '@dhis2/d2-i18n' import { Button } from '@dhis2/ui' import React from 'react' import { useSectionListFilters } from './../../../lib' -import { DynamicFilters } from './DynamicFilters' +import { DynamicFilters } from './filterSelectors/DynamicFilters' import { IdentifiableFilter } from './filterSelectors/IdentifiableFilter' import css from './FilterWrapper.module.css' diff --git a/src/components/sectionList/filters/filterSelectors/DataSetFilter.tsx b/src/components/sectionList/filters/filterSelectors/DataSetFilter.tsx new file mode 100644 index 00000000..f0c387fc --- /dev/null +++ b/src/components/sectionList/filters/filterSelectors/DataSetFilter.tsx @@ -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('dataSets') + +export const DataSetFilter = () => { + const [filter, setFilter] = useSectionListFilter('dataSet') + + const selected = filter?.[0] + + return ( + + setFilter(selected ? [selected] : undefined) + } + /> + ) +} diff --git a/src/components/sectionList/filters/DynamicFilters.tsx b/src/components/sectionList/filters/filterSelectors/DynamicFilters.tsx similarity index 89% rename from src/components/sectionList/filters/DynamicFilters.tsx rename to src/components/sectionList/filters/filterSelectors/DynamicFilters.tsx index 23f09543..7b9eac39 100644 --- a/src/components/sectionList/filters/DynamicFilters.tsx +++ b/src/components/sectionList/filters/filterSelectors/DynamicFilters.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { ConfigurableFilterKey } from './../../../lib' +import { ConfigurableFilterKey } from '../../../../lib' import { AggregationTypeFilter, CategoryComboFilter, @@ -13,8 +13,9 @@ import { PublicAccessFilter, ValueTypeSelectionFilter, FormTypeFilter, -} from './filterSelectors' -import { useFilterKeys } from './useFilterKeys' + DataSetFilter +} from '.' +import { useFilterKeys } from '../useFilterKeys' type FilterKeyToComponentMap = Partial> @@ -31,6 +32,7 @@ const filterKeyToComponentMap: FilterKeyToComponentMap = { publicAccess: PublicAccessFilter, dataDimensionType: DataDimensionTypeFilter, ignoreApproval: IgnoreApprovalFilter, + dataSet: DataSetFilter, } export const DynamicFilters = () => { diff --git a/src/components/sectionList/filters/filterSelectors/index.ts b/src/components/sectionList/filters/filterSelectors/index.ts index 4de80a4a..fa056f4d 100644 --- a/src/components/sectionList/filters/filterSelectors/index.ts +++ b/src/components/sectionList/filters/filterSelectors/index.ts @@ -8,3 +8,4 @@ export * from './CategoryOptionGroupFilter' export * from './BooleanFilters' export * from './CategoryOptionFilter' export * from './IndicatorFilter' +export * from './DataSetFilter'