-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation Node visibility with custom nodeAccessibilityResolver #67
Navigation Node visibility with custom nodeAccessibilityResolver #67
Conversation
…avigation without parent tree
# Conflicts: # core/examples/luigi-sample-angular/package-lock.json # core/package-lock.json # core/test/routing.spec.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the issue description: "I can set the visibility of a node/microfrontend based on my constraints". Right now the node is not visible in the navigation which is good, but I can see the microfrontend if I type the path in the address bar myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just added small suggestions :)
docs/navigation-configuration.md
Outdated
@@ -58,6 +59,10 @@ window.Luigi.setConfig({ | |||
|
|||
### Navigation parameters | |||
|
|||
- **nodeAccessibilityResolver** allows you to define a permission checker function that gets executed on every Node. If it returns false, the Node and it's children are removed from the navigation structure. You may want to add custom values to Nodes to receive it in the **nodeAccessibilityResolver** function. See [angular sampleconfig.js](../core/examples/luigi-sample-angular/src/assets/sampleconfig.js) for our constraints example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- it's children ->
its children
- it returns false ->
it returns `false`
- preferably it would be great if you could replace the passive voice here with such a structure:
If it returns `false`, {subject} removes the Node and its children from the navigation structure.
- You may want to add custom values to a Node to receive it in the nodeAccessibilityResolver function. ->
To receive a Node in the **nodeAccessibilityResolver** function, add custom values to it.
(I hope the meaning is kept?) - for our constraints example. ->
for the **constraints** example.
docs/navigation-configuration.md
Outdated
@@ -58,6 +59,10 @@ window.Luigi.setConfig({ | |||
|
|||
### Navigation parameters | |||
|
|||
- **nodeAccessibilityResolver** allows you to define a permission checker function that gets executed on every Node. If it returns false, the Node and it's children are removed from the navigation structure. You may want to add custom values to Nodes to receive it in the **nodeAccessibilityResolver** function. See [angular sampleconfig.js](../core/examples/luigi-sample-angular/src/assets/sampleconfig.js) for our constraints example. | |||
|
|||
## Nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is ##
instead of###
intentional here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, since this is a standalone feature while Nodes section is a collection of settings for a Node.
{
navigation: {
nodeAccessibilityResolver: someFunction,
nodes: [node1, node2] // every nodeN consists of parts described in ## Nodes
}
}
…arkus/luigi into feature/visibility-restriction-base
Description
Implemented
Luigi.config.navigation.nodeAccessibilityResolver
for checking Node access restrictionsRelated issue(s)
Fixes #44