Swap positions of Clone & Download CSV actions

pull/3184/head
Alex P 2018-04-11 14:50:46 -07:00
parent e9323b1119
commit 92abd06330
1 changed files with 29 additions and 29 deletions

View File

@ -43,6 +43,27 @@ class LayoutCellMenu extends Component {
onDismissEditingAnnotation,
} = this.props
const menuOptions = [
{
text: 'Configure',
action: onEdit(cell),
},
{
text: 'Add Annotation',
action: onStartAddingAnnotation,
disabled: !cellSupportsAnnotations(cell.type),
},
{
text: 'Edit Annotations',
action: onStartEditingAnnotation,
disabled: !cellSupportsAnnotations(cell.type),
},
]
if (dataExists) {
menuOptions.push({text: 'Download CSV', action: onCSVDownload(cell)})
}
return (
<div
className={classnames('dash-graph-context', {
@ -64,38 +85,17 @@ class LayoutCellMenu extends Component {
{queries.length ? (
<MenuTooltipButton
icon="pencil"
menuOptions={[
{
text: 'Configure',
action: onEdit(cell),
},
{
text: 'Add Annotation',
action: onStartAddingAnnotation,
disabled: !cellSupportsAnnotations(cell.type),
},
{
text: 'Edit Annotations',
action: onStartEditingAnnotation,
disabled: !cellSupportsAnnotations(cell.type),
},
{
text: 'Clone Cell',
action: onClone(cell),
},
]}
menuOptions={menuOptions}
informParent={this.handleToggleSubMenu}
/>
) : null}
{dataExists && (
<MenuTooltipButton
icon="download"
menuOptions={[
{text: 'Download CSV', action: onCSVDownload(cell)},
]}
informParent={this.handleToggleSubMenu}
/>
)}
<MenuTooltipButton
icon="duplicate"
menuOptions={[{text: 'Clone Cell', action: onClone(cell)}]}
informParent={this.handleToggleSubMenu}
/>
<MenuTooltipButton
icon="trash"
theme="danger"