diff --git a/src/components/reports/DownloadClinicalDataDropdown.tsx b/src/components/reports/DownloadClinicalDataDropdown.tsx index 156c5438..89fd2599 100644 --- a/src/components/reports/DownloadClinicalDataDropdown.tsx +++ b/src/components/reports/DownloadClinicalDataDropdown.tsx @@ -2,7 +2,7 @@ import intl from 'react-intl-universal'; import { useDispatch } from 'react-redux'; import { DownloadOutlined } from '@ant-design/icons'; import { ISqonGroupFilter } from '@ferlab/ui/core/data/sqon/types'; -import { Button, Dropdown } from 'antd'; +import { Button, Dropdown, Tooltip } from 'antd'; import { INDEXES } from 'graphql/constants'; import { generateSelectionSqon } from 'views/DataExploration/utils/selectionSqon'; @@ -24,6 +24,7 @@ const DownloadClinicalDataDropdown = ({ const getCurrentSqon = (): any => sqon || generateSelectionSqon(INDEXES.PARTICIPANT, participantIds); + const isDisabled = !sqon?.content?.length && !participantIds.length; const MenuProps = { onClick: (e: { key: string }) => @@ -49,16 +50,18 @@ const DownloadClinicalDataDropdown = ({ }; return ( - - - + {/** need a empty div below to show tooltip when Dropdown is disabled */} +
+ + + + ); }; diff --git a/src/components/reports/DownloadFileManifestModal/index.tsx b/src/components/reports/DownloadFileManifestModal/index.tsx index 18f6b939..24505623 100644 --- a/src/components/reports/DownloadFileManifestModal/index.tsx +++ b/src/components/reports/DownloadFileManifestModal/index.tsx @@ -3,7 +3,7 @@ import intl from 'react-intl-universal'; import { useDispatch } from 'react-redux'; import { DownloadOutlined } from '@ant-design/icons'; import { ISyntheticSqon } from '@ferlab/ui/core/data/sqon/types'; -import { Button, Checkbox, Modal } from 'antd'; +import { Button, Checkbox, Modal, Tooltip } from 'antd'; import TooMuchFilesAlert from 'components/reports/TooMuchFilesAlert'; import { ReportType } from 'services/api/reports/models'; @@ -34,7 +34,10 @@ const DownloadFileManifestModal = ({ const [isFamilyChecked, setIsFamilyChecked] = useState(false); return ( - <> + + + ); }; diff --git a/src/components/uiKit/SetsManagementDropdown/index.tsx b/src/components/uiKit/SetsManagementDropdown/index.tsx index 71f1f670..37c758cc 100644 --- a/src/components/uiKit/SetsManagementDropdown/index.tsx +++ b/src/components/uiKit/SetsManagementDropdown/index.tsx @@ -214,6 +214,7 @@ const SetsManagementDropdown = ({ const [isEditDisabled, setIsEditDisabled] = useState(true); const [modal, setModal] = useState(modals.hideAll); const { savedSets, isLoading, fetchingError } = useSavedSet(); + const isDisabled = !selectedKeys?.length; useEffect(() => { if (savedSets && !isLoading && !fetchingError && sqon) { @@ -251,25 +252,32 @@ const SetsManagementDropdown = ({ type={type} /> )} - - document.getElementById(`${type}-set-dropdown-container`) as HTMLElement - } + - - + {/** need a empty div below to show tooltip when Dropdown is disabled */} +
+ + document.getElementById(`${type}-set-dropdown-container`) as HTMLElement + } + > + + +
); }; diff --git a/src/locales/en.ts b/src/locales/en.ts index 785e0660..48066161 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -1112,6 +1112,7 @@ const en = { removeTypeSet: 'Remove from a {type} set', set: 'Set', chooseSet: 'Choose a set', + youMustSelect: 'You must select at least 1 item', }, }, // this facets object is also used by Ferlab-ui to override the values in the facets diff --git a/src/locales/fr.ts b/src/locales/fr.ts index e126dc41..2560afb0 100644 --- a/src/locales/fr.ts +++ b/src/locales/fr.ts @@ -417,9 +417,9 @@ const fr = { results: 'Résultats', noResults: 'Aucun résultat', of: 'de', - selected: 'élément selectionné', - selectedPlural: 'éléments selectionnés', - selectAllResults: 'Selectionner tous les résultats', + selected: 'élément sélectionné', + selectedPlural: 'éléments sélectionnés', + selectAllResults: 'Sélectionner tous les résultats', clear: 'Effacer', tableExport: 'Exporter en TSV', reset: 'Réinitialiser', @@ -1127,6 +1127,7 @@ const fr = { removeTypeSet: "Retirer de l'ensemble de {type}", set: 'Ensemble', chooseSet: 'Choisissez un ensemble', + youMustSelect: 'Sélectionnez au moins un élément', }, }, // this facets object is also used by Ferlab-ui to override the values in the facets