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

Context Switcher in top navigation #190

Merged
merged 60 commits into from
Nov 21, 2018

Conversation

maxmarkus
Copy link
Contributor

Adds the possibility to show a dropdown with a list of links that can be used to enter a contextual path, eg. environments. Typically used in combination with a dynamic node, to be able to enter also hidden contexts.

config.parentNodePath = `${config.parentNodePath}/`;
}
}
if (!config.parentNodePath) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can use here just else instead of if (!config.parentNodePath)

const hasNoDynamicPathSegment =
config.parentNodePath.split('/').filter(p => p.startsWith(':'))
.length === 0;
if (hasNoDynamicPathSegment && !config.parentNodePath.endsWith('/')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have to add the final / only if there is no dynamic path segment?

},
data() {
return {
dropDownStates: {},
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to have an initialisation of all keys here, I see above we are setting some other keys on component creation.

- **position** is optional. Defines the action element position. Can be `top` or `bottom`. Defaults to `top`
- **link** is optional. Defines an absolute Link to a **node**.
- **clickHandler** specifies a function and is executed on click and should return a boolean. If it returns `true`, **link** is opened afterwards.
- **fallbackLabelResolver** specifies a function that is executed to fetch a context element label if **options** are not yet loaded or **label** is not defined.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I am missing something, since I don't understand why are we using the fallbackLabelResolver if 'options are not yet loaded', since this function is not responsible for setting the pathValue field for options.

@maxmarkus
Copy link
Contributor Author

Fixes now also #193

@jesusreal jesusreal merged commit ac4b702 into SAP:master Nov 21, 2018
@maxmarkus maxmarkus deleted the feature/context-switcher branch November 27, 2018 15:09
stanleychh pushed a commit to stanleychh/luigi that referenced this pull request Dec 30, 2021
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.

6 participants