Skip to content

Commit 9145bfa

Browse files
feat: use configured TEA Search Operators in the Search page
1 parent 8c887b1 commit 9145bfa

File tree

8 files changed

+18
-14
lines changed

8 files changed

+18
-14
lines changed

i18n/en.pot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ msgstr ""
55
"Content-Type: text/plain; charset=utf-8\n"
66
"Content-Transfer-Encoding: 8bit\n"
77
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
8-
"POT-Creation-Date: 2025-11-11T14:11:11.392Z\n"
9-
"PO-Revision-Date: 2025-11-11T14:11:11.392Z\n"
8+
"POT-Creation-Date: 2025-12-02T09:20:02.271Z\n"
9+
"PO-Revision-Date: 2025-12-02T09:20:02.271Z\n"
1010

1111
msgid "Choose one or more dates..."
1212
msgstr "Choose one or more dates..."
@@ -537,8 +537,8 @@ msgstr "Clear"
537537
msgid "No results"
538538
msgstr "No results"
539539

540-
msgid "Exact matches only"
541-
msgstr "Exact matches only"
540+
msgid "LIKE - todo delete"
541+
msgstr "LIKE - todo delete"
542542

543543
msgid "Must match the start of the value"
544544
msgstr "Must match the start of the value"

src/core_modules/capture-core/components/FormFields/New/HOC/messages/withSearchHelpMessage.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import i18n from '@dhis2/d2-i18n';
33
import { colors } from '@dhis2/ui';
44
import { withStyles, WithStyles } from '@material-ui/core/styles';
5+
import { searchOperators } from '../../../../../metaDataMemoryStoreBuilders';
56

67
const styles = (theme: any) => ({
78
help: {
@@ -17,9 +18,9 @@ type Props = {
1718
};
1819

1920
const helpTexts = {
20-
EQ: i18n.t('Exact matches only'),
21-
SW: i18n.t('Must match the start of the value'),
22-
EW: i18n.t('Must match the end of the value'),
21+
[searchOperators.EQ]: i18n.t('Exact matches only'),
22+
[searchOperators.SW]: i18n.t('Must match the start of the value'),
23+
[searchOperators.EW]: i18n.t('Must match the end of the value'),
2324
};
2425

2526
const getSearchHelpMessageHOC = <P extends Record<string, any>>(InnerComponent: React.ComponentType<P>) =>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { OptionSetFactory } from './optionSet';
2-
export { SearchGroupFactory, DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, type SearchOperator } from './searchGroup';
2+
export { SearchGroupFactory, DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, searchOperators, type SearchOperator } from './searchGroup';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export { SearchGroupFactory } from './SearchGroupFactory';
22
export type { SearchAttribute } from './searchGroupFactory.types';
3-
export { DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, type SearchOperator } from './searchOperator';
3+
export { DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, searchOperators, type SearchOperator } from './searchOperator';

src/core_modules/capture-core/metaDataMemoryStoreBuilders/common/factory/searchGroup/searchOperator/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, type SearchOperator } from './searchOperator.const';
1+
export { DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, searchOperators, type SearchOperator } from './searchOperator.const';
22
export { forcedSearchOperators } from './forcedSearchOperators';
33
export { defaultSearchOperators } from './defaultSearchOperators';
44

src/core_modules/capture-core/metaDataMemoryStoreBuilders/common/factory/searchGroup/searchOperator/searchOperator.const.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ export const searchOperators = {
66
RANGE: 'RANGE',
77
GE: 'GE',
88
LE: 'LE',
9+
NULL: 'NULL',
10+
NOT_NULL: '!NULL',
911
} as const;
1012

1113
export const DEFAULT_IS_UNIQUE_SEARCH_OPERATOR = searchOperators.EQ;
1214
export const DEFAULT_HAS_OPTION_SET_SEARCH_OPERATOR = searchOperators.EQ;
13-
export const DEFAULT_FALLBACK_SEARCH_OPERATOR = searchOperators.LIKE;
15+
export const DEFAULT_FALLBACK_SEARCH_OPERATOR = searchOperators.EQ;
1416

15-
export type SearchOperator = typeof searchOperators[keyof typeof searchOperators];
17+
export type SearchOperator = (typeof searchOperators)[keyof typeof searchOperators];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { buildMetaDataAsync } from './baseBuilder/metaDataBuilder';
22
export { buildSystemSettingsAsync } from './systemSettings';
33
export { buildCategoryOptionsAsync } from './programs/factory/category';
4-
export { DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, type SearchOperator } from './common/factory';
4+
export { DEFAULT_IS_UNIQUE_SEARCH_OPERATOR, searchOperators, type SearchOperator } from './common/factory';

src/core_modules/capture-core/metaDataStoreLoaders/programs/quickStoreOperations/storeProgramIndicators.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export const storeProgramIndicators = async (programIds: Array<string>) => {
2020
resource: 'programIndicators',
2121
params: {
2222
fields: fieldsParam,
23-
filter: ['displayInForm:eq:true', `program.id:in:[${programIds.join(',')}]`],
23+
// TODO temporary fix for the bug bash
24+
filter: [`program.id:in:[${programIds.join(',')}]`],
2425
},
2526
};
2627

0 commit comments

Comments
 (0)