From f13f127617a621a24b908dbc1c6a1a25fd517be5 Mon Sep 17 00:00:00 2001 From: Msarawan Date: Fri, 25 Oct 2024 13:59:37 +0530 Subject: [PATCH] [#293] Overhaul the integration of the broker edition form within OpenShift Added integration of our custom broker-edition form within OpenShift. It allows users to edit brokers from multiple locations, such as through the OpenShift search results or from the Installed Operators section. Users can now utilize our custom broker-edition form to edit brokers in both the instances. and also updated redirect paths to points to the previous location. --- console-extensions.json | 6 ++++-- src/brokers/update-broker/UpdateBroker.container.tsx | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/console-extensions.json b/console-extensions.json index caf9125a..a7703220 100644 --- a/console-extensions.json +++ b/console-extensions.json @@ -18,10 +18,12 @@ { "type": "console.page/route", "properties": { - "exact": true, + "exact": false, "path": [ "/k8s/ns/:ns/edit-broker/:name", - "/k8s/all-namespaces/edit-broker/:name" + "/k8s/all-namespaces/edit-broker/:name", + "/k8s/ns/:ns/broker.amq.io~v1beta1~ActiveMQArtemis/:name", + "/k8s/ns/:ns/clusterserviceversions/:operator/broker.amq.io~v1beta1~ActiveMQArtemis/:name" ], "component": { "$codeRef": "UpdateBrokerContainer.UpdateBrokerPage" } } diff --git a/src/brokers/update-broker/UpdateBroker.container.tsx b/src/brokers/update-broker/UpdateBroker.container.tsx index 03ffadb7..813c1ac3 100644 --- a/src/brokers/update-broker/UpdateBroker.container.tsx +++ b/src/brokers/update-broker/UpdateBroker.container.tsx @@ -29,10 +29,15 @@ export const UpdateBrokerPage: FC = () => { const [hasBrokerUpdated, setHasBrokerUpdated] = useState(false); const [alert, setAlert] = useState(''); const params = new URLSearchParams(location.search); - const returnUrl = params.get('returnUrl') || '/k8s/all-namespaces/brokers'; + const returnUrl = params.get('returnUrl'); const handleRedirect = () => { - navigate(returnUrl); + if (returnUrl) { + navigate(returnUrl); + } else { + navigate(-1); + } }; + const k8sUpdateBroker = (content: BrokerCR) => { k8sUpdate({ model: AMQBrokerModel,