Skip to content

Commit

Permalink
fix(ACL/RequestPermissions): handle path from attributes of error [YT…
Browse files Browse the repository at this point in the history
…FRONT-3502]
  • Loading branch information
ma-efremoff committed Apr 19, 2024
1 parent b9c0e01 commit f078a89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ui/src/ui/pages/navigation/Navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit f078a89

Please # to comment.