From f078a89950169a642a48366b122492ffbfbd4b60 Mon Sep 17 00:00:00 2001 From: Maksim Efremov Date: Tue, 16 Apr 2024 16:33:29 +0300 Subject: [PATCH] fix(ACL/RequestPermissions): handle path from attributes of error [YTFRONT-3502] --- .../ui/src/ui/pages/navigation/Navigation/Navigation.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/ui/pages/navigation/Navigation/Navigation.js b/packages/ui/src/ui/pages/navigation/Navigation/Navigation.js index 78062e0ad..7eee88a46 100644 --- a/packages/ui/src/ui/pages/navigation/Navigation/Navigation.js +++ b/packages/ui/src/ui/pages/navigation/Navigation/Navigation.js @@ -390,10 +390,12 @@ class Navigation extends Component { } renderRequestPermission(error) { - const {object_type: objectType} = error.attributes; - const {path, cluster} = this.props; + const {object_type: objectType, path: errorPath} = error.attributes; + const {path: currentPath, cluster} = this.props; const isRequestPermissionsForPathAllowed = objectType === 'map_node'; + const path = errorPath ?? currentPath; + const pathForRequest = isRequestPermissionsForPathAllowed ? path : getParentPath(path); const textForRequest = isRequestPermissionsForPathAllowed ? 'Request permission'