commit
bd01e5dd9e
|
@ -10,8 +10,7 @@ import CellEditorOverlay from 'src/dashboards/components/CellEditorOverlay'
|
||||||
import DashboardHeader from 'src/dashboards/components/DashboardHeader'
|
import DashboardHeader from 'src/dashboards/components/DashboardHeader'
|
||||||
import DashboardHeaderEdit from 'src/dashboards/components/DashboardHeaderEdit'
|
import DashboardHeaderEdit from 'src/dashboards/components/DashboardHeaderEdit'
|
||||||
import Dashboard from 'src/dashboards/components/Dashboard'
|
import Dashboard from 'src/dashboards/components/Dashboard'
|
||||||
import TemplateVariableManager
|
import TemplateVariableManager from 'src/dashboards/components/TemplateVariableManager'
|
||||||
from 'src/dashboards/components/TemplateVariableManager'
|
|
||||||
|
|
||||||
import {errorThrown as errorThrownAction} from 'shared/actions/errors'
|
import {errorThrown as errorThrownAction} from 'shared/actions/errors'
|
||||||
|
|
||||||
|
@ -82,7 +81,8 @@ class DashboardPage extends Component {
|
||||||
|
|
||||||
handleCloseTemplateManager(isEdited) {
|
handleCloseTemplateManager(isEdited) {
|
||||||
if (
|
if (
|
||||||
!isEdited || (isEdited && confirm('Do you want to close without saving?')) // eslint-disable-line no-alert
|
!isEdited ||
|
||||||
|
(isEdited && confirm('Do you want to close without saving?')) // eslint-disable-line no-alert
|
||||||
) {
|
) {
|
||||||
this.setState({isTemplating: false})
|
this.setState({isTemplating: false})
|
||||||
}
|
}
|
||||||
|
@ -355,13 +355,13 @@ class DashboardPage extends Component {
|
||||||
showTemplateControlBar={showTemplateControlBar}
|
showTemplateControlBar={showTemplateControlBar}
|
||||||
>
|
>
|
||||||
{dashboards
|
{dashboards
|
||||||
? dashboards.map((d, i) => (
|
? dashboards.map((d, i) =>
|
||||||
<li className="dropdown-item" key={i}>
|
<li className="dropdown-item" key={i}>
|
||||||
<Link to={`/sources/${sourceID}/dashboards/${d.id}`}>
|
<Link to={`/sources/${sourceID}/dashboards/${d.id}`}>
|
||||||
{d.name}
|
{d.name}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
))
|
)
|
||||||
: null}
|
: null}
|
||||||
</DashboardHeader>}
|
</DashboardHeader>}
|
||||||
{dashboard
|
{dashboard
|
||||||
|
|
|
@ -137,14 +137,14 @@ export default function ui(state = initialState, action) {
|
||||||
|
|
||||||
const dashboards = state.dashboards.map(
|
const dashboards = state.dashboards.map(
|
||||||
d =>
|
d =>
|
||||||
(d.id === dashboardID
|
d.id === dashboardID
|
||||||
? {
|
? {
|
||||||
...d,
|
...d,
|
||||||
cells: d.cells.map(
|
cells: d.cells.map(
|
||||||
c => (c.i === cellID ? {...c, isEditing: false} : c)
|
c => (c.i === cellID ? {...c, isEditing: false} : c)
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
: d)
|
: d
|
||||||
)
|
)
|
||||||
|
|
||||||
return {...state, dashboards}
|
return {...state, dashboards}
|
||||||
|
|
|
@ -44,7 +44,9 @@ class CustomTimeRangeDropdown extends Component {
|
||||||
onClick={this.handleToggleDropdown}
|
onClick={this.handleToggleDropdown}
|
||||||
>
|
>
|
||||||
<span className="icon clock" />
|
<span className="icon clock" />
|
||||||
<span className="dropdown-selected">{`${moment(lower).format('MMM Do HH:mm')} — ${moment(upper).format('MMM Do HH:mm')}`}</span>
|
<span className="dropdown-selected">{`${moment(lower).format(
|
||||||
|
'MMM Do HH:mm'
|
||||||
|
)} — ${moment(upper).format('MMM Do HH:mm')}`}</span>
|
||||||
<span className="caret" />
|
<span className="caret" />
|
||||||
</button>
|
</button>
|
||||||
<CustomTimeRange
|
<CustomTimeRange
|
||||||
|
|
|
@ -51,21 +51,20 @@ NameableGraphHeader.propTypes = {
|
||||||
onCancelEditCell: func,
|
onCancelEditCell: func,
|
||||||
}
|
}
|
||||||
|
|
||||||
const GraphName = ({name, queries}) => (
|
const GraphName = ({name, queries}) =>
|
||||||
<span className="dash-graph--name">
|
<span className="dash-graph--name">
|
||||||
{name}
|
{name}
|
||||||
{queries && queries.length
|
{queries && queries.length
|
||||||
? <CustomTimeIndicator queries={queries} />
|
? <CustomTimeIndicator queries={queries} />
|
||||||
: null}
|
: null}
|
||||||
</span>
|
</span>
|
||||||
)
|
|
||||||
|
|
||||||
GraphName.propTypes = {
|
GraphName.propTypes = {
|
||||||
name: string,
|
name: string,
|
||||||
queries: arrayOf(shape()),
|
queries: arrayOf(shape()),
|
||||||
}
|
}
|
||||||
|
|
||||||
const GraphNameInput = ({value, onKeyUp, onChange, onBlur}) => (
|
const GraphNameInput = ({value, onKeyUp, onChange, onBlur}) =>
|
||||||
<input
|
<input
|
||||||
className="form-control input-sm dash-graph--name-edit"
|
className="form-control input-sm dash-graph--name-edit"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -75,7 +74,6 @@ const GraphNameInput = ({value, onKeyUp, onChange, onBlur}) => (
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
onKeyUp={onKeyUp}
|
onKeyUp={onKeyUp}
|
||||||
/>
|
/>
|
||||||
)
|
|
||||||
|
|
||||||
GraphNameInput.propTypes = {
|
GraphNameInput.propTypes = {
|
||||||
value: string,
|
value: string,
|
||||||
|
|
Loading…
Reference in New Issue