-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Adds cloud links to user popover #66825
Conversation
@cqliu1 what do I add to the |
Currently, the cloud links are still hard coded, so all you need to do to test this PR right now is pass a cloud ID and a cloud password reset url in your
I'll provide an updated snippet with the additional links in the description up top once I have the UI reading the links from the config file. |
Tried it and it worked! |
c5b69cd
to
b8e48d6
Compare
b8e48d6
to
67b24b2
Compare
Catherine and I talked on the side about whether we should also display the current Kibana profile link alongside the Cloud profile/account/security links. It seems that would be necessary as it allows users to reset their kibana password. For the time being, we've decided to leave it in and temporarily name the Cloud profile link as 'Cloud profile' (accompanied by the Cloud logo in lieu of the user icon). This will be revisited once the Cloud design and API work is complete. At that time, we can discuss as a group and determine the final names, icons, etc. |
7507d54
to
14e71bd
Compare
ACK: will review on Monday |
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 wonder if it would be better to invert the dependencies here a bit and have the security plugin expose an API for adding new links to the dropdown. Advantages of this would be:
- It's more flexible, other plugins can also add more links to this dropdown
- We can keep all the cloud-specific bits in the Cloud plugin rather than spreading it out over the codebase
@elastic/kibana-security thoughts?
++ I'd rather see the |
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.
Small suggestion, code looks good.
.securityNavControlComponent__logoutLink { | ||
border-top: $euiBorderThin; | ||
} |
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'd remove this or only apply it if cloud links exist. It looks a bit odd when there's only two items.
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 ended up using the separator menu item instead of relying on CSS to add that divider. https://github.com/elastic/kibana/pull/66825/files#diff-244d6513d4e0e5f7effeaa007127777d567372db67bf0e3ae54bbea6481bd2a8R160
@joshdover @legrego That makes a lot of sense. Let me switch this PR back into a WIP while I rework this feature and reverse the dependencies. |
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.
Looks good! Well aligned to the Cloud UI menu (though they need to add the buffer
prop as well 😉 ) and leaves us in a good spot to iron on the final links (profile vs cloud profile, etc.).
Thanks!
@@ -103,44 +183,8 @@ export class SecurityNavControl extends Component<Props, State> { | |||
closePopover={this.closeMenu} | |||
panelPaddingSize="none" | |||
> |
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.
Adding a buffer={0}
here will make the popover open below the button, regardless of the popover content. (🎩 hat tip @cchaos )
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.
Accidentally approved, need to add that buffer={0}
prop.
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
distributable file count
page load bundle size
History
To update your PR or re-run it, just comment with: |
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's certainly more to be sorted out here. The general premise we're after is that the top header is truly global and that we don't differentiate between Cloud UI and Kibana UI. Now, there's a lot of related work that needs to happen for this to become reality, but I would refrain from separating things out. Given that, we may want to replace the Cloud logo, ultimately.
My preference would be to get this PR merged since Catherine is headed back to Canvas 😢 , and then move our discussion to #82755 . We've got time to sort this out before the Cloud side catches up at which point this 'turns on'.
@ryankeairns That works for me.
I'm surprised to find this was merged without codeowners approval?
addUserMenuLinks: (userMenuLink: UserMenuLink[]) => { | ||
this.userMenuLinks$.next(userMenuLink); | ||
}, |
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 don't think this was in the spirit of what @pgayvallet and I were asking for. next
will still replace the previously added links with whatever is provided by the subsequent caller.
The reason we asked this to be changed to addUserMenuLinks
was so that multiple plugins could register menu links without clobbering the links that other plugins may have added.
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.
Sorry for merging prematurely! I got a little too excited, and I thought I addressed all of your feedback. I misunderstood the ask as just a rename. I'll go ahead and revert the commit, and open a new PR.
Summary
Closes #62863.
Related to https://github.com/elastic/cloud/issues/57695.
This converts the Kibana user menu to a context menu and adds cloud links to the user menu in the global nav. This works off of the assumption that the URLs for the additional cloud links will be configured in the
kibana.yml
.Non-cloud user
Cloud user
To test
You can mock enabling the cloud plugin locally by defining a cloud ID and providing the urls for the profile links added in this PR in your
kibana.dev.yml
, like so:Checklist
Delete any items that are not applicable to this PR.
For maintainers