Skip to content

Commit

Permalink
Made a hanful of UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanaem committed Oct 4, 2024
1 parent 7b18b38 commit c657f76
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/components/CardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function CardContainer({
return repo.tsv_exists;
case 'has participants.json':
return repo.json_exists;
case 'not annotated':
case 'not annotated using Neurobagel':

Check warning on line 58 in src/components/CardContainer.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/CardContainer.tsx#L58

Added line #L58 was not covered by tests
return !repo.annotated;
default:
return true;
Expand Down
6 changes: 5 additions & 1 deletion src/components/Download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import repos from '../assets/repos.json';
import CardContainer from './CardContainer';

function Download({ onSomeEvent }: { onSomeEvent: (error: string, variant: VariantType) => void }) {
const statusOptions = ['has participants.tsv', 'has participants.json', 'not annotated'];
const statusOptions = [
'has participants.tsv',
'has participants.json',
'not annotated using Neurobagel',
];
const [nameFilters, setNameFilters] = useState<string[]>([]);
const [statusFilters, setStatusFilters] = useState<string[]>([]);

Expand Down
23 changes: 16 additions & 7 deletions src/components/Instructions.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import DialogContentText from '@mui/material/DialogContentText';
import DownloadIcon from '@mui/icons-material/Download';
import CheckCircleSharpIcon from '@mui/icons-material/CheckCircleSharp';

function instructions() {
return (
Expand All @@ -8,13 +10,19 @@ function instructions() {
<li>Find the repository for the dataset you&apos;d like to work on</li>
<ul>
<li>
You can filter through the datasets using the name or status dataset and availability of
the files
You can filter through the datasets by their name and file availability/annotation
status
</li>
</ul>
<li>Download the participant.tsv and/or the participants.json files</li>
<li>Download the participants.tsv and/or the participants.json files</li>
<ul>
<li>You can do so by simply clicking on them in the repository card</li>
<li>
You can do so by simply clicking on the download icon <DownloadIcon color="primary" />{' '}
in the repository card
</li>
<li>
Available files have a green checkmark <CheckCircleSharpIcon color="success" />{' '}
</li>
</ul>
<li>
Once you have the files downloaded locally, head over to the{' '}
Expand All @@ -35,10 +43,11 @@ function instructions() {
</li>
</ul>
<li>
Once you&apos;re done annotating the dataset, use the upload button for your dataset,
enter your information in the form, upload your newly annotated participant.json file, and
submit
Once you&apos;re done annotating the dataset, return to this site, use the upload button
for your dataset, enter your information in the form, upload your newly annotated
participant.json file, and submit
</li>
<li>If the upload was successful, a pull request will be created for the dataset</li>
</ol>
</DialogContentText>
);
Expand Down
34 changes: 27 additions & 7 deletions src/components/RepoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import CheckCircleSharpIcon from '@mui/icons-material/CheckCircleSharp';
import CancelSharpIcon from '@mui/icons-material/CancelSharp';
import DownloadIcon from '@mui/icons-material/Download';
import UploadIcon from '@mui/icons-material/Upload';
import LaunchIcon from '@mui/icons-material/Launch';
import axios from 'axios';
import { VariantType } from 'notistack';
import NBDialog from './NBDialog';
Expand Down Expand Up @@ -72,14 +73,21 @@ const RepoCard = memo(
<div className="grid grid-cols-4 items-center justify-items-center">
<div>
<Typography variant="h5">
<Button className="text-xl" href={`${ORGURL}${repoName}`} target="_blank">
<Button
className="text-xl"
href={`${ORGURL}${repoName}`}
target="_blank"
sx={{ textTransform: 'none' }}
endIcon={<LaunchIcon />}
>
{repoName}
</Button>
</Typography>
<Button
data-cy={`upload-${repoName}-button`}
endIcon={<UploadIcon />}
onClick={() => setUploadDialog(true)}
sx={{ textTransform: 'none' }}
>
Upload
</Button>
Expand All @@ -90,11 +98,15 @@ const RepoCard = memo(
<Button
href={`${ORGURL}${repoName}/tree/master/participants.tsv`}
target="_blank"
sx={{ textTransform: 'none' }}
endIcon={<LaunchIcon />}
>
Participants.tsv
participants.tsv
</Button>
) : (
<Button disabled>Participants.tsv</Button>
<Button disabled sx={{ textTransform: 'none' }}>

Check warning on line 107 in src/components/RepoCard.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/RepoCard.tsx#L107

Added line #L107 was not covered by tests
participants.tsv
</Button>
)}
</Typography>
{tsvExists ? (
Expand All @@ -119,11 +131,15 @@ const RepoCard = memo(
<Button
href={`${ORGURL}${repoName}/tree/master/participants.json`}
target="_blank"
sx={{ textTransform: 'none' }}
endIcon={<LaunchIcon />}
>
Participants.json
participants.json
</Button>
) : (
<Button disabled>Participants.json</Button>
<Button disabled sx={{ textTransform: 'none' }}>

Check warning on line 140 in src/components/RepoCard.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/RepoCard.tsx#L140

Added line #L140 was not covered by tests
participants.json
</Button>
)}
</Typography>
{jsonExists ? (
Expand All @@ -148,11 +164,15 @@ const RepoCard = memo(
<Button
href={`https://github.com/neurobagel/openneuro-annotations/tree/main/${repoName}.jsonld`}
target="_blank"
sx={{ textTransform: 'none' }}
endIcon={<LaunchIcon />}
>
Annotated
annotated
</Button>
) : (
<Button disabled>Annotated</Button>
<Button disabled sx={{ textTransform: 'none' }}>

Check warning on line 173 in src/components/RepoCard.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/RepoCard.tsx#L173

Added line #L173 was not covered by tests
annotated
</Button>
)}
</Typography>
{annotated ? (
Expand Down

0 comments on commit c657f76

Please sign in to comment.