From 68f1b162e2ab2b95d78dbe3baa4ff940339b7922 Mon Sep 17 00:00:00 2001 From: cbolles Date: Tue, 12 Mar 2024 12:56:39 -0400 Subject: [PATCH] Notify users if the project does not have access to a dataset --- packages/client/public/locales/en/translation.json | 3 ++- packages/client/src/components/TagTraining.component.tsx | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/client/public/locales/en/translation.json b/packages/client/public/locales/en/translation.json index a1606a50..6ccfbc20 100644 --- a/packages/client/public/locales/en/translation.json +++ b/packages/client/public/locales/en/translation.json @@ -104,7 +104,8 @@ "completed": "All steps completed - your new study is created", "startOver": "Start Over", "formTitle": "Study Information", - "tagsDescription": "Number of times each entry needs to be tagged (default 1)" + "tagsDescription": "Number of times each entry needs to be tagged (default 1)", + "noDatasets": "No datasets available, create a dataset and grant the project access under Datasets > Project Access" }, "studyControl": { "deleteStudy": "Delete Study", diff --git a/packages/client/src/components/TagTraining.component.tsx b/packages/client/src/components/TagTraining.component.tsx index 7afc0a0a..a1020556 100644 --- a/packages/client/src/components/TagTraining.component.tsx +++ b/packages/client/src/components/TagTraining.component.tsx @@ -3,7 +3,7 @@ import { useState, useEffect, SetStateAction, Dispatch } from 'react'; import { useGetDatasetsByProjectLazyQuery } from '../graphql/dataset/dataset'; import { Dataset, Entry } from '../graphql/graphql'; import { GridColDef } from '@mui/x-data-grid'; -import { Switch } from '@mui/material'; +import { Switch, Typography } from '@mui/material'; import { useProject } from '../context/Project.context'; import { useTranslation } from 'react-i18next'; import { useSnackbar } from '../context/Snackbar.context'; @@ -88,7 +88,11 @@ export const TagTrainingComponent: React.FC = (props) return ( <> - + {!getDatasetsResults.loading && datasets.length == 0 ? ( + {t('components.newStudy.noDatasets')} + ) : ( + + )} ); };