From 475d369811a036b93d703c616bf2c31bf942084b Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 31 Jan 2018 12:07:23 -0800 Subject: [PATCH] Enable deletion of annotation range from endpoint --- ui/src/shared/components/Annotation.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/src/shared/components/Annotation.js b/ui/src/shared/components/Annotation.js index f65f538da6..c1c6b8875e 100644 --- a/ui/src/shared/components/Annotation.js +++ b/ui/src/shared/components/Annotation.js @@ -135,7 +135,15 @@ class Annotation extends Component { } handleDeleteAnnotation = () => { - this.props.onDeleteAnnotation(this.props.annotation) + const {annotation, annotations, onDeleteAnnotation} = this.props + + if (this.isEndpoint()) { + const startAnnotation = annotations.find(a => a.id === this.getStartID()) + + return onDeleteAnnotation(startAnnotation) + } + + return onDeleteAnnotation(annotation) } render() {