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][List Details Page]: Fix exception list details page route and adding breadcrumb #145605

Merged
merged 21 commits into from
Nov 21, 2022

Conversation

WafaaNasr
Copy link
Contributor

@WafaaNasr WafaaNasr commented Nov 17, 2022

Summary

As per this discussion

  • Remove the Exception-List-details definition from the management links and deep_links because it is a dynamic route

  • Use the Rule Exceptions page title for list details

  • Add breadcrumb for the details list page

@WafaaNasr WafaaNasr added release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Security Solution Platform Security Solution Platform Team v8.6.0 labels Nov 17, 2022
@WafaaNasr WafaaNasr self-assigned this Nov 17, 2022
@WafaaNasr WafaaNasr requested a review from a team as a code owner November 17, 2022 18:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@WafaaNasr WafaaNasr requested review from a team as code owners November 17, 2022 20:06
@WafaaNasr WafaaNasr removed the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Nov 17, 2022
@WafaaNasr WafaaNasr changed the title [Security Solution][List Details Page]: Fix Not found page [Security Solution][List Details Page]: Fix List details page issues Nov 17, 2022
@WafaaNasr WafaaNasr changed the title [Security Solution][List Details Page]: Fix List details page issues [Security Solution][List Details Page]: Fix exception shared list details page issues Nov 17, 2022
@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@nkhristinin nkhristinin left a comment

Choose a reason for hiding this comment

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

LGTM!

@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

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.

Hi! Thanks for this PR,

I see one problem that was carried from a previous PR already merged.

The problem is exceptionListDetails link should not exist as a SecurityPageName . The SecurityPageName have main sections only, the ones that have a static link. This new path (/exceptions/details/:exceptionListId) is dynamic, so it should be considered just a part of the SecurityPageName.exceptions (/exceptions) page.

It seems there's been some confusion lately about static and dynamic paths and the links config. We will create a new doc page explaining that soon.

Changes

The exceptionListDetails should not exist in the management links config. The same for the old config deep_links, though this one will be removed shortly.

The exceptionListDetails id should not exist as a SecurityPageName.

The Page Title will be Exceptions if we use <SpyRoute pageName={SecurityPageName.exceptions} />.

Could you please do these changes?

Comment on lines 148 to 149
deepLinkId: SecurityPageName.exceptionListDetails,
path: `/exceptions/details/${exceptionsList.list_id}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
deepLinkId: SecurityPageName.exceptionListDetails,
path: `/exceptions/details/${exceptionsList.list_id}`,
deepLinkId: SecurityPageName.exceptions,
path: `/details/${exceptionsList.list_id}`,

<ListsDetailView />
<SpyRoute pageName={SecurityPageName.sharedExceptionListDetails} />
<SpyRoute pageName={SecurityPageName.exceptionListDetails} />
Copy link
Contributor

@semd semd Nov 18, 2022

Choose a reason for hiding this comment

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

This pageName should not be used here, since it is a dynamic page, we should keep using pageName={SecurityPageName.exception}.

If we want to generate a trailing breadcrumb with the exceptionList name we could add a state prop:

<SpyRoute pageName={SecurityPageName.exceptions} state={{ exceptionListName }}/>

(not here, somewhere we have the exceptionList name defined)

And create a trailing breadcrumbs module similar to:

@WafaaNasr WafaaNasr changed the title [Security Solution][List Details Page]: Fix exception shared list details page issues [Security Solution][List Details Page]: Fix exception shared list details page name Nov 21, 2022
@WafaaNasr WafaaNasr requested a review from a team as a code owner November 21, 2022 12:15
@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@WafaaNasr WafaaNasr changed the title [Security Solution][List Details Page]: Fix exception shared list details page name [Security Solution][List Details Page]: Fix exception list details page route and adding breadcrumb Nov 21, 2022
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.

@WafaaNasr The links implementation LGTM! 🚀
Thanks for doing the changes. I left just one NIT.

Comment on lines 27 to 30
href: getSecuritySolutionUrl({
deepLinkId: SecurityPageName.exceptions,
path: '',
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: This href prop is not strictly correct, it points to the main /exceptions path instead of the list detail page. Since this is the last breadcrumb, it is not clickable, the href prop is not needed, so we could just remove it by now.

However, if someday we need to append another breadcrumb after it, we will have to define the list detail href to make this breadcrumb (not the last one anymore) clickable. To do so, we would need to get the exception list id and generate the /detail/[id] path.
The generic way to do it would be to rename the /:exceptionListId parameter in the path by the generic /:detailName param name, this way we could generate the detail/${params.detailName} here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @semd for the details explanations, done here b324582

Copy link
Contributor

@gergoabraham gergoabraham left a comment

Choose a reason for hiding this comment

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

onboarding and lifecycle management code changes look great!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3309 3310 +1

Async chunks

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

id before after diff
securitySolution 9.7MB 9.7MB +732.0B

Page load bundle

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

id before after diff
securitySolution 50.9KB 50.8KB -160.0B
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 442 448 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 67 73 +6
osquery 110 117 +7
securitySolution 519 525 +6
total +21

History

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

cc @WafaaNasr

@WafaaNasr WafaaNasr merged commit 62d9dff into elastic:main Nov 21, 2022
@WafaaNasr WafaaNasr deleted the 145548-shared-page-details branch November 21, 2022 15:38
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.6 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 145605

Questions ?

Please refer to the Backport tool documentation

@WafaaNasr WafaaNasr added the backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) label Nov 21, 2022
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.6 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 145605

Questions ?

Please refer to the Backport tool documentation

@WafaaNasr
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

WafaaNasr added a commit that referenced this pull request Nov 22, 2022
…ails` page route and adding breadcrumb (#145605) (#145960)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Security Solution][List Details Page]: Fix `exception list details`
page route and adding breadcrumb
(#145605)](#145605)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Wafaa
Nasr","email":"wafaa.nasr@elastic.co"},"sourceCommit":{"committedDate":"2022-11-21T15:38:33Z","message":"[Security
Solution][List Details Page]: Fix `exception list details` page route
and adding breadcrumb (#145605)\n\n## Summary\r\n\r\nAs per
this\r\n[discussion](https://github.com/elastic/kibana/pull/145605#pullrequestreview-1186305242)\r\n\r\n-
Remove the `Exception-List-details` definition from the
[management\r\nlinks](https://github.com/elastic/kibana/blob/bb775883505bc0d81e487261244feab0a2011f6f/x-pack/plugins/security_solution/public/management/links.ts)\r\nand\r\n[deep_links](https://github.com/elastic/kibana/blob/bb775883505bc0d81e487261244feab0a2011f6f/x-pack/plugins/security_solution/public/app/deep_links/index.ts)\r\nbecause
it is a dynamic route\r\n\r\n- Use the `Rule Exceptions` page title for
list details\r\n- Add breadcrumb for the details list
page\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"62d9dffbb2d806f35e76dff361fcf9df0b9ce90b","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Security
Solution
Platform","backport:prev-minor","v8.6.0","v8.7.0"],"number":145605,"url":"https://github.com/elastic/kibana/pull/145605","mergeCommit":{"message":"[Security
Solution][List Details Page]: Fix `exception list details` page route
and adding breadcrumb (#145605)\n\n## Summary\r\n\r\nAs per
this\r\n[discussion](https://github.com/elastic/kibana/pull/145605#pullrequestreview-1186305242)\r\n\r\n-
Remove the `Exception-List-details` definition from the
[management\r\nlinks](https://github.com/elastic/kibana/blob/bb775883505bc0d81e487261244feab0a2011f6f/x-pack/plugins/security_solution/public/management/links.ts)\r\nand\r\n[deep_links](https://github.com/elastic/kibana/blob/bb775883505bc0d81e487261244feab0a2011f6f/x-pack/plugins/security_solution/public/app/deep_links/index.ts)\r\nbecause
it is a dynamic route\r\n\r\n- Use the `Rule Exceptions` page title for
list details\r\n- Add breadcrumb for the details list
page\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"62d9dffbb2d806f35e76dff361fcf9df0b9ce90b"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145605","number":145605,"mergeCommit":{"message":"[Security
Solution][List Details Page]: Fix `exception list details` page route
and adding breadcrumb (#145605)\n\n## Summary\r\n\r\nAs per
this\r\n[discussion](https://github.com/elastic/kibana/pull/145605#pullrequestreview-1186305242)\r\n\r\n-
Remove the `Exception-List-details` definition from the
[management\r\nlinks](https://github.com/elastic/kibana/blob/bb775883505bc0d81e487261244feab0a2011f6f/x-pack/plugins/security_solution/public/management/links.ts)\r\nand\r\n[deep_links](https://github.com/elastic/kibana/blob/bb775883505bc0d81e487261244feab0a2011f6f/x-pack/plugins/security_solution/public/app/deep_links/index.ts)\r\nbecause
it is a dynamic route\r\n\r\n- Use the `Rule Exceptions` page title for
list details\r\n- Add breadcrumb for the details list
page\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"62d9dffbb2d806f35e76dff361fcf9df0b9ce90b"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:fix Team:Security Solution Platform Security Solution Platform Team v8.6.0 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants