Skip to content

Commit

Permalink
Merge pull request #388 from CBIIT/CRDCDH-1084
Browse files Browse the repository at this point in the history
CRDCDH-1084 Prevent Submission click when in 'Deleted' status
  • Loading branch information
Alejandro-Vega authored Jun 7, 2024
2 parents 870a77b + fcf884f commit 0cbc882
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/content/dataSubmissions/DataSubmissionsListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
FormControl,
Select,
MenuItem,
Box,
} from "@mui/material";
import { useSnackbar } from "notistack";
import { useQuery } from "@apollo/client";
Expand Down Expand Up @@ -145,10 +146,19 @@ const baseTextFieldStyles = {

const StyledSelect = styled(Select)(baseTextFieldStyles);

const StyledDeletedText = styled(Box)(({ theme }) => ({
color: theme.palette.text.disabled,
}));

const columns: Column[] = [
{
label: "Submission Name",
value: (a) => <Link to={`/data-submission/${a._id}/data-activity`}>{a.name}</Link>,
value: (a) =>
a.status === "Deleted" ? (
<StyledDeletedText>{a.name}</StyledDeletedText>
) : (
<Link to={`/data-submission/${a._id}/data-activity`}>{a.name}</Link>
),
field: "name",
},
{
Expand Down Expand Up @@ -220,6 +230,7 @@ const statusValues: string[] = [
"Completed",
"Archived",
"Canceled",
"Deleted",
];
const statusOptionArray: SelectOption[] = statusValues.map((v) => ({
label: v,
Expand Down
3 changes: 2 additions & 1 deletion src/types/Submissions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ type SubmissionStatus =
| "Rejected"
| "Completed"
| "Archived"
| "Canceled";
| "Canceled"
| "Deleted";

type SubmissionAction =
| "Submit"
Expand Down

0 comments on commit 0cbc882

Please sign in to comment.