1- import { useContext , useEffect , useState } from "react "
1+ import { Button } from "primereact/button "
22import { Card } from "primereact/card"
33import { Dropdown } from "primereact/dropdown"
4- import { Button } from "primereact/button "
4+ import { useContext , useEffect , useState } from "react "
55import { Stack } from "react-bootstrap"
6+ import MEDprofilesPrepareData from "../input/MEDprofiles/MEDprofilesPrepareData"
7+ import { getCollectionSize } from "../mongoDB/mongoDBUtils"
68import { DataContext } from "../workspace/dataContext"
7-
8- // import tools
9+ import ModuleLandingShell , { ModuleGuideText } from "../mainPages/moduleBasics/ModuleLandingShell"
910import BasicToolsDB from "./inputToolsDB/basicToolsDB"
11+ import ConvertCategoricalColumnIntoNumericDB from "./inputToolsDB/convertCategoricalColumnIntoNumericDB"
12+ import DropColumnsAndTagsToolsDB from "./inputToolsDB/dropColumnsToolsDB"
1013import DropDuplicatesToolsDB from "./inputToolsDB/dropDuplicatesToolsDB"
1114import FeatureReductionToolsDB from "./inputToolsDB/featureReductionToolsDB/featureReductionToolsDB"
12- import ConvertCategoricalColumnIntoNumericDB from "./inputToolsDB/convertCategoricalColumnIntoNumericDB"
1315import GroupingTaggingToolsDB from "./inputToolsDB/groupingTaggingToolsDB"
1416import HoldoutSetCreationToolsDB from "./inputToolsDB/holdoutSetCreationToolsDB"
1517import MergeToolsDB from "./inputToolsDB/mergeToolsDB"
16- import DropColumnsAndTagsToolsDB from "./inputToolsDB/dropColumnsToolsDB"
1718import NormalizationToolsDB from "./inputToolsDB/normalizationToolsDB"
1819import SimpleCleaningToolsDB from "./inputToolsDB/simpleCleaningToolsDB"
1920import SubsetCreationToolsDB from "./inputToolsDB/subsetCreationToolsDB"
2021import TransformColumnToolsDB from "./inputToolsDB/transformColumnToolsDB"
21- import MEDprofilesPrepareData from "../input/MEDprofiles/MEDprofilesPrepareData"
22- import { getCollectionSize } from "../mongoDB/mongoDBUtils"
2322
2423const SectionContainer = ( { title, children } ) => (
2524 < div className = "mb-3" >
26- < h6
27- style = { {
28- padding : "0.6rem 0.8rem" ,
29- borderBottom : "1px solid #ddd" ,
30- fontWeight : 600 ,
31- borderRadius : "6px 6px 0 0" ,
32- } }
33- >
34- { title }
35- </ h6 >
25+ < h6 className = "module-landing-input-section-title" > { title } </ h6 >
3626 < Stack direction = "vertical" gap = { 1 } style = { { marginTop : "0.5rem" } } >
3727 { children }
3828 </ Stack >
@@ -135,7 +125,7 @@ const InputToolsComponent = ({ exportOptions }) => {
135125 if ( ! activeTool ) return null
136126 const ToolComponent = activeTool . component
137127 return (
138- < div style = { { marginTop : "20px " } } >
128+ < div style = { { marginTop : "12px " } } >
139129 < Button label = "← Back to tools" className = "p-button-text mb-3" onClick = { ( ) => setActiveTool ( null ) } />
140130 < h3 > { activeTool . label } </ h3 >
141131 < ToolComponent exportOptions = { exportOptions } currentCollection = { collectionId } collectionSize = { collectionSize } />
@@ -144,119 +134,101 @@ const InputToolsComponent = ({ exportOptions }) => {
144134 }
145135
146136 return (
147- < div style = { { display : "flex" , height : "100%" , overflow : "hidden" } } >
148- { /* Sidebar */ }
149- < aside style = { { width : "280px" , borderRight : "1px solid #ddd" , padding : "1rem" , overflowY : "auto" } } >
150- < h3 style = { { textAlign : "center" , marginBottom : "1rem" } } > Input Sections</ h3 >
151-
152- { Object . entries ( SECTIONS ) . map ( ( [ key , section ] ) => (
153- < SectionContainer key = { key } title = { section . label } >
154- { section . subsections . map ( ( sub ) => (
155- < div
156- key = { sub . key }
157- onClick = { ( ) => {
158- setActiveSection ( sub . key )
159- setActiveTool ( null )
160- } }
161- style = { {
162- cursor : "pointer" ,
163- padding : "8px 10px" ,
164- marginBottom : "6px" ,
165- borderRadius : "8px" ,
166- display : "flex" ,
167- alignItems : "center" ,
168- justifyContent : "space-between" ,
169- ...( activeSection === sub . key ? { backgroundColor : "#569fff" } : { } ) ,
170- border : "1px solid #ddd" ,
171- transition : "all 0.2s ease-in-out" ,
172- } }
173- >
174- < span > { sub . label } </ span >
175- < i className = "pi pi-angle-right" style = { { fontSize : "1.1rem" , color : "#a3a3a3" } } > </ i >
176- </ div >
177- ) ) }
178- </ SectionContainer >
179- ) ) }
180- </ aside >
137+ < ModuleLandingShell
138+ title = "Input Module"
139+ description = "Preprocess and prepare tabular data for analysis and modeling."
140+ contentMaxWidth = "1100px"
141+ alignTop
142+ infoContent = {
143+ < ModuleGuideText >
144+ < p className = "mb-0" >
145+ This module consolidates all the tools necessary for preprocessing tabular data — from import and merge
146+ through cleaning, transformation, sampling, and feature reduction.
147+ </ p >
148+ </ ModuleGuideText >
149+ }
150+ documentation = { {
151+ url : "https://medomicslab.gitbook.io/medomics-docs/tutorials/design/input-module" ,
152+ label : "Input Module documentation" ,
153+ } }
154+ >
155+ < div className = "module-landing-input-layout" >
156+ < aside className = "module-landing-input-sidebar" >
157+ < h5 className = "module-landing-input-sidebar-title" > Input Sections</ h5 >
181158
182- { /* Main Content */ }
183- < main style = { { flex : 1 , padding : "1.5rem" , overflowY : "auto" } } >
184- < div style = { { textAlign : "center" , marginBottom : "20px" } } >
185- < h2 > Database Input Module</ h2 >
186- < Card title = "Select CSV File" style = { { marginBottom : "20px" } } >
187- < Dropdown
188- filter
189- style = { { maxWidth : "300px" } }
190- value = { selectedCSVFiles . find ( ( item ) => item . id === collectionId ) }
191- onChange = { ( e ) => setCollectionId ( e . value . id ) }
192- options = { selectedCSVFiles }
193- optionLabel = "name"
194- placeholder = "Select CSV file"
195- className = "w-full md:w-14rem"
196- />
197- </ Card >
198- </ div >
159+ { Object . entries ( SECTIONS ) . map ( ( [ key , section ] ) => (
160+ < SectionContainer key = { key } title = { section . label } >
161+ { section . subsections . map ( ( sub ) => (
162+ < div
163+ key = { sub . key }
164+ onClick = { ( ) => {
165+ setActiveSection ( sub . key )
166+ setActiveTool ( null )
167+ } }
168+ className = { `module-landing-input-nav-item ${ activeSection === sub . key ? "is-active" : "" } ` }
169+ >
170+ < span > { sub . label } </ span >
171+ < i className = "pi pi-angle-right" style = { { fontSize : "1rem" , color : "#a3a3a3" } } />
172+ </ div >
173+ ) ) }
174+ </ SectionContainer >
175+ ) ) }
176+ </ aside >
199177
200- { ! collectionId ? (
201- < p style = { { textAlign : "center" } } > Please select a dataset to continue.</ p >
202- ) : (
203- < >
204- { /* only showcase the active tool */ }
205- { activeTool ? (
206- renderActiveTool ( )
207- ) : (
208- Object . values ( SECTIONS )
209- . flatMap ( ( s ) => s . subsections )
210- . filter ( ( sub ) => sub . key === activeSection )
211- . map ( ( sub ) => (
212- < div key = { sub . key } >
213- < h3 > { sub . label } </ h3 >
214- < p style = { { color : "#a3a3a3" , marginBottom : "1.5rem" } } >
215- { sub . description || "Explore and apply tools for this data preparation stage." }
216- </ p >
178+ < main className = "module-landing-input-main" >
179+ < Card title = "Select CSV File" style = { { marginBottom : "16px" } } >
180+ < Dropdown
181+ filter
182+ style = { { maxWidth : "300px" } }
183+ value = { selectedCSVFiles . find ( ( item ) => item . id === collectionId ) }
184+ onChange = { ( e ) => setCollectionId ( e . value . id ) }
185+ options = { selectedCSVFiles }
186+ optionLabel = "name"
187+ placeholder = "Select CSV file"
188+ className = "w-full md:w-14rem"
189+ />
190+ </ Card >
217191
218- < div className = "grid grid-cols-2 gap-4" >
219- { sub . tools . map ( ( tool , i ) => (
220- < div
221- key = { i }
222- onClick = { ( ) => setActiveTool ( tool ) }
223- style = { {
224- border : "1px solid #d1d5db" ,
225- borderRadius : "10px" ,
226- padding : "0.8rem 1rem" ,
227- cursor : "pointer" ,
228- transition : "all 0.2s ease-in-out" ,
229- display : "flex" ,
230- justifyContent : "space-between" ,
231- alignItems : "center" ,
232- } }
233- onMouseEnter = { ( e ) => {
234- e . currentTarget . style . backgroundColor = "#569fff"
235- e . currentTarget . style . transform = "scale(1.01)"
236- } }
237- onMouseLeave = { ( e ) => {
238- e . currentTarget . style . backgroundColor = "transparent"
239- e . currentTarget . style . transform = "scale(1)"
240- } }
241- >
242- < div >
243- < h4 style = { { margin : 0 , fontSize : "1rem" } } > { tool . label } </ h4 >
244- < p style = { { margin : "0.3rem 0 0 0" , fontSize : "0.9rem" , color : "#a3a3a3" } } >
245- { tool . description }
192+ { ! collectionId ? (
193+ < p style = { { textAlign : "center" , color : "var(--ml-text-muted)" } } > Please select a dataset to continue.</ p >
194+ ) : (
195+ < >
196+ { activeTool ? (
197+ renderActiveTool ( )
198+ ) : (
199+ Object . values ( SECTIONS )
200+ . flatMap ( ( s ) => s . subsections )
201+ . filter ( ( sub ) => sub . key === activeSection )
202+ . map ( ( sub ) => (
203+ < div key = { sub . key } >
204+ < h3 > { sub . label } </ h3 >
205+ < p style = { { color : "var(--ml-text-muted)" , marginBottom : "1rem" , fontSize : "0.86rem" } } >
206+ { sub . description || "Explore and apply tools for this data preparation stage." }
246207 </ p >
247- </ div >
248- < i className = "pi pi-angle-right" style = { { fontSize : "1.4rem" , color : "#4338ca" } } > </ i >
249- </ div >
250- ) ) }
251- </ div >
252- </ div >
253- ) )
254- ) }
255- </ >
256- ) }
257- </ main >
258208
259- </ div >
209+ < div className = "module-landing-tool-grid" >
210+ { sub . tools . map ( ( tool , i ) => (
211+ < div
212+ key = { i }
213+ onClick = { ( ) => setActiveTool ( tool ) }
214+ className = "module-landing-input-tool-tile"
215+ >
216+ < div >
217+ < h4 > { tool . label } </ h4 >
218+ < p > { tool . description } </ p >
219+ </ div >
220+ < i className = "pi pi-angle-right" style = { { fontSize : "1.2rem" , color : "var(--ml-accent)" } } />
221+ </ div >
222+ ) ) }
223+ </ div >
224+ </ div >
225+ ) )
226+ ) }
227+ </ >
228+ ) }
229+ </ main >
230+ </ div >
231+ </ ModuleLandingShell >
260232 )
261233}
262234
0 commit comments