-
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
Nav collapsed feature #259
Conversation
…avCollapsed-feature
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.
Please also add it to the overview page 'Luigi Core Features' section in the angular example.
@@ -115,5 +115,10 @@ describe('Navigation', () => { | |||
expect(loc.hash).to.eq('#/projects/pr2/dps/dps1'); | |||
}); | |||
}); | |||
it('should hide left Nav', () => { | |||
cy.visit('/#/projects/pr1/navCollapse'); | |||
cy.get('.no-left-nav'); |
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.
This line doesn't do anything.
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.
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 would be also confused with this line. Maybe you could explicitly do the check, otherwise someone could also think this line does nothing, remove it and then the test will not check what it has to check. Maybe sth like this:
cy.get('.no-left-nav').should('exist');
@@ -419,7 +425,8 @@ Luigi.setConfig({ | |||
{ | |||
pathSegment: 'overview', | |||
label: 'Overview', | |||
viewUrl: '/sampleapp.html#/overview' | |||
viewUrl: '/sampleapp.html#/overview', | |||
navCollapse: true |
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 would leave the navigation here, it's enough to show it in the feature component. At the beginning I thought something was wrongly implemented that the navigation is not shown on the main page ;)
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.
core/src/App.html
Outdated
@@ -17,8 +17,8 @@ | |||
</div> | |||
{/if} | |||
|
|||
<TopNav pathData={navigationPath} /> | |||
<LeftNav pathData={navigationPath} /> | |||
<TopNav pathData={navigationPath} /> {#if !(hideNav||hideLeftNav)} |
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.
Please move those if
s to new lines so it's more readable.
docs/navigation-configuration.md
Outdated
- **sameWindow** defines if the external URL is opened in a new or current tab. | ||
- **url** is the external URL that the node leads to. | ||
- **externalLink** is an object which indicates that the node links to an external URL. If this parameter is defined, **pathSegment** and **link** parameters are ignored. It has the following properties: | ||
- **sameWindow** defines if the external URL is opened in a new or current tab. |
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.
Those additional spaces here were actually needed. Same one line below.
docs/navigation-configuration.md
Outdated
@@ -22,6 +22,7 @@ A navigation path is any existing path in the navigation tree. It connects the f | |||
|
|||
- The path of the main application, that is, the path in the browser URL. The path is defined in a Luigi navigation node through one of the following parameters, listed in order of precedence: **externalLink**, **link**, and **pathSegment**. | |||
- The **viewUrl** of a micro front-end rendered in the content area of the main application. | |||
- If the **navCollapse** property is set to `true`, the left navigation will be hidden while user visits the particular Node. |
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.
- If the **navCollapse** property is set to `true`, the left navigation will be hidden while user visits the particular Node. | |
- If you set **navCollapse** property to `true`, the left navigation becomes hidden when you click the affected node. |
I'm not sure if I didn't overthink this while wanting to make it simpler 🤔
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.
Please add explicitly that the default value is false
. And maybe 'while the user' would be better.
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.
One comment to one line :)
@@ -115,5 +115,10 @@ describe('Navigation', () => { | |||
expect(loc.hash).to.eq('#/projects/pr2/dps/dps1'); | |||
}); | |||
}); | |||
it('should hide left Nav', () => { | |||
cy.visit('/#/projects/pr1/navCollapse'); | |||
cy.get('.no-left-nav'); |
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 would be also confused with this line. Maybe you could explicitly do the check, otherwise someone could also think this line does nothing, remove it and then the test will not check what it has to check. Maybe sth like this:
cy.get('.no-left-nav').should('exist');
const viewUrl = getLastNodeObject(pathData).viewUrl || ''; | ||
const isolateView = getLastNodeObject(pathData).isolateView || false; | ||
|
||
const { |
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.
You get a virtual big applause for this one, awesome refactoring I really like it.
docs/navigation-configuration.md
Outdated
@@ -22,6 +22,7 @@ A navigation path is any existing path in the navigation tree. It connects the f | |||
|
|||
- The path of the main application, that is, the path in the browser URL. The path is defined in a Luigi navigation node through one of the following parameters, listed in order of precedence: **externalLink**, **link**, and **pathSegment**. | |||
- The **viewUrl** of a micro front-end rendered in the content area of the main application. | |||
- If the **navCollapse** property is set to `true`, the left navigation will be hidden while user visits the particular Node. |
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.
Please add explicitly that the default value is false
. And maybe 'while the user' would be better.
@@ -419,7 +425,8 @@ Luigi.setConfig({ | |||
{ | |||
pathSegment: 'overview', | |||
label: 'Overview', | |||
viewUrl: '/sampleapp.html#/overview' | |||
viewUrl: '/sampleapp.html#/overview', | |||
navCollapse: true |
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.
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.
Approved.
Description
I've also fixed the
hideNav
bug (some css rules weren't applied because somebody decided to use id instead of class attribute.Changes proposed in this pull request:
navCollapse
property in Node configuration/overview
and an added example route in Angular exampleRelated issue(s)
Resolves #243