Skip to content

Commit 75ca5d5

Browse files
Hari KiranHari Kiran
authored andcommitted
Reset deps to reproduce audit error
1 parent e0b7959 commit 75ca5d5

File tree

2 files changed

+378
-377
lines changed

2 files changed

+378
-377
lines changed

src/pages/DatasetDetailPage.tsx

Lines changed: 159 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -570,167 +570,166 @@ const DatasetDetailPage: React.FC = () => {
570570

571571
{/* ✅ Data panels (right panel) */}
572572
<Box sx={{ flex: 2, display: "flex", flexDirection: "column", gap: 2 }}>
573-
<Box sx={{ backgroundColor: "#cdddf6", padding: 2, borderRadius: "8px", marginTop: 4 }}>
574-
{/* ✅ Collapsible header */}
575-
<Box
576-
sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", cursor: "pointer" }}
577-
onClick={() => setIsInternalExpanded(!isInternalExpanded)}
578-
>
579-
<Typography variant="h6" sx={{ fontWeight: "bold" }}>
580-
Internal Data ({internalLinks.length} objects)
581-
</Typography>
582-
{isInternalExpanded ? <ExpandLess /> : <ExpandMore />}
583-
</Box>
573+
<Box sx={{ backgroundColor: "#cdddf6", padding: 2, borderRadius: "8px", marginTop: 4 }}>
574+
{/* ✅ Collapsible header */}
575+
<Box
576+
sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", cursor: "pointer" }}
577+
onClick={() => setIsInternalExpanded(!isInternalExpanded)}
578+
>
579+
<Typography variant="h6" sx={{ fontWeight: "bold" }}>
580+
Internal Data ({internalLinks.length} objects)
581+
</Typography>
582+
{isInternalExpanded ? <ExpandLess /> : <ExpandMore />}
583+
</Box>
584584

585-
<Collapse in={isInternalExpanded}>
586-
{/* ✅ Scrollable area */}
587-
<Box
588-
sx={{
589-
maxHeight: "400px",
590-
overflowY: "auto",
591-
marginTop: 2,
592-
paddingRight: 1,
593-
"&::-webkit-scrollbar": {
594-
width: "6px",
595-
},
596-
"&::-webkit-scrollbar-thumb": {
597-
backgroundColor: "#aaa",
598-
borderRadius: "4px",
599-
},
600-
}}
601-
>
602-
{internalLinks.length > 0 ? (
603-
internalLinks.map((link, index) => (
604-
<Box
605-
key={index}
606-
sx={{
607-
mt: 1,
608-
p: 1.5,
609-
bgcolor: "white",
610-
borderRadius: 1,
611-
display: "flex",
612-
justifyContent: "space-between",
613-
alignItems: "center",
614-
flexWrap: "wrap",
615-
gap: 2,
616-
border: "1px solid #bbb",
617-
}}
618-
>
619-
<Typography sx={{ flexGrow: 1 }}>
620-
{link.name} {link.arraySize ? `[${link.arraySize.join("x")}]` : ""}
621-
</Typography>
622-
<Button
623-
variant="contained"
624-
size="small"
625-
sx={{ backgroundColor: "#1976d2" }}
626-
onClick={() => handlePreview(link.data, link.index, true)}
627-
>
628-
Preview
629-
</Button>
630-
</Box>
631-
))
632-
) : (
633-
<Typography sx={{ fontStyle: "italic", mt: 1 }}>No internal data found.</Typography>
634-
)}
635-
</Box>
636-
</Collapse>
637-
</Box>
638-
<Box sx={{ backgroundColor: "#eaeaea", padding: 2, borderRadius: "8px", marginTop: 4 }}>
639-
{/* ✅ Header with toggle */}
640-
<Box
641-
sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", cursor: "pointer" }}
642-
onClick={() => setIsExternalExpanded(!isExternalExpanded)}
643-
>
644-
<Typography variant="h6" sx={{ fontWeight: "bold" }}>
645-
External Data ({externalLinks.length} links)
646-
</Typography>
647-
{isExternalExpanded ? <ExpandLess /> : <ExpandMore />}
648-
</Box>
585+
<Collapse in={isInternalExpanded}>
586+
{/* ✅ Scrollable area */}
587+
<Box
588+
sx={{
589+
maxHeight: "400px",
590+
overflowY: "auto",
591+
marginTop: 2,
592+
paddingRight: 1,
593+
"&::-webkit-scrollbar": {
594+
width: "6px",
595+
},
596+
"&::-webkit-scrollbar-thumb": {
597+
backgroundColor: "#aaa",
598+
borderRadius: "4px",
599+
},
600+
}}
601+
>
602+
{internalLinks.length > 0 ? (
603+
internalLinks.map((link, index) => (
604+
<Box
605+
key={index}
606+
sx={{
607+
mt: 1,
608+
p: 1.5,
609+
bgcolor: "white",
610+
borderRadius: 1,
611+
display: "flex",
612+
justifyContent: "space-between",
613+
alignItems: "center",
614+
flexWrap: "wrap",
615+
gap: 2,
616+
border: "1px solid #bbb",
617+
}}
618+
>
619+
<Typography sx={{ flexGrow: 1 }}>
620+
{link.name} {link.arraySize ? `[${link.arraySize.join("x")}]` : ""}
621+
</Typography>
622+
<Button
623+
variant="contained"
624+
size="small"
625+
sx={{ backgroundColor: "#1976d2" }}
626+
onClick={() => handlePreview(link.data, link.index, true)}
627+
>
628+
Preview
629+
</Button>
630+
</Box>
631+
))
632+
) : (
633+
<Typography sx={{ fontStyle: "italic", mt: 1 }}>No internal data found.</Typography>
634+
)}
635+
</Box>
636+
</Collapse>
637+
</Box>
638+
<Box sx={{ backgroundColor: "#eaeaea", padding: 2, borderRadius: "8px", marginTop: 4 }}>
639+
{/* ✅ Header with toggle */}
640+
<Box
641+
sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", cursor: "pointer" }}
642+
onClick={() => setIsExternalExpanded(!isExternalExpanded)}
643+
>
644+
<Typography variant="h6" sx={{ fontWeight: "bold" }}>
645+
External Data ({externalLinks.length} links)
646+
</Typography>
647+
{isExternalExpanded ? <ExpandLess /> : <ExpandMore />}
648+
</Box>
649649

650-
<Collapse in={isExternalExpanded}>
651-
{/* ✅ Scrollable card container */}
652-
<Box
653-
sx={{
654-
maxHeight: "400px",
655-
overflowY: "auto",
656-
marginTop: 2,
657-
paddingRight: 1,
658-
"&::-webkit-scrollbar": {
659-
width: "6px",
660-
},
661-
"&::-webkit-scrollbar-thumb": {
662-
backgroundColor: "#ccc",
663-
borderRadius: "4px",
664-
},
665-
}}
666-
>
667-
{externalLinks.length > 0 ? (
668-
externalLinks.map((link, index) => (
669-
<Box
670-
key={index}
671-
sx={{
672-
mt: 1,
673-
p: 1.5,
674-
bgcolor: "white",
675-
borderRadius: 1,
676-
display: "flex",
677-
justifyContent: "space-between",
678-
alignItems: "center",
679-
flexWrap: "wrap",
680-
gap: 2,
681-
border: "1px solid #ddd",
682-
}}
683-
>
684-
<Typography sx={{ flexGrow: 1 }}>{link.name}</Typography>
685-
<Box sx={{ display: "flex", gap: 1 }}>
686-
<Button
687-
variant="contained"
688-
size="small"
689-
sx={{ backgroundColor: "#1976d2" }}
690-
onClick={() => window.open(link.url, "_blank")}
691-
>
692-
Download
693-
</Button>
694-
<Button
695-
variant="outlined"
696-
size="small"
697-
onClick={() => handlePreview(link.url, link.index, false)}
698-
>
699-
Preview
700-
</Button>
701-
</Box>
702-
</Box>
703-
))
704-
) : (
705-
<Typography sx={{ fontStyle: "italic", mt: 1 }}>No external links found.</Typography>
706-
)}
707-
</Box>
708-
</Collapse>
709-
</Box>
710-
</Box>
711-
</Box>
712-
{/* ✅ ADD FLASHCARDS COMPONENT HERE ✅ */}
713-
714-
<div id="chartpanel"></div>
715-
716-
<DatasetFlashcards
717-
pagename={docId ?? ""}
718-
docname={datasetDocument?.Name || ""}
719-
dbname={dbName || ""}
720-
serverUrl={"https://neurojson.io:7777/"}
721-
datasetDocument={datasetDocument}
722-
onekey={"dataset_description.json"}
723-
/>
724-
{/* Preview Modal Component - Add Here */}
725-
<PreviewModal
726-
isOpen={previewOpen}
727-
dataKey={previewDataKey}
728-
isInternal={previewIsInternal}
729-
onClose={handleClosePreview}
730-
/>
731-
{/* <div id="chartpanel" style={{ display: "none" }}></div> */}
732-
</Box>
733-
);
734-
};
650+
<Collapse in={isExternalExpanded}>
651+
{/* ✅ Scrollable card container */}
652+
<Box
653+
sx={{
654+
maxHeight: "400px",
655+
overflowY: "auto",
656+
marginTop: 2,
657+
paddingRight: 1,
658+
"&::-webkit-scrollbar": {
659+
width: "6px",
660+
},
661+
"&::-webkit-scrollbar-thumb": {
662+
backgroundColor: "#ccc",
663+
borderRadius: "4px",
664+
},
665+
}}
666+
>
667+
{externalLinks.length > 0 ? (
668+
externalLinks.map((link, index) => (
669+
<Box
670+
key={index}
671+
sx={{
672+
mt: 1,
673+
p: 1.5,
674+
bgcolor: "white",
675+
borderRadius: 1,
676+
display: "flex",
677+
justifyContent: "space-between",
678+
alignItems: "center",
679+
flexWrap: "wrap",
680+
gap: 2,
681+
border: "1px solid #ddd",
682+
}}
683+
>
684+
<Typography sx={{ flexGrow: 1 }}>{link.name}</Typography>
685+
<Box sx={{ display: "flex", gap: 1 }}>
686+
<Button
687+
variant="contained"
688+
size="small"
689+
sx={{ backgroundColor: "#1976d2" }}
690+
onClick={() => window.open(link.url, "_blank")}
691+
>
692+
Download
693+
</Button>
694+
<Button
695+
variant="outlined"
696+
size="small"
697+
onClick={() => handlePreview(link.url, link.index, false)}
698+
>
699+
Preview
700+
</Button>
701+
</Box>
702+
</Box>
703+
))
704+
) : (
705+
<Typography sx={{ fontStyle: "italic", mt: 1 }}>No external links found.</Typography>
706+
)}
707+
</Box>
708+
</Collapse>
709+
</Box>
710+
</Box>
711+
</Box>
712+
{/* ✅ ADD FLASHCARDS COMPONENT HERE ✅ */}
713+
714+
<div id="chartpanel"></div>
715+
716+
<DatasetFlashcards
717+
pagename={docId ?? ""}
718+
docname={datasetDocument?.Name || ""}
719+
dbname={dbName || ""}
720+
serverUrl={"https://neurojson.io:7777/"}
721+
datasetDocument={datasetDocument}
722+
onekey={"dataset_description.json"}
723+
/>
724+
{/* Preview Modal Component - Add Here */}
725+
<PreviewModal
726+
isOpen={previewOpen}
727+
dataKey={previewDataKey}
728+
isInternal={previewIsInternal}
729+
onClose={handleClosePreview}
730+
/>
731+
{/* <div id="chartpanel" style={{ display: "none" }}></div> */}
732+
</Box>
733+
)};
735734

736735
export default DatasetDetailPage;

0 commit comments

Comments
 (0)