-
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
Keep left-side navigation on a Node hierarchy level #118
Conversation
… viewUrl, added some documentation and example implementation, overview link
…n is the configuration key
# Conflicts: # client/luigi-client.js # core/examples/luigi-sample-angular/src/app/app.module.ts # core/examples/luigi-sample-angular/src/app/overview/overview.component.ts # core/examples/luigi-sample-angular/src/app/project/dynamic/dynamic.component.spec.ts # core/examples/luigi-sample-angular/src/app/project/project.component.ts # core/src/services/navigation.js # core/test/navigation.spec.js # docs/lifecycle.md # docs/navigation-configuration.md
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.
Just small fixes. Please read the comments :)
core/examples/luigi-sample-angular/src/app/project/dynamic/dynamic.component.ts
Outdated
Show resolved
Hide resolved
.contains('keepSelectedForChildren') | ||
.click(); | ||
|
||
const $body2 = $element.contents().find('body'); |
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.
Could you please rename it to something more descriptive? 'body2' doesn't say too much.
@@ -34,5 +34,37 @@ describe('Navigation', () => { | |||
}); | |||
cy.get('.fd-app__sidebar').should('contain', 'First Child'); | |||
cy.get('.fd-app__sidebar').should('contain', 'Second Child'); | |||
|
|||
// keep selected for children 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.
I'm not sure if that's the best place for those tets. Maybe creating new one with just 'luigi-core features' would be a good idea?
I guess splitting tests for smaller pieces as soon as possible will be beneficial in the future :)
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.
Agree to split the test into pieces. Since it is navigation feature, I'll leave it in the file.
.click(); | ||
|
||
// dig into the iframe | ||
cy.wait(50); |
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.
In my case 50 was sometimes not enough. Please increase this value.
core/src/services/navigation.js
Outdated
return groupBy(nodes, 'category'); | ||
}; | ||
|
||
export const getTruncatedVirtualChildren = (children) => { |
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.
We agreed not tu use name 'vitrual children'. Please rename it :)
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.
Same for 'virtualChildFound' and 'pathDataTruncatedVirtualChildren'
…hildren-93 # Conflicts: # README.md
// on route change we need to refresh the contents() reference | ||
iframeBody = $element.contents().find('body'); | ||
// wrap this body with cy so as to do cy actions inside iframe elements | ||
const cyElement2 = cy.wrap(iframeBody); |
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.
Could you please rename this variable name as well? :)
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.
LGTM
README.md
Outdated
- Run `npm run e2e:run` in the __core/examples/luigi-sample-angular__ folder to start tests in the headless browser. |
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.
Why have you introduced "_" ? According to our guidelines, we format paths with code, so it should be: core/examples/luigi-sample-angular
as in the previous version. Or am I missing something?
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.
Actually I am not sure, since this was in the master and I had code stuff, but saw underscores coming from master. Then I'll change it back to code, thanks
docs/navigation-configuration.md
Outdated
@@ -73,6 +73,7 @@ window.Luigi.setConfig({ | |||
- **context** sends the specified object as context to the view. Use this parameter in combination with the dynamic **pathSegment** to receive the context through the context listeners of **Luigi client**. This is an alternative to using the dynamic value in the **viewUrl**. | |||
- **defaultChildNode** sets the child node that Luigi activates automatically if the current node has no **viewUrl** defined. Provide **pathSegment** of the child node you want to activate as a string. | |||
- **isolateView** renders the view in a new frame when you enter and leave the Node. This setting overrides the same-domain frame re-usage. The **isolateView** is disabled by default. | |||
- **keepSelectedForChildren** fixates the navigation in its current hierarchy, omitting display of children |
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.
- **keepSelectedForChildren** focuses the navigation in its current hierarchy, omitting the display of children.
I wouldn't use "fixate" here tbh.
@@ -25,12 +25,20 @@ export class OverviewComponent { | |||
{ | |||
link: '/projects/pr1/dps', | |||
text: 'defaultChildNode', | |||
description: 'navigation Node configuration to set a specific node as initial target' | |||
description: | |||
'navigation Node configuration to set a specific node as initial target' |
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.
Node as an initial target
}, | ||
{ | ||
link: '/projects/pr1/users/groups', | ||
text: 'dynamic Nodes', | ||
description: 'navigation Node configuration to set a specific node as dynamic' | ||
description: | ||
'navigation Node configuration to set a specific node as dynamic' |
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.
Node
link: '/projects/pr1/avengers', | ||
text: 'keepSelectedForChildren', | ||
description: | ||
'navigation Node configuration to fixate a navigation menu and omit the children' |
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.
fixate -> focus on
docs/navigation-configuration.md
Outdated
@@ -73,6 +73,7 @@ window.Luigi.setConfig({ | |||
- **context** sends the specified object as context to the view. Use this parameter in combination with the dynamic **pathSegment** to receive the context through the context listeners of **Luigi client**. This is an alternative to using the dynamic value in the **viewUrl**. | |||
- **defaultChildNode** sets the child node that Luigi activates automatically if the current node has no **viewUrl** defined. Provide **pathSegment** of the child node you want to activate as a string. | |||
- **isolateView** renders the view in a new frame when you enter and leave the Node. This setting overrides the same-domain frame re-usage. The **isolateView** is disabled by default. | |||
- **keepSelectedForChildren** focuses the navigation in its current hierarchy, omitting the display of children. |
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.
focuses the navigation on
…hierarchy level (SAP#118) * initial dynamic node implementation. substitution for pathSegment and viewUrl and example implementation, overview link * removed obsolete routes and component, added child node to dynamic node example * added context substitution and enhanced config and example * moved leftnav business logic to navigation.js, keepSelectedForChildren is the configuration key * added unit, e2e tests * documentation update
keepSelectedForChildren
Node setting for fixating the navigation.Solves #93