Skip to content
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

Merged
merged 38 commits into from
Oct 10, 2018

Conversation

maxmarkus
Copy link
Contributor

@maxmarkus maxmarkus commented Oct 1, 2018

keepSelectedForChildren Node setting for fixating the navigation.
Solves #93

maxmarkus and others added 30 commits July 31, 2018 13:51
… viewUrl, added some documentation and example implementation, overview link
# 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
@maxmarkus maxmarkus changed the title Feature/virtual children 93 Virtual children Node setting for keeping left-side navigation on a Node hierarchy level Oct 1, 2018
@maxmarkus maxmarkus changed the title Virtual children Node setting for keeping left-side navigation on a Node hierarchy level Virtual children Node setting to keep left-side navigation on a Node hierarchy level Oct 1, 2018
@dariadomagala-sap dariadomagala-sap self-assigned this Oct 5, 2018
Copy link
Contributor

@dariadomagala-sap dariadomagala-sap left a 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 :)

.contains('keepSelectedForChildren')
.click();

const $body2 = $element.contents().find('body');
Copy link
Contributor

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
Copy link
Contributor

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 :)

Copy link
Contributor Author

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);
Copy link
Contributor

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.

return groupBy(nodes, 'category');
};

export const getTruncatedVirtualChildren = (children) => {
Copy link
Contributor

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 :)

Copy link
Contributor

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'

@maxmarkus maxmarkus requested a review from bszwarc as a code owner October 8, 2018 07:17
// 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);
Copy link
Contributor

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? :)

Copy link
Contributor

@dariadomagala-sap dariadomagala-sap left a 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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

@@ -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
Copy link
Contributor

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'
Copy link
Contributor

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'
Copy link
Contributor

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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixate -> focus on

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

focuses the navigation on

@maxmarkus maxmarkus merged commit 167fb80 into SAP:master Oct 10, 2018
@maxmarkus maxmarkus changed the title Virtual children Node setting to keep left-side navigation on a Node hierarchy level Keep left-side navigation on a Node hierarchy level Oct 10, 2018
@maxmarkus maxmarkus deleted the feature/virtual-children-93 branch November 27, 2018 15:09
stanleychh pushed a commit to stanleychh/luigi that referenced this pull request Dec 30, 2021
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants