From e2284ef337c7fac51d7595b108a825ed8160d147 Mon Sep 17 00:00:00 2001 From: Rares Mardare Date: Wed, 17 May 2023 14:48:45 +0300 Subject: [PATCH] Fix escalation reordering (#1957) # What this PR does Fixed bug in Escalation Chains where reordering an item crashed the list #1936 --- CHANGELOG.md | 6 ++++++ grafana-plugin/src/components/Policy/EscalationPolicy.tsx | 6 +++++- .../EscalationChainSteps/EscalationChainSteps.tsx | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ba8b83a..1f30dc41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Fixed bug in Escalation Chains where reordering an item crashed the list + ## v1.2.23 (2023-05-15) ### Added diff --git a/grafana-plugin/src/components/Policy/EscalationPolicy.tsx b/grafana-plugin/src/components/Policy/EscalationPolicy.tsx index 029f4bab..3560932d 100644 --- a/grafana-plugin/src/components/Policy/EscalationPolicy.tsx +++ b/grafana-plugin/src/components/Policy/EscalationPolicy.tsx @@ -36,7 +36,11 @@ import styles from './EscalationPolicy.module.css'; const cx = cn.bind(styles); -export interface EscalationPolicyProps { +interface ElementSortableProps { + index: number; +} + +export interface EscalationPolicyProps extends ElementSortableProps { data: EscalationPolicyType; waitDelays?: any[]; isDisabled?: boolean; diff --git a/grafana-plugin/src/containers/EscalationChainSteps/EscalationChainSteps.tsx b/grafana-plugin/src/containers/EscalationChainSteps/EscalationChainSteps.tsx index 46c28e8b..7af65132 100644 --- a/grafana-plugin/src/containers/EscalationChainSteps/EscalationChainSteps.tsx +++ b/grafana-plugin/src/containers/EscalationChainSteps/EscalationChainSteps.tsx @@ -76,6 +76,7 @@ const EscalationChainSteps = observer((props: EscalationChainStepsProps) => { return (