-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#23 Left static sidebar #5
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ef69bbc
#23 Left static sidebar
Salam-Dalloul 2daed3e
#23 add headers
Salam-Dalloul 7573da0
#23 add Datasets items
Salam-Dalloul 06f659e
#23 add Neurons items
Salam-Dalloul 95aff1d
#23 add filters section + color picker
Salam-Dalloul 2188afd
#cele-25 Header UI
vidhya-metacell e123fd6
#CELE-25 Modal updates
vidhya-metacell bea9861
#cele-25 Modal fields update
vidhya-metacell e042665
fix conflict
Salam-Dalloul ea51ae6
use suspense for loading state
Salam-Dalloul 2d88d83
Modify GH action to build without frozen-lockfile
aranega 99a150f
Add missing lock-file
aranega d0d15e4
styles fixes
Salam-Dalloul 0d6220b
Merge remote-tracking branch 'origin/feature/CELE-23' into feature/CE…
Salam-Dalloul 1344c02
CELE-23 Fix compilation issues
aranega c787b3f
styles fixes
Salam-Dalloul d90eea5
add Suspense to Workspace rendering
Salam-Dalloul 59b9cda
#cele-25 Remove cross icon
vidhya-metacell c4f8cf9
#cele-25 Fix merge conflicts
vidhya-metacell 8bce19e
#cele-25 Header menu ui
vidhya-metacell 8549f1b
styles fixes + fix switch issue
Salam-Dalloul 1c72a8b
fix hover background color for bin icon
Salam-Dalloul 91cd354
#cele-25 Compare workspace dialog
vidhya-metacell 494c7b1
Merge pull request #7 from MetaCell/feature/CELE-25
ddelpiano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
#root { | ||
width: 100vw; | ||
height: 100vh; | ||
margin: 0 auto; | ||
|
||
} | ||
|
||
.layout-manager-container { | ||
display: flex; | ||
flex-direction: column; | ||
position: relative; | ||
width: 100%; | ||
height: 100%; | ||
height: 100vh; | ||
overflow: hidden; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,44 @@ | ||
import { Provider } from "react-redux"; | ||
import { ThemeProvider } from '@mui/material/styles'; | ||
import { ThemeProvider } from "@mui/material/styles"; | ||
import { Box, CssBaseline } from "@mui/material"; | ||
import '@metacell/geppetto-meta-ui/flex-layout/style/dark.scss'; | ||
import theme from './theme/index.tsx'; | ||
import './App.css' | ||
import "@metacell/geppetto-meta-ui/flex-layout/style/dark.scss"; | ||
import theme from "./theme/index.tsx"; | ||
import "./App.css"; | ||
import { useGlobalContext } from "./contexts/GlobalContext.tsx"; | ||
import AppLauncher from "./components/AppLauncher.tsx"; | ||
import Workspace from "./components/Workspace.tsx"; | ||
import { ViewMode } from "./models/models.ts"; | ||
|
||
function App() { | ||
const { | ||
workspaces, | ||
currentWorkspaceId, | ||
viewMode, | ||
selectedWorkspacesIds, | ||
} = useGlobalContext(); | ||
const { workspaces, currentWorkspaceId, viewMode, selectedWorkspacesIds } = | ||
useGlobalContext(); | ||
|
||
const hasLaunched = currentWorkspaceId != undefined; | ||
|
||
const hasLaunched = currentWorkspaceId != undefined | ||
|
||
return ( | ||
<> | ||
<ThemeProvider theme={theme}> | ||
<CssBaseline /> | ||
{hasLaunched ? ( | ||
<Box className={"layout-manager-container"}> | ||
{viewMode === ViewMode.Compare ? | ||
Array.from(selectedWorkspacesIds).map(id => ( | ||
<Provider key={id} store={workspaces[id].store}> | ||
<Workspace /> | ||
</Provider> | ||
)) | ||
: | ||
<Provider store={workspaces[currentWorkspaceId].store}> | ||
<Workspace /> | ||
</Provider> | ||
} | ||
|
||
</Box> | ||
|
||
) : <AppLauncher />} | ||
</ThemeProvider> | ||
</> | ||
) | ||
return ( | ||
<> | ||
<ThemeProvider theme={theme}> | ||
<CssBaseline /> | ||
{hasLaunched ? ( | ||
<Box className={"layout-manager-container"}> | ||
{viewMode === ViewMode.Compare ? ( | ||
Array.from(selectedWorkspacesIds).map((id) => ( | ||
<Provider key={id} store={workspaces[id].store}> | ||
<Workspace /> | ||
</Provider> | ||
)) | ||
) : ( | ||
<Provider store={workspaces[currentWorkspaceId].store}> | ||
<Workspace /> | ||
</Provider> | ||
)} | ||
</Box> | ||
) : ( | ||
<AppLauncher /> | ||
)} | ||
</ThemeProvider> | ||
</> | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
49 changes: 49 additions & 0 deletions
49
applications/visualizer/frontend/src/components/ViewerContainer/ColorPicker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Box from '@mui/material/Box'; | ||
import ChromePicker from 'react-color'; | ||
|
||
|
||
const ColorPicker = ({ selectedColor, onChange }) => { | ||
return ( | ||
<Box sx={{ | ||
'& > div': { | ||
width: '100% !important', | ||
boxShadow: 'none !important', | ||
background: 'transparent !important', | ||
fontFamily: "'IBM Plex Sans',sans-serif !important", | ||
|
||
'& > div:last-of-type': { | ||
'& > div:first-of-type': { | ||
'& > div:first-of-type': { | ||
'& > div': { | ||
// border: `0.0625rem solid ${headerBorderLeftColor}`, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
'& svg': { | ||
'&:hover': { | ||
// background: `${headerBorderLeftColor} !important`, | ||
}, | ||
}, | ||
|
||
'& input': { | ||
// backgroundColor: `${headerBorderLeftColor} !important`, | ||
boxShadow: 'none !important', | ||
// color: `${headingColor} !important`, | ||
'&:focus': { | ||
boxShadow: 'none !important', | ||
outline: 'none !important', | ||
}, | ||
}, | ||
}, | ||
}}> | ||
<ChromePicker | ||
color={selectedColor} | ||
onChange={onChange} | ||
/> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default ColorPicker; |
122 changes: 122 additions & 0 deletions
122
applications/visualizer/frontend/src/components/ViewerContainer/CompareWorkspaceDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import { Box, Button, Dialog, FormLabel, IconButton, ListSubheader, TextField, Typography, Autocomplete} from "@mui/material"; | ||
import { vars } from "../../theme/variables.ts"; | ||
import { CaretIcon, CheckIcon, CloseIcon } from "../../icons/index.tsx"; | ||
const { gray100 } = vars; | ||
|
||
|
||
const NeuronData = [ | ||
'ADAC', "ARAC", "VBG" | ||
]; | ||
|
||
const datasetStages = [ | ||
{ | ||
groupName: 'Development Stage 1', | ||
options: [ | ||
{ title: 'Witvliet et al., 2020, Dataset 1 (L1)', caption: '0 hours from birth' }, | ||
{ title: 'Witvliet et al., 2020, Dataset 3 (L1)', caption: '0 hours from birth' }, | ||
{ title: 'Witvliet et al., 2020, Dataset 2 (L1)', caption: '0 hours from birth' } | ||
] | ||
}, | ||
{ | ||
groupName: 'Development Stage 2', | ||
options: [ | ||
{ title: 'Witvliet et al., 2020, Dataset 1 (L1)', caption: '0 hours from birth' }, | ||
{ title: 'Witvliet et al., 2020, Dataset 3 (L1)', caption: '0 hours from birth' }, | ||
{ title: 'Witvliet et al., 2020, Dataset 2 (L1)', caption: '0 hours from birth' } | ||
] | ||
}, | ||
]; | ||
|
||
const CompareWorkspaceDialog = ({ | ||
onClose, | ||
showModal, | ||
}) => { | ||
const allOptions = datasetStages.reduce((acc, curr) => { | ||
return [...acc, ...curr.options.map(option => ({ ...option, groupName: curr.groupName }))]; | ||
}, []); | ||
return ( | ||
<Dialog | ||
onClose={onClose} | ||
open={showModal} | ||
fullWidth | ||
maxWidth="lg" | ||
> | ||
<Box borderBottom={`0.0625rem solid ${gray100}`} px="1rem" py="0.5rem" display='flex' alignItems='center' justifyContent='space-between'> | ||
<Typography component="h3">New workspace configuration</Typography> | ||
<IconButton onClick={onClose}><CloseIcon /></IconButton> | ||
</Box> | ||
<Box px="1rem" py="1.5rem" gap={2.5} display='flex' flexDirection='column'> | ||
<Typography>To start comparing, create workspace by configuring datasets and neurons you would want in the new workspace or start with an empty workspace.</Typography> | ||
<Box> | ||
<FormLabel>Workspace name</FormLabel> | ||
<TextField fullWidth variant="outlined" placeholder="Start typing workspace name" /> | ||
</Box> | ||
|
||
<Box> | ||
<FormLabel>Datasets</FormLabel> | ||
<Autocomplete | ||
multiple | ||
id="grouped-demo" | ||
clearIcon={false} | ||
options={allOptions} | ||
ChipProps={{ deleteIcon: <IconButton sx={{ p: '0 !important', margin: '0 !important' }}><CloseIcon /></IconButton> }} | ||
popupIcon={<CaretIcon />} | ||
groupBy={(option) => option.groupName} | ||
getOptionLabel={(option) => option.title} | ||
renderInput={(params) => <TextField {...params} placeholder="Start typing to search" />} | ||
renderOption={(props, option) => ( | ||
<li {...props}> | ||
<CheckIcon /> | ||
<Typography>{option.title}</Typography> | ||
<Typography component='span'>{option.caption}</Typography> | ||
</li> | ||
)} | ||
renderGroup={(params) => { | ||
console.log(params, 'params') | ||
return ( | ||
<li className="grouped-list" key={params.key}> | ||
<ListSubheader component="div"> | ||
{params.group} | ||
</ListSubheader> | ||
<ul style={{ padding: 0 }}>{params.children}</ul> | ||
</li> | ||
) | ||
}} | ||
/> | ||
</Box> | ||
|
||
<Box> | ||
<FormLabel>Neurons</FormLabel> | ||
<Autocomplete | ||
multiple | ||
className="secondary" | ||
id="tags-standard" | ||
clearIcon={false} | ||
options={NeuronData} | ||
getOptionLabel={(option) => option} | ||
ChipProps={{ deleteIcon: <IconButton sx={{ p: '0 !important', margin: '0 !important' }}><CloseIcon /></IconButton> }} | ||
renderOption={(props, option) => ( | ||
<li {...props}> | ||
<CheckIcon /> | ||
<Typography>{option}</Typography> | ||
</li> | ||
)} | ||
renderInput={(params) => ( | ||
<TextField | ||
{...params} | ||
placeholder="Start typing to search" | ||
/> | ||
)} | ||
/> | ||
</Box> | ||
</Box> | ||
|
||
<Box borderTop={`0.0625rem solid ${gray100}`} px="1rem" py="0.75rem" gap={0.5} display='flex' justifyContent='flex-end'> | ||
<Button variant="text">Start with an empty workspace</Button> | ||
<Button variant="contained" color="info">Configure workspace</Button> | ||
</Box> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export default CompareWorkspaceDialog; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure as I'm not very skilled for everything frontend related 😅, but instead of having the
hasLaunched
variable and the classical ternary operator, could it be one of those scenarios where we could use<Suspense></Suspense>
?