-
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
Improvements for dex auth #251
Changes from all commits
3cf4917
8abd146
89c2879
ceab822
27905b8
851652f
c238e86
4d6dfb4
01f3e66
899e1ef
b3ec9da
e2501ee
435cad1
3e7dffd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,9 @@ | |
|
||
|
||
<div class="fd-shellbar__actions"> | ||
<ContextSwitcher /> | ||
{#if !authorizationEnabled || isLoggedIn} | ||
<ContextSwitcher /> | ||
{/if} | ||
{#if children && pathData.length > 0} | ||
{#each children as node} | ||
{#if !node.hideFromNav} | ||
|
@@ -39,7 +41,7 @@ | |
</div> | ||
|
||
<div class="fd-popover__body fd-popover__body--right" aria-hidden="{dropDownStatesNegated.OVERFLOW_POPOVER || true}" id="OVERFLOW_POPOVER"> | ||
|
||
<nav class="fd-menu"> | ||
<ul class="fd-menu__list"> | ||
{#each children as node} | ||
|
@@ -85,6 +87,7 @@ | |
import LogoTitle from './LogoTitle.html'; | ||
import Authorization from '../Authorization.html'; | ||
import { handleRouteClick } from '../services/routing.js'; | ||
import * as Navigation from './services/navigation.js'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did this intentionally to make it easier to distinguish between internal and imported functions, but it is a pure matter of taste. |
||
import { LuigiConfig } from '../services/config.js'; | ||
import { getNegatedBoolString } from '../utilities/helpers.js'; | ||
|
||
|
@@ -107,6 +110,12 @@ | |
} | ||
}; | ||
|
||
const setLoggedInState = (current, component) => { | ||
component.set({ | ||
isLoggedIn: Navigation.isLoggedIn() | ||
}); | ||
} | ||
|
||
export default { | ||
oncreate() { | ||
this.set({ | ||
|
@@ -118,10 +127,12 @@ | |
if (!previous || previous.pathData != current.pathData) { | ||
setTopNavData(current, this); | ||
} | ||
setLoggedInState(current, this); | ||
}, | ||
data() { | ||
return { | ||
dropDownStates: {} | ||
dropDownStates: {}, | ||
isLoggedIn: false | ||
}; | ||
}, | ||
computed: { | ||
|
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 highly recommend https://www.npmjs.com/package/classnames for this. It can do exactly the same what this function does but with less code :)
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.
Less code, but more dependencies. Not a fan of this. I guess if we want to have it, we can write it by ourself with a small helper function. similar to
['class1', 'class2'].join(' ')
.