diff --git a/xas-standards-client/src/components/ReviewTab.tsx b/xas-standards-client/src/components/ReviewTab.tsx
index 1da2a5b..459ce40 100644
--- a/xas-standards-client/src/components/ReviewTab.tsx
+++ b/xas-standards-client/src/components/ReviewTab.tsx
@@ -1,5 +1,4 @@
-
-import { Tab, Tabs, Box} from "@mui/material";
+import { Tab, Tabs, Box } from "@mui/material";
import StandardMetadataCard from "./StandardMetadataCard";
import ReviewTextView from "./ReviewTextView";
@@ -7,60 +6,66 @@ import ReviewTextView from "./ReviewTextView";
import { useState } from "react";
import ReviewCard from "./ReviewCard";
+import { AdminXASStandard } from "../models";
+
interface TabPanelProps {
- children?: React.ReactNode;
- index: number;
- value: number;
- }
-
- function CustomTabPanel(props: TabPanelProps) {
- const { children, value, index, ...other } = props;
-
- return (
-
- {value === index && {children}}
-
- );
- }
-
- function a11yProps(index: number) {
- return {
- id: `simple-tab-${index}`,
- 'aria-controls': `simple-tabpanel-${index}`,
- };
- }
+ children?: React.ReactNode;
+ index: number;
+ value: number;
+}
+
+function CustomTabPanel(props: TabPanelProps) {
+ const { children, value, index, ...other } = props;
+
+ return (
+
+ {value === index && {children}}
+
+ );
+}
+
+function a11yProps(index: number) {
+ return {
+ id: `simple-tab-${index}`,
+ "aria-controls": `simple-tabpanel-${index}`,
+ };
+}
-export default function ReviewTab(props: { standard: XASStandard }) {
- const [value, setValue] = useState(0);
+export default function ReviewTab(props: { standard: AdminXASStandard }) {
+ const [value, setValue] = useState(0);
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
setValue(newValue);
};
return (
-
-
-
+
+
+
-
+
-
+
-
+
);
-}
\ No newline at end of file
+}
diff --git a/xas-standards-client/src/components/ReviewTable.tsx b/xas-standards-client/src/components/ReviewTable.tsx
index 775ba3d..2c000fb 100644
--- a/xas-standards-client/src/components/ReviewTable.tsx
+++ b/xas-standards-client/src/components/ReviewTable.tsx
@@ -1,6 +1,4 @@
import StandardsTableView from "./StandardsTableView"
-import StandardMetadataCard from "./StandardMetadataCard";
-import ReviewCard from "./ReviewCard";
import { Stack } from "@mui/material";
@@ -18,8 +16,8 @@ const nResults = 7;
export default function ReviewTable(props : {
standards: AdminXASStandard[];
- setStandards: React.Dispatch;
- updatePlot: React.Dispatch;
+ setStandards: (standards : XASStandard[]) => void;
+ updatePlot: (id : number) => void;
}) {
const [selectedStandard, setSelectedStandard] = useState();
diff --git a/xas-standards-client/src/components/StandardViewer.tsx b/xas-standards-client/src/components/StandardViewer.tsx
index 52f2523..888867f 100644
--- a/xas-standards-client/src/components/StandardViewer.tsx
+++ b/xas-standards-client/src/components/StandardViewer.tsx
@@ -22,7 +22,7 @@ function StandardViewer() {
const { elements } = useContext(MetadataContext);
- function getData(setXASData: React.Dispatch) {
+ function getData() {
return (id: number) => {
axios.get(data_url + "/" + id).then((response) => {
const output: XASData = response.data as XASData;
@@ -40,7 +40,7 @@ function StandardViewer() {
};
}
- const onClick = getData(setXASData);
+ const onClick = getData();
return (
diff --git a/xas-standards-client/src/components/StandardsChart.tsx b/xas-standards-client/src/components/StandardsChart.tsx
index bc7cd02..8008f34 100644
--- a/xas-standards-client/src/components/StandardsChart.tsx
+++ b/xas-standards-client/src/components/StandardsChart.tsx
@@ -35,9 +35,9 @@ function XASChart(props: {
showTrans: boolean;
showFluor: boolean;
showRef: boolean;
- setShowTrans: React.Dispatch>;
- setShowFluor: React.Dispatch>;
- setShowRef: React.Dispatch>;
+ setShowTrans: (show: boolean) => void;
+ setShowFluor: (show: boolean) => void;
+ setShowRef: (show: boolean) => void;
contains: boolean[];
}) {
const curveOptions: CurveType[] = Object.values(
diff --git a/xas-standards-client/src/components/StandardsTable.tsx b/xas-standards-client/src/components/StandardsTable.tsx
index 0cd7f15..4fdcc09 100644
--- a/xas-standards-client/src/components/StandardsTable.tsx
+++ b/xas-standards-client/src/components/StandardsTable.tsx
@@ -17,8 +17,8 @@ const nResults = 7;
function StandardsTable(props: {
standards: XASStandard[];
elements: Element[];
- setStandards: React.Dispatch;
- updatePlot: React.Dispatch;
+ setStandards: (standards : XASStandard[]) => void;
+ updatePlot: (id: number) => void;
}): JSX.Element {
const [selectedStandard, setSelectedStandard] = useState();
const [selectedElement, setSelectedElement] = useState(0);
diff --git a/xas-standards-client/src/components/StandardsTableView.tsx b/xas-standards-client/src/components/StandardsTableView.tsx
index 1c5e608..64eb1a9 100644
--- a/xas-standards-client/src/components/StandardsTableView.tsx
+++ b/xas-standards-client/src/components/StandardsTableView.tsx
@@ -6,7 +6,7 @@ import { tableCellClasses } from "@mui/material/TableCell";
import { styled } from "@mui/material/styles";
import { useState } from "react";
-import { XASStandard } from "../models";
+import { XASStandard, AdminXASStandard } from "../models";
const nResults = 7;
@@ -32,14 +32,10 @@ const StyledTableCell = styled(TableCell)(({ theme }) => ({
},
}));
-
-
-
-
function StandardMetadata(props: {
key: number;
xasstandard: XASStandard | null;
- selected: XASStandard | undefined;
+ selected: AdminXASStandard | XASStandard | undefined;
updatePlot: React.Dispatch;
selectedRow: number;
setSelectedRow: React.Dispatch>;
@@ -79,19 +75,20 @@ function StandardMetadata(props: {
export default function StandardsTableView(props : {
standards : XASStandard[];
- updatePlot : React.Dispatch;
+ updatePlot : (id: number) => void;
selectedStandard: XASStandard | undefined;
- setSelectedStandard : React.Dispatch>;
- setCurrent: React.Dispatch>;
+ setSelectedStandard : (x: XASStandard | AdminXASStandard | undefined) => void;
+ setCurrent: (cursor : string | null) => void;
prevNext: string[] | null}) {
+
const [selectedRow, setSelectedRow] = useState(-1);
const nextPage = () => {
- props.setCurrent(props.prevNext[1]);
+ props.setCurrent(props.prevNext == null ? null : props.prevNext[1]);
};
const prevPage = () => {
- props.setCurrent(props.prevNext[0]);
+ props.setCurrent(props.prevNext == null ? null : props.prevNext[0]);
};
const clickStandard = (standard: XASStandard) => {
diff --git a/xas-standards-client/src/components/UserIcon.tsx b/xas-standards-client/src/components/UserIcon.tsx
index 859450f..6a3b336 100644
--- a/xas-standards-client/src/components/UserIcon.tsx
+++ b/xas-standards-client/src/components/UserIcon.tsx
@@ -3,8 +3,13 @@ import { SvgIcon } from "@mui/material"
export default function UserIcon() {
return (
-
-
-
+
+
)
}
\ No newline at end of file
diff --git a/xas-standards-client/src/components/submission/AdditionalInfoForm.tsx b/xas-standards-client/src/components/submission/AdditionalInfoForm.tsx
index dae8311..505da5c 100644
--- a/xas-standards-client/src/components/submission/AdditionalInfoForm.tsx
+++ b/xas-standards-client/src/components/submission/AdditionalInfoForm.tsx
@@ -1,13 +1,11 @@
-
-import { Grid, TextField, Button} from "@mui/material";
+import { Grid, TextField, Button } from "@mui/material";
import VisuallyHiddenInput from "./VisuallyHiddenInput";
-function AdditionalInformationForm(props : {
- comments : string;
- setComments: React.Dispatch>;
- handleFile2 : React.ChangeEventHandler;
-
+function AdditionalInformationForm(props: {
+ comments: string;
+ setComments: (comments: string) => void;
+ handleFile2: React.ChangeEventHandler;
}) {
const comments = props.comments;
const setComments = props.setComments;
@@ -18,7 +16,7 @@ function AdditionalInformationForm(props : {
-
-
+
);
diff --git a/xas-standards-client/src/components/submission/CitationForm.tsx b/xas-standards-client/src/components/submission/CitationForm.tsx
index 3f15060..fc243ac 100644
--- a/xas-standards-client/src/components/submission/CitationForm.tsx
+++ b/xas-standards-client/src/components/submission/CitationForm.tsx
@@ -6,11 +6,11 @@ import { Grid, TextField, Button, Typography } from "@mui/material";
const crossref_url = "https://api.crossref.org/works/";
const mailto = "?mailto=dataanalysis@diamond.ac.uk";
-function CitationForm(props : {
- citation : string;
- setCitation: React.Dispatch>;
+function CitationForm(props: {
+ citation: string;
+ setCitation: (citation: string) => void;
doi: string;
- setDOI: React.Dispatch>;
+ setDOI: (doi: string) => void;
}) {
const citation = props.citation;
const setCitation = props.setCitation;
@@ -60,13 +60,11 @@ function CitationForm(props : {
/>