Add style for untitled cells

Also using the language “Untitled Cell” instead of “Name this Graph” as
the thing being named is actually a cell, not a graph. Also now that
renaming is a little more buried, I am avoiding the urgency of “Name
this Graph”
pull/2002/head
Alex P 2017-09-20 13:06:11 -07:00
parent 429a36512a
commit 33a3427c08
3 changed files with 15 additions and 2 deletions

View File

@ -17,7 +17,7 @@ export const NEW_DEFAULT_DASHBOARD_CELL = {
y: 0,
w: 4,
h: 4,
name: 'Name This Graph',
name: 'Untitled Cell',
type: 'line',
queries: [],
}

View File

@ -5,6 +5,8 @@ import classnames from 'classnames'
import ContextMenu from 'shared/components/ContextMenu'
import CustomTimeIndicator from 'shared/components/CustomTimeIndicator'
import {NEW_DEFAULT_DASHBOARD_CELL} from 'src/dashboards/constants/index'
class NameableGraph extends Component {
constructor(props) {
super(props)
@ -48,6 +50,7 @@ class NameableGraph extends Component {
const {cellName, isDeleting} = this.state
const queries = _.get(cell, ['queries'], [])
const cellNameIsDefault = cellName === NEW_DEFAULT_DASHBOARD_CELL.name
return (
<div className="dash-graph">
@ -66,7 +69,13 @@ class NameableGraph extends Component {
'dash-graph--heading-draggable': isEditable,
})}
>
<span className="dash-graph--name">
<span
className={
cellNameIsDefault
? 'dash-graph--name dash-graph--name__default'
: 'dash-graph--name'
}
>
{cellName}
{queries && queries.length
? <CustomTimeIndicator queries={queries} />

View File

@ -163,8 +163,12 @@ input.form-control.dash-graph--name-edit {
line-height: (26px - 4px) !important;
position: relative;
top: -1px; // Fix for slight offset
.dash-graph--name.dash-graph--name__default {
font-style: italic;
}
.dash-graph--custom-time {
font-style: normal;
font-family: $code-font;
color: $c-pool;
background-color: $g2-kevlar;