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

[Security Solution][Navigation] Migrate Security Solutions 'explore' tab group to deep link navigation #102306

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Jun 16, 2021

Migrate Security Solutions explore tab group to deep-link navigation.

It includes

  • Update navigateToApp and getUrlForApp to provide the deepLinkId
  • Update Hosts and Network routes to start from /hosts and /network
  • Add Hosts and Network to side nav menu under "Explore" menu group
  • Delete Hosts and Network old menu code
  • Fix broken tests

Screenshot 2021-06-22 at 18 28 36

Checklist

@machadoum machadoum requested review from angorayc and semd June 16, 2021 08:36
@machadoum machadoum self-assigned this Jun 16, 2021
@machadoum machadoum requested review from a team as code owners June 16, 2021 08:36
Copy link
Member

@Bamieh Bamieh left a comment

Choose a reason for hiding this comment

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

Telemetry changes LGTM (application usage schema).

@machadoum machadoum force-pushed the security-navigation-hosts-1101 branch from 71b8286 to f373e68 Compare June 17, 2021 12:08
@machadoum machadoum requested a review from a team as a code owner June 17, 2021 12:08
@machadoum machadoum marked this pull request as draft June 17, 2021 12:10
@machadoum machadoum changed the title Migrate Security Solutions '/hosts' to deep link navigation Migrate Security Solutions 'explore' tab group to deep link navigation Jun 17, 2021
@machadoum machadoum force-pushed the security-navigation-hosts-1101 branch from 96185ec to 1eaca2b Compare June 17, 2021 12:27
const handleClick = useCallback(
(ev) => {
ev.preventDefault();
if (id in SecurityPageName && pageId == null) {
Copy link
Member Author

@machadoum machadoum Jun 17, 2021

Choose a reason for hiding this comment

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

Internal tab navigation doesn't require all this logic because it only navigates between tabs of a Sub-plugin and not between Sub-plugins.

FYI: @michaelolo24

Comment on lines -66 to -67
urlKey: 'administration',
pageId: SecurityPageName.administration,
Copy link
Contributor

@semd semd Jun 17, 2021

Choose a reason for hiding this comment

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

These urlKey and pageId are not needed anymore? just to understand

Copy link
Member Author

@machadoum machadoum Jun 18, 2021

Choose a reason for hiding this comment

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

Now that SecuritySolutionTabNavigation is only used for SubPlugins internal tabs (Network, Hosts, and Administration), I could delete the logic for handling the navigation between SubPlugins. It includes deleting urlKey and pageId.

  • urlKey was used for building a new query string for a SubPlugin. since all tabs are inside a subPlugin, the query string is always the same.
  • pageId was used to determine if the tab link should navigate to a new SubPlugin or an internal tab. Now it always navigates to an internal tab with history.push.

Unfortunately, both tab navigations, Side and Internal, are using the same types. I took a quick look, and modify it would require many changes.

@machadoum machadoum force-pushed the security-navigation-hosts-1101 branch from e4709cc to 9811963 Compare June 18, 2021 11:09
@machadoum machadoum force-pushed the security-navigation-hosts-1101 branch from 9811963 to 54e115b Compare June 18, 2021 11:17
@machadoum machadoum changed the title Migrate Security Solutions 'explore' tab group to deep link navigation [Security Solution][Navigation] Migrate Security Solutions 'explore' tab group to deep link navigation Jun 18, 2021
@machadoum machadoum force-pushed the security-navigation-hosts-1101 branch from 54e115b to 886990a Compare June 18, 2021 15:17
@machadoum machadoum force-pushed the security-navigation-hosts-1101 branch from 886990a to f0f60f8 Compare June 21, 2021 09:12
@machadoum machadoum marked this pull request as ready for review June 21, 2021 12:27
@machadoum machadoum requested review from XavierM and cnasikas June 21, 2021 12:31
Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

Merging this PR to start integration with other sections. The missing parts will be done in another PR.

@machadoum machadoum merged commit 796b649 into elastic:security-navigation-1101 Jun 22, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

cc @machadoum

michaelolo24 pushed a commit to michaelolo24/kibana that referenced this pull request Jun 23, 2021
…tab group to deep link navigation (elastic#102306)

* Update navigateToApp and getUrlForApp to provide the deepLinkId
* Update Hosts and Network routes to start from /hosts and /network
* Add Hosts and Network to side nav menu under "Explore" menu group
* Delete Hosts and Network old menu code
* Fix broken tests
XavierM pushed a commit that referenced this pull request Jun 24, 2021
…tab group to deep link navigation (#102306)

* Update navigateToApp and getUrlForApp to provide the deepLinkId
* Update Hosts and Network routes to start from /hosts and /network
* Add Hosts and Network to side nav menu under "Explore" menu group
* Delete Hosts and Network old menu code
* Fix broken tests
semd added a commit that referenced this pull request Jun 29, 2021
* [SecuritySolutions] [Navigation] Prepare new routing and migrate overview (#101733)

* prepare new routing and migrate overview

* test fix and todo comments identified

* telemetry using app views

* navigation groups implemented

* cleaning

* export subplugin routes as route props array

* [Security Solution][Navigation] Migrate Security Solutions 'explore' tab group to deep link navigation (#102306)

* Update navigateToApp and getUrlForApp to provide the deepLinkId
* Update Hosts and Network routes to start from /hosts and /network
* Add Hosts and Network to side nav menu under "Explore" menu group
* Delete Hosts and Network old menu code
* Fix broken tests

* [SecuritySolution] Add detections subplugin to deeplink (#101791)

* prepare new routing and migrate overview

* init nav deeplink

* split detections into rules and alerts

* init exception link

* init detections

* link to rules creation page

* link to rules creation page

* rename detections to alerts

* fix unit tests

* fix rules creation page

* remove console

* fix lint error

* fix unit tests

* fix unit tests

* isolating rules and exceptions page

* replace history push with navigateToApp

* fix unit test

* temporary fix for createCoreStartMock

* update cypress

* skip failing cypress

* skip failing cypress

Co-authored-by: semd <sergi.massaneda@elastic.co>

* Migrate "Investigate" tab group to new side navigation (#102705)

* Migrate "Investigate" tab group to new side navigation

It includes:
* Timelines
* Cases

* Quick fix useFormatUrl and HeaderPage navigation

* [Security Solutions] Management navigation (#102685)

* prepare new routing and migrate overview

* test fix and todo comments identified

* telemetry using app views

* navigation groups implemented

* cleaning

* export subplugin routes as route props array

* breadcrumbs changes and sidenav generation improvements

* jest tests for breadcrumbs and navigation changes

* retrocompatibility for sections that are not yet migrated to deepLinks

* management deepLinks and plugin refactoring

* home navigation changes

* management navigation migrated to deeplinks

* jest tests fixed

* header page back link improved and tests fixed

* type errors fixes

* improve home navigation encapsulation

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* Fix type checking

* export header page

* fix padding

* add redirect routes

* unskip detection cypress

* fix i18n

* fix create your own rules btn

* fix cancel button on rules creation page

* test fixes

* fix breadcrumbs for rules pages

* unit test fixes

* additional fixes

* [Security Solutions] Navigation usage tracker and general changes (#103271)

* [Security Solutions] use of currentAppId$ migrated. and some small fixes

* unused constants removed

* remove unused constant

* test fix and types

* fix cypress

* fix cypress tests

* Fix case navTab permission and tests

* Revert 'timeline.isOpen' breadcrumb code that was deleted during merge

* Fix useInsertTimeline test by removing '/'

* change global navigation visible deeplinks

* fix /admininstration top level redirect to

* fix global search icon, nav order and overview hosts link

* update start a new case link

* fix rules link in exception list table

* unskip cypress tests

* update rules link

* fix full screen timeline

* fixing broken links and administration telemetry split

* remove unused comments

* remove timeline z-index and cleanup global header component

* some minor fixes

* add unit tests for detections breadcrumbs

* remove case to  global/search nav when cases is none

* rename test scenario

* fix side_panel flyout

* fix cases use cases between search/gobal nav

* timeline snapshot regenerated and cypres test fixed

* rollback management tracking split as it causes unexpected errors on the telemetry component

Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
semd added a commit to semd/kibana that referenced this pull request Jun 29, 2021
* [SecuritySolutions] [Navigation] Prepare new routing and migrate overview (elastic#101733)

* prepare new routing and migrate overview

* test fix and todo comments identified

* telemetry using app views

* navigation groups implemented

* cleaning

* export subplugin routes as route props array

* [Security Solution][Navigation] Migrate Security Solutions 'explore' tab group to deep link navigation (elastic#102306)

* Update navigateToApp and getUrlForApp to provide the deepLinkId
* Update Hosts and Network routes to start from /hosts and /network
* Add Hosts and Network to side nav menu under "Explore" menu group
* Delete Hosts and Network old menu code
* Fix broken tests

* [SecuritySolution] Add detections subplugin to deeplink (elastic#101791)

* prepare new routing and migrate overview

* init nav deeplink

* split detections into rules and alerts

* init exception link

* init detections

* link to rules creation page

* link to rules creation page

* rename detections to alerts

* fix unit tests

* fix rules creation page

* remove console

* fix lint error

* fix unit tests

* fix unit tests

* isolating rules and exceptions page

* replace history push with navigateToApp

* fix unit test

* temporary fix for createCoreStartMock

* update cypress

* skip failing cypress

* skip failing cypress

Co-authored-by: semd <sergi.massaneda@elastic.co>

* Migrate "Investigate" tab group to new side navigation (elastic#102705)

* Migrate "Investigate" tab group to new side navigation

It includes:
* Timelines
* Cases

* Quick fix useFormatUrl and HeaderPage navigation

* [Security Solutions] Management navigation (elastic#102685)

* prepare new routing and migrate overview

* test fix and todo comments identified

* telemetry using app views

* navigation groups implemented

* cleaning

* export subplugin routes as route props array

* breadcrumbs changes and sidenav generation improvements

* jest tests for breadcrumbs and navigation changes

* retrocompatibility for sections that are not yet migrated to deepLinks

* management deepLinks and plugin refactoring

* home navigation changes

* management navigation migrated to deeplinks

* jest tests fixed

* header page back link improved and tests fixed

* type errors fixes

* improve home navigation encapsulation

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* Fix type checking

* export header page

* fix padding

* add redirect routes

* unskip detection cypress

* fix i18n

* fix create your own rules btn

* fix cancel button on rules creation page

* test fixes

* fix breadcrumbs for rules pages

* unit test fixes

* additional fixes

* [Security Solutions] Navigation usage tracker and general changes (elastic#103271)

* [Security Solutions] use of currentAppId$ migrated. and some small fixes

* unused constants removed

* remove unused constant

* test fix and types

* fix cypress

* fix cypress tests

* Fix case navTab permission and tests

* Revert 'timeline.isOpen' breadcrumb code that was deleted during merge

* Fix useInsertTimeline test by removing '/'

* change global navigation visible deeplinks

* fix /admininstration top level redirect to

* fix global search icon, nav order and overview hosts link

* update start a new case link

* fix rules link in exception list table

* unskip cypress tests

* update rules link

* fix full screen timeline

* fixing broken links and administration telemetry split

* remove unused comments

* remove timeline z-index and cleanup global header component

* some minor fixes

* add unit tests for detections breadcrumbs

* remove case to  global/search nav when cases is none

* rename test scenario

* fix side_panel flyout

* fix cases use cases between search/gobal nav

* timeline snapshot regenerated and cypres test fixed

* rollback management tracking split as it causes unexpected errors on the telemetry component

Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
semd added a commit that referenced this pull request Jun 29, 2021
* [SecuritySolutions] [Navigation] Prepare new routing and migrate overview (#101733)

* prepare new routing and migrate overview

* test fix and todo comments identified

* telemetry using app views

* navigation groups implemented

* cleaning

* export subplugin routes as route props array

* [Security Solution][Navigation] Migrate Security Solutions 'explore' tab group to deep link navigation (#102306)

* Update navigateToApp and getUrlForApp to provide the deepLinkId
* Update Hosts and Network routes to start from /hosts and /network
* Add Hosts and Network to side nav menu under "Explore" menu group
* Delete Hosts and Network old menu code
* Fix broken tests

* [SecuritySolution] Add detections subplugin to deeplink (#101791)

* prepare new routing and migrate overview

* init nav deeplink

* split detections into rules and alerts

* init exception link

* init detections

* link to rules creation page

* link to rules creation page

* rename detections to alerts

* fix unit tests

* fix rules creation page

* remove console

* fix lint error

* fix unit tests

* fix unit tests

* isolating rules and exceptions page

* replace history push with navigateToApp

* fix unit test

* temporary fix for createCoreStartMock

* update cypress

* skip failing cypress

* skip failing cypress

Co-authored-by: semd <sergi.massaneda@elastic.co>

* Migrate "Investigate" tab group to new side navigation (#102705)

* Migrate "Investigate" tab group to new side navigation

It includes:
* Timelines
* Cases

* Quick fix useFormatUrl and HeaderPage navigation

* [Security Solutions] Management navigation (#102685)

* prepare new routing and migrate overview

* test fix and todo comments identified

* telemetry using app views

* navigation groups implemented

* cleaning

* export subplugin routes as route props array

* breadcrumbs changes and sidenav generation improvements

* jest tests for breadcrumbs and navigation changes

* retrocompatibility for sections that are not yet migrated to deepLinks

* management deepLinks and plugin refactoring

* home navigation changes

* management navigation migrated to deeplinks

* jest tests fixed

* header page back link improved and tests fixed

* type errors fixes

* improve home navigation encapsulation

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* Fix type checking

* export header page

* fix padding

* add redirect routes

* unskip detection cypress

* fix i18n

* fix create your own rules btn

* fix cancel button on rules creation page

* test fixes

* fix breadcrumbs for rules pages

* unit test fixes

* additional fixes

* [Security Solutions] Navigation usage tracker and general changes (#103271)

* [Security Solutions] use of currentAppId$ migrated. and some small fixes

* unused constants removed

* remove unused constant

* test fix and types

* fix cypress

* fix cypress tests

* Fix case navTab permission and tests

* Revert 'timeline.isOpen' breadcrumb code that was deleted during merge

* Fix useInsertTimeline test by removing '/'

* change global navigation visible deeplinks

* fix /admininstration top level redirect to

* fix global search icon, nav order and overview hosts link

* update start a new case link

* fix rules link in exception list table

* unskip cypress tests

* update rules link

* fix full screen timeline

* fixing broken links and administration telemetry split

* remove unused comments

* remove timeline z-index and cleanup global header component

* some minor fixes

* add unit tests for detections breadcrumbs

* remove case to  global/search nav when cases is none

* rename test scenario

* fix side_panel flyout

* fix cases use cases between search/gobal nav

* timeline snapshot regenerated and cypres test fixed

* rollback management tracking split as it causes unexpected errors on the telemetry component

Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>

Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants