diff --git a/ui/src/shared/annotations/styles.js b/ui/src/shared/annotations/styles.js index f45673aa5..82a952ed4 100644 --- a/ui/src/shared/annotations/styles.js +++ b/ui/src/shared/annotations/styles.js @@ -161,7 +161,6 @@ export const annotationStyle = ( isDragging, staticLegendHeight ) => { -export const annotationStyle = ({time}, dygraph, isMouseOver, isDragging) => { // TODO: export and test this function const [startX, endX] = dygraph.xAxisRange() let visibility = 'visible' @@ -177,7 +176,7 @@ export const annotationStyle = ({time}, dygraph, isMouseOver, isDragging) => { const height = staticLegendHeight ? `calc(100% - ${staticLegendHeight + 36}px)` : 'calc(100% - 36px)' - + return { left, position: 'absolute', @@ -240,7 +239,7 @@ export const annotationWindowStyle = ( position: 'absolute', top: '8px', background: `linear-gradient(to bottom, ${gradientStartColor} 0%,${gradientEndColor} 100%)`, - height: 'calc(100% - 36px)', + height, borderTop: `2px dotted rgba(${annotationColor},0.35)`, width, zIndex: zIndexWindow, diff --git a/ui/src/shared/components/Dygraph.js b/ui/src/shared/components/Dygraph.js index 5030905df..b83e71360 100644 --- a/ui/src/shared/components/Dygraph.js +++ b/ui/src/shared/components/Dygraph.js @@ -25,7 +25,6 @@ import { highlightSeriesOpts, } from 'src/shared/graphs/helpers' const {LINEAR, LOG, BASE_10, BASE_2} = DISPLAY_OPTIONS -import {ADDING, EDITING} from 'src/shared/annotations/helpers' class Dygraph extends Component { constructor(props) { @@ -304,8 +303,7 @@ class Dygraph extends Component { render() { const {isHidden, staticLegendHeight} = this.state - const {staticLegend,mode} = this.props - const hideLegend = mode === EDITING || mode === ADDING ? true : isHidden + const {staticLegend} = this.props let dygraphStyle = {...this.props.containerStyle, zIndex: '2'} if (staticLegend) { diff --git a/ui/src/shared/components/NewAnnotation.js b/ui/src/shared/components/NewAnnotation.js index 27a54accd..b98adf14a 100644 --- a/ui/src/shared/components/NewAnnotation.js +++ b/ui/src/shared/components/NewAnnotation.js @@ -172,7 +172,7 @@ class NewAnnotation extends Component { } } -const {bool, func, number, shape} = P +const {bool, func, number, shape} = PropTypes NewAnnotation.propTypes = { dygraph: shape({}).isRequired,