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

Adds cloud links to user menu #82803

Merged
merged 19 commits into from
Nov 10, 2020
Merged

Adds cloud links to user menu #82803

merged 19 commits into from
Nov 10, 2020

Conversation

cqliu1
Copy link
Contributor

@cqliu1 cqliu1 commented Nov 6, 2020

Summary

Reattempt at #66825.
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

Screen Shot 2020-11-04 at 2 06 33 PM

Cloud user

Screen Shot 2020-11-05 at 4 20 10 PM

Notable changes

  • adds addUserMenuLinks and getUserMenuLinks$ to the start method of the SecurityNavControlService in the security plugin to allow other plugins to add links to the user menu in the global nav
  • adds resetPasswordUrl and accountUrl to cloud plugin config

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:

# Enable cloud plugin
xpack.cloud.id: 'eastus2.azure.elastic-cloud.com:9243$59ef636c6917463db140321484d63cfa$a8b109c08adc43279ef48f29af1a3911'
xpack.cloud.resetPasswordUrl: 'https://cloud.elastic.co/user/settings' # Cloud profile link
xpack.cloud.accountUrl: 'https://cloud.elastic.co/account/activity' # Account link

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cqliu1 cqliu1 added REASSIGN from Team:Core UI Deprecated label for old Core UI team v7.11.0 v8.0.0 enhancement New value added to drive a business result release_note:enhancement review labels Nov 6, 2020
@cqliu1
Copy link
Contributor Author

cqliu1 commented Nov 6, 2020

RE: feedback from #66825 (review)

@legrego @pgayvallet 1c8074b should properly address your feedback and retain all registered user menu links when addUserMenuLinks is called multiple times.

@cqliu1 cqliu1 marked this pull request as ready for review November 6, 2020 04:36
@cqliu1 cqliu1 requested a review from a team November 6, 2020 04:36
@cqliu1 cqliu1 requested review from a team as code owners November 6, 2020 04:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core-ui (Team:Core UI)

@cqliu1 cqliu1 requested a review from legrego November 6, 2020 04:36
@cqliu1 cqliu1 added the Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! label Nov 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

@cqliu1 thanks for taking the time to revert the previous PR to address our feedback ❤️.

Your most recent changes look good to me! My one request before approving is to add tests to cover the new functions that the security plugin is exposing as part of its public contract (addUserMenuLinks and getUserMenuLinks$). The existing x-pack/plugins/security/public/nav_control/nav_control_service.test.ts would be a good place for this.

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM for cloud plugin changes.

@cqliu1
Copy link
Contributor Author

cqliu1 commented Nov 9, 2020

@legrego This is ready for another look. I've added tests for the nav control service.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cloud 6 7 +1
security 460 469 +9
total +10

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
security 814.3KB 784.2KB -30.1KB

Distributable file count

id before after diff
default 42766 42767 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cloud 5.2KB 6.1KB +942.0B
security 151.4KB 162.4KB +11.0KB
total +11.9KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@cqliu1 cqliu1 merged commit 4dba10c into elastic:master Nov 10, 2020
@cqliu1 cqliu1 deleted the cloud-profile-link branch November 10, 2020 15:51
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Nov 10, 2020
phillipb added a commit to phillipb/kibana that referenced this pull request Nov 10, 2020
…kibana into bootstrap-node-details-overlay

* 'bootstrap-node-details-overlay' of github.com:phillipb/kibana: (49 commits)
  [Security Solution] Fix DNS Network table query (elastic#82778)
  [Workplace Search] Consolidate groups routes (elastic#83015)
  Adds cloud links to user menu (elastic#82803)
  [Security Solution][Detections] - follow up cleanup on auto refresh rules (elastic#83023)
  [App Search] Added the log retention panel to the Settings page (elastic#82982)
  [Maps] show icon when layer is filtered by time and allow layers to ignore global time range (elastic#83006)
  [DOCS] Consolidates drilldown pages (elastic#82081)
  [Maps] add on-prem EMS config (elastic#82525)
  migrate i18n mixin to KP (elastic#81799)
  [bundle optimization] fix imports of react-use lib (elastic#82847)
  [Discover] Add metric on adding filter (elastic#82961)
  [Lens] Performance refactoring for indexpattern fast lookup and Operation support matrix computation (elastic#82829)
  skip flaky suite (elastic#82804)
  Fix SO query for searching across spaces (elastic#83025)
  renaming built-in alerts to Stack Alerts (elastic#82873)
  [TSVB] Disable using top_hits in pipeline aggregations (elastic#82278)
  [Visualizations] Remove kui usage (elastic#82810)
  [Visualizations] Make the icon buttons labels more descriptive (elastic#82585)
  [Lens] Do not reset formatting when switching between custom ranges and auto histogram (elastic#82694)
  Fix ilm navigation (elastic#81664)
  ...
cqliu1 added a commit that referenced this pull request Nov 10, 2020
Co-authored-by: Ryan Keairns <[email protected]>

Co-authored-by: Ryan Keairns <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 10, 2020
…na into alerts/stack-alerts-public

* 'alerts/stack-alerts-public' of github.com:gmmorris/kibana:
  [Security Solution] Fix DNS Network table query (elastic#82778)
  [Workplace Search] Consolidate groups routes (elastic#83015)
  Adds cloud links to user menu (elastic#82803)
  [Security Solution][Detections] - follow up cleanup on auto refresh rules (elastic#83023)
  [App Search] Added the log retention panel to the Settings page (elastic#82982)
  [Maps] show icon when layer is filtered by time and allow layers to ignore global time range (elastic#83006)
  [DOCS] Consolidates drilldown pages (elastic#82081)
  [Maps] add on-prem EMS config (elastic#82525)
  migrate i18n mixin to KP (elastic#81799)
  [bundle optimization] fix imports of react-use lib (elastic#82847)
  [Discover] Add metric on adding filter (elastic#82961)
  [Lens] Performance refactoring for indexpattern fast lookup and Operation support matrix computation (elastic#82829)
  skip flaky suite (elastic#82804)
  Fix SO query for searching across spaces (elastic#83025)
  renaming built-in alerts to Stack Alerts (elastic#82873)
  [TSVB] Disable using top_hits in pipeline aggregations (elastic#82278)
  [Visualizations] Remove kui usage (elastic#82810)
  [Visualizations] Make the icon buttons labels more descriptive (elastic#82585)
  [Lens] Do not reset formatting when switching between custom ranges and auto histogram (elastic#82694)
:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result REASSIGN from Team:Core UI Deprecated label for old Core UI team release_note:enhancement review Team:Cloud Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render Cloud links in the Kibana user profile dropdown
6 participants