From f9ae3d922d1d898ec9f3af19fa6b1d03b38d9b53 Mon Sep 17 00:00:00 2001 From: Jason Madigan Date: Mon, 14 Oct 2024 10:54:37 +0100 Subject: [PATCH] Change cancel on resource create pages to navigate back, rather than go back to the all policies page. Signed-off-by: Jason Madigan --- src/components/KuadrantDNSPolicyCreatePage.tsx | 2 +- src/components/KuadrantRateLimitPolicyCreatePage.tsx | 2 +- src/utils/cancel.tsx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/KuadrantDNSPolicyCreatePage.tsx b/src/components/KuadrantDNSPolicyCreatePage.tsx index f660aca..7ff1b78 100644 --- a/src/components/KuadrantDNSPolicyCreatePage.tsx +++ b/src/components/KuadrantDNSPolicyCreatePage.tsx @@ -197,7 +197,7 @@ const KuadrantDNSPolicyCreatePage: React.FC = () => { }; const handleCancel = () => { - history.push('/kuadrant/all-namespaces/policies'); + history.goBack(); }; return ( diff --git a/src/components/KuadrantRateLimitPolicyCreatePage.tsx b/src/components/KuadrantRateLimitPolicyCreatePage.tsx index 6954f3c..cb403b2 100644 --- a/src/components/KuadrantRateLimitPolicyCreatePage.tsx +++ b/src/components/KuadrantRateLimitPolicyCreatePage.tsx @@ -151,7 +151,7 @@ const KuadrantRateLimitPolicyCreatePage: React.FC = () => { }; const handleCancel = () => { - history.push('/kuadrant/all-namespaces/policies'); + history.goBack(); }; return ( diff --git a/src/utils/cancel.tsx b/src/utils/cancel.tsx index 5c5929e..7bb5b5c 100644 --- a/src/utils/cancel.tsx +++ b/src/utils/cancel.tsx @@ -1,5 +1,5 @@ import { History } from 'history'; -export function handleCancel (namespace: string ,data , history: History) { - history.push(`/kuadrant/all-namespaces/policies`) - }; \ No newline at end of file +export function handleCancel(namespace: string, data, history: History) { + history.goBack(); +}