Skip to content

Commit

Permalink
Category Column Alias
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka committed Mar 18, 2024
1 parent 50d055c commit 28bf9fc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/DataTable/TemplateTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@ import { useEffect, useState } from "react";
import { RowsIcon } from "lucide-react";
import { useSetIsShosen } from "../store/store";

const category = [
{
value: "P-CHEM",
text: "Physico-chemical characterisation",
},
{
value: "ECOTOX",
text: "Ecotoxicity studies",
},
{
value: "ENV FATE",
text: "Environmental fate",
},
{
value: "TOX",
text: "Toxicity studies",
},
{
value: "EXPOSURE",
text: "Exposure",
},
];

const columns = [
{
accessorKey: "template_name",
Expand All @@ -36,7 +59,16 @@ const columns = [
{
accessorKey: "PROTOCOL_CATEGORY_CODE",
header: "Category",
cell: (props) => <>{props.getValue()}</>,
cell: (props) => {
if (props.getValue() === "ENM_0000068_SECTION") {
return <>Environmental fate</>;
}
if (props.getValue() === "EC_BACTOX_SECTION") {
return <>Ecotoxicity studies</>;
} else {
return <>{props.getValue()}</>;
}
},
},
{
accessorKey: "timestamp",
Expand Down
2 changes: 2 additions & 0 deletions src/SurveyComp/SurveyComp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function SurveyComponent({ setResult }) {
survey.data = data;
}

console.log(survey.data.PROTOCOL_TOP_CATEGORY);

useEffect(() => {
getTemplateInfo();
}, [getTemplateInfo, id]);
Expand Down

0 comments on commit 28bf9fc

Please sign in to comment.