From d34cec4c12c2229a823d9dd9b539439cf3c87abf Mon Sep 17 00:00:00 2001 From: Bastian Weltjen Date: Fri, 1 Apr 2022 22:03:00 +0200 Subject: [PATCH] fix(navigation): move "Backend Connectins" to top level fix(routes): check for existing linked artifact before calling DELETE --- CHANGELOG.md | 3 +++ src/pages/PageStructure.js | 13 +++++-------- src/utils/dataUtils.js | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 953fd5be..d4d45c31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ All notable changes to this project will be documented in this file. - Data Consumption: Dispatch data via routes - Start/Stop apps +### Changes +- Moved "Backend Connections" to the top menu level + ### Fixes - Raised comparison of variable from value to type level - Removed sensitive data in HTTP response diff --git a/src/pages/PageStructure.js b/src/pages/PageStructure.js index 23f8cf0d..5c805728 100644 --- a/src/pages/PageStructure.js +++ b/src/pages/PageStructure.js @@ -42,10 +42,6 @@ export default { component: AddResourcePage, subpages: [] }] - }, { - path: "backendconnectionsoffering", - name: "Backend Connections (Offering)", - component: BackendConnectionsPage }, { path: "routesoffering", name: "Routes (Offering)", @@ -82,10 +78,6 @@ export default { component: IDSDataConsumptionPage, subpages: [] }] - }, { - path: "backendconnectionsconsumption", - name: "Backend Connections (Consumption)", - component: null }, { path: "routesconsumption", name: "Routes (Consumption)", @@ -102,6 +94,11 @@ export default { subpages: [] }] }] + }, { + path: "backendconnections", + name: "Backend Connections", + icon: "mdi-database", + component: BackendConnectionsPage }, { path: "brokers", name: "Brokers", diff --git a/src/utils/dataUtils.js b/src/utils/dataUtils.js index 2ec61ac4..42d6f9d8 100644 --- a/src/utils/dataUtils.js +++ b/src/utils/dataUtils.js @@ -691,8 +691,10 @@ export default { async deleteRoute(id) { let artifact = await restUtils.callConnector("GET", "/api/routes/" + id + "/output"); - let artifactId = this.getIdOfConnectorResponse(artifact); - await restUtils.callConnector("DELETE", "/api/artifacts/" + artifactId); + if (typeof artifact == 'object') { + let artifactId = this.getIdOfConnectorResponse(artifact); + await restUtils.callConnector("DELETE", "/api/artifacts/" + artifactId); + } await restUtils.callConnector("DELETE", "/api/routes/" + id); },