Swap positions of Clone & Download CSV actions
parent
e9323b1119
commit
92abd06330
|
@ -43,6 +43,27 @@ class LayoutCellMenu extends Component {
|
||||||
onDismissEditingAnnotation,
|
onDismissEditingAnnotation,
|
||||||
} = this.props
|
} = 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 (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classnames('dash-graph-context', {
|
className={classnames('dash-graph-context', {
|
||||||
|
@ -64,38 +85,17 @@ class LayoutCellMenu extends Component {
|
||||||
{queries.length ? (
|
{queries.length ? (
|
||||||
<MenuTooltipButton
|
<MenuTooltipButton
|
||||||
icon="pencil"
|
icon="pencil"
|
||||||
menuOptions={[
|
menuOptions={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),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
informParent={this.handleToggleSubMenu}
|
informParent={this.handleToggleSubMenu}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{dataExists && (
|
|
||||||
<MenuTooltipButton
|
<MenuTooltipButton
|
||||||
icon="download"
|
icon="duplicate"
|
||||||
menuOptions={[
|
menuOptions={[{text: 'Clone Cell', action: onClone(cell)}]}
|
||||||
{text: 'Download CSV', action: onCSVDownload(cell)},
|
informParent={this.handleToggleSubMenu}
|
||||||
]}
|
/>
|
||||||
informParent={this.handleToggleSubMenu}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<MenuTooltipButton
|
<MenuTooltipButton
|
||||||
icon="trash"
|
icon="trash"
|
||||||
theme="danger"
|
theme="danger"
|
||||||
|
|
Loading…
Reference in New Issue