Skip to content

Commit

Permalink
fix saving of cell types and many cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
terraswat committed Oct 31, 2019
1 parent 10328ff commit 87f38bb
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/cellTypeCluster/clusterBarMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ const mapDispatchToProps = (dispatch) => {
dispatch({
type: 'app.snackbar.open',
message:
'For a multi-column cell type: ' +
'(1) click on begin cluster, ' +
'(2) shift-click on end cluster, ' +
'(3) select "Make Cell Type".',
'For a multi-cluster cell type: ' +
'(1) click begin cluster, ' +
'(2) shift-click end cluster, ' +
'(3) click "Make Cell Type".',
severity: 'fromDirectRequest',
})
},
Expand Down
1 change: 1 addition & 0 deletions src/cellTypeSheet/sheetList.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const mapStateToProps = (state) => {
return {
id: 'cell_type_work_sheet',
list: state.cellTypeSheet.list,
placeholder: 'Open a worksheet...',
selected: state.cellTypeSheet.selected,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cellTypeWork/bubblesPres.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Presentation = ({ data, dims, geneCluster, onMouseOver }) => {
marginTop: '2rem',
color: 'red',
}}>
Add a marker gene from the table below
Add marker genes from the table below
</Typography>
)
}
Expand Down
10 changes: 7 additions & 3 deletions src/cellTypeWork/ctwMenuPres.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Presentational component of the Main menu of the cell type worksheet page.

import React from 'react'
import { Drawer, IconButton, MenuItem, MenuList } from '@material-ui/core'
import { Drawer, IconButton, MenuItem, MenuList, Typography }
from '@material-ui/core'
import KeyboardArrowLeftIcon from '@material-ui/icons/KeyboardArrowLeft';
import SheetList from 'cellTypeSheet/sheetList'

Expand All @@ -12,6 +13,9 @@ const Body = ({props}) => {
return (
<div style={{width: '20rem'}} >
<div style={{margin: '1rem', marginTop: 0}} >
<Typography style={{fontSize: '1.1rem'}}>
Open
</Typography>
<SheetList />
</div>
<MenuList style={{ padding: 0, }}>
Expand All @@ -22,14 +26,14 @@ const Body = ({props}) => {
Save
</MenuItem>
<MenuItem
disabled={!sheetSelected}
disabled={username === null || !sheetSelected}
onClick={onSaveAsClick}
>
Save As
</MenuItem>
<MenuItem
style={{display: 'None'}}
disabled = {(username === null || uploadInProgress)}
disabled = {username === null || uploadInProgress || !sheetSelected}
onClick={onUploadClick}
>
{(uploadInProgress) ? 'Upload In Progress' : 'Upload Data'}
Expand Down
4 changes: 2 additions & 2 deletions src/cellTypeWork/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Header = ({props}) => {
<React.Fragment>
<CtwMenu />
<IconButton
style={{marginTop: -12, marginLeft: -50}}
style={{marginTop: -2, marginLeft: -50}}
onClick={onMenuClick}
>
<MenuIcon color='primary' style={{height: 36, width: 36}}/>
Expand Down Expand Up @@ -50,7 +50,7 @@ const Presentation = (props) => {
width: '100%'
}
return (
<div style={{marginTop: -20}}>
<div style={{marginTop: -30}}>
<Header props={props} />
<div style={gridStyle}>
<Grid container spacing={8} style={{background: 'transparent'}}>
Expand Down
11 changes: 10 additions & 1 deletion src/cellTypeWork/transformToChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ const buildTypeGroups = (cellTypes) => {

// Determine which column should display the label.
groups.forEach(group => {
cellTypes[group[0]].show = true

try {
cellTypes[group[0]].show = true
} catch (e) {
// Causing: "Uncaught TypeError: Cannot set property 'show' of undefined"
console.error('buildTypeGroups(): debug for:', e)
console.error('buildTypeGroups(): cellTypes:', cellTypes)
console.error('buildTypeGroups(): group:', group)
console.error('buildTypeGroups(): group[0]:', group[0])
}
})

return groups
Expand Down
2 changes: 1 addition & 1 deletion src/cellTypeWork/transformToServerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const buildClusters = (data) => {

// The header.
tsvLines.unshift(
['column\tcluster\tcell_count\tbar_color\tcell_type\thide_cell_type'])
['column\tcluster\tcell_count\tcell_type'])
// Transform the lines to tsv.
return tsvLines.join('\n')
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/PickList.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const PickList = ({id, helperText, label, list, placeholder, selected,
let Placeholder = null
if (placeholder) {
Placeholder = (
<MenuItem value="none" disabled >
<MenuItem
value='none'
disabled
style={{fontStyle: 'italic'}}
>
{placeholder}
</MenuItem>
)
Expand Down

0 comments on commit 87f38bb

Please sign in to comment.