Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
AccordionIcon,
AccordionPanel,
} from "@chakra-ui/react";
import { useEffect, useState } from "react";
import { MdRule } from "react-icons/md";
import { LuFileSearch, LuFileCheck2 } from "react-icons/lu";

Expand Down Expand Up @@ -50,7 +51,7 @@ const AccordionComponent = () => {
},
{
path: `/review/planning/protocol/picoc/${id}`,
label: "PICOC"
label: "PICOC",
},
{
path: `/review/planning/protocol/research-questions/${id}`,
Expand Down Expand Up @@ -99,10 +100,25 @@ const AccordionComponent = () => {
],
};

const sectionToIndex: Record<string, number> = {
Planning: 0,
Execution: 1,
Summarization: 2,
};

const [localIndex, setLocalIndex] = useState<number | number[]>(
sectionToIndex[activeSection as string] ?? -1,
);

useEffect(() => {
const newIndex = sectionToIndex[activeSection as string] ?? -1;
setLocalIndex(newIndex);
}, [activeSection]);

return (
<Accordion w="80%" allowToggle>
<Accordion w="80%" allowToggle index={localIndex} onChange={(expandedIndex) => setLocalIndex(expandedIndex)}>
{Object.entries(sections).map(([section, children]) => (
<AccordionItem key={section}>
<AccordionItem key={section} border="none">
<h2>
<AccordionButton
p=".5rem"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ export default function InformationSourcesAndSearchStrategy() {

return (
<ProtocolFormLayout
headerText="Protocol: Information Sources And Search Strategy"
headerText="Protocol: Information Sources and Search Strategy"
navButtons={
<>
<NavButton
event={() =>
syncAndNavigate(
`/review/planning/protocol/eligibility-criteria/${id}`
`/review/planning/protocol/eligibility-criteria/${id}`,
)
}
text="Back"
/>
<NavButton
event={() =>
syncAndNavigate(
`/review/planning/protocol/selection-and-extraction/${id}`
`/review/planning/protocol/selection-and-extraction/${id}`,
)
}
text="Next"
Expand All @@ -50,7 +50,7 @@ export default function InformationSourcesAndSearchStrategy() {
onChange={(event) => {
handleChangeInformationSourcesAndSearchStrategy(
"sourcesSelectionCriteria",
event.target.value
event.target.value,
);
}}
label="Sources Selection Criteria"
Expand All @@ -59,25 +59,33 @@ export default function InformationSourcesAndSearchStrategy() {
<AddSelectionTable
label="Databases and Information Source"
options={[
"Google Scholar",
"Scopus",
"Scielo",
"ACM Digital Library",
"Backward Snowballing",
"BDTD",
"PubMed",
"Cochrane Library",
"Expert Suggestion",
"Backward Snowballing",
"Forward Snowballing",
"Google Scholar",
"Grey Literature Sources",
"IEEE Xplore",
"LILACS",
"MEDLINE",
"PubMed",
"SciELO",
"ScienceDirect",
"Scopus",
"SpringerLink",
"Web of Science",
]}
placeholder={"Select Data Base"}
placeholder={"Select Database"}
typeField="select"
/>
<TextAreaInput
value={searchMethod}
onChange={(event) => {
handleChangeInformationSourcesAndSearchStrategy(
"searchMethod",
event.target.value
event.target.value,
);
}}
label="Search Strategy"
Expand All @@ -93,7 +101,7 @@ export default function InformationSourcesAndSearchStrategy() {
onChange={(event) => {
handleChangeInformationSourcesAndSearchStrategy(
"searchString",
event.target.value
event.target.value,
);
}}
label="Search String"
Expand Down