Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1004,12 +1004,26 @@ msgstr "Search for {{titleText}}"
msgid "Search for"
msgstr "Search for"

msgid "You can also choose a program from the top bar and search in that program"
msgstr "You can also choose a program from the top bar and search in that program"
msgid ""
"You can also select a program from the top bar to search within that "
"program."
msgstr ""
"You can also select a program from the top bar to search within that "
"program."

msgid "Choose a type to start searching"
msgstr "Choose a type to start searching"

msgid "{{trackedEntityName}} has no searchable attributes"
msgstr "{{trackedEntityName}} has no searchable attributes"

msgid ""
"Try selecting a different tracked entity type, or try searching in a "
"program by choosing one from the top bar."
msgstr ""
"Try selecting a different tracked entity type, or try searching in a "
"program by choosing one from the top bar."

msgid "Search {{name}}"
msgstr "Search {{name}}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState, useEffect, type ComponentType } from 'react';
import { withStyles, type WithStyles } from '@material-ui/core';
import i18n from '@dhis2/d2-i18n';
import { spacers, colors } from '@dhis2/ui';

import { spacers, colors, NoticeBox } from '@dhis2/ui';
import { capitalizeFirstLetter } from 'capture-core-utils/string';
import type { ComponentProps, Props } from './SearchBox.types';
import { searchBoxStatus } from '../../reducers/descriptions/searchDomain.reducerDescription';
import { SearchForm } from './SearchForm';
Expand Down Expand Up @@ -100,7 +100,7 @@ const Index = ({
onSelect={handleSearchScopeSelection}
headerText={i18n.t('Search for')}
footerText={i18n.t(
'You can also choose a program from the top bar and search in that program',
'You can also select a program from the top bar to search within that program.',
)}
/>
)}
Expand Down Expand Up @@ -131,6 +131,18 @@ const Index = ({
{String(i18n.t('Choose a type to start searching'))}
</IncompleteSelectionsMessage>
)}
{selectedSearchScopeId && !searchGroupsForSelectedScope.length && (
<NoticeBox
warning
title={i18n.t('{{trackedEntityName}} has no searchable attributes', {
trackedEntityName: capitalizeFirstLetter(trackedEntityName),
interpolation: { escapeValue: false },
})}
>
{/* eslint-disable-next-line max-len */}
{i18n.t('Try selecting a different tracked entity type, or try searching in a program by choosing one from the top bar.')}
</NoticeBox>
)}
</>
);
};
Expand Down
Loading