Skip to content

Commit

Permalink
[8.12] [Security Solution] Fix misaligned top nav (#175516) (#175532)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.12`:
- [[Security Solution] Fix misaligned top nav
(#175516)](#175516)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Angela
Chuang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-25T12:39:12Z","message":"[Security
Solution] Fix misaligned top nav (#175516)\n\n## Summary\r\n\r\nIssue
and steps to
reproduce:\r\nhttps://github.com//issues/171682\r\n\r\nBefore:\r\n\r\n<img
width=\"1728\"
alt=\"misaligned\"\r\nsrc=\"https://github.com/elastic/kibana/assets/7074629/6c0f8484-7bfb-4329-9029-b53a3c118047\">\r\n\r\n\r\nAfter:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/6295984/58d3e5bc-0a9a-475b-99dd-00e061b8c4b1\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"a8f538d15cc40be82bf5abf697a94ee2a5f0466f","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Threat
Hunting","Team:Threat Hunting:Explore","Feature:Security
Dashboards","v8.12.1","v8.13.0"],"title":"[Security Solution] Fix
misaligned top
nav","number":175516,"url":"https://github.com/elastic/kibana/pull/175516","mergeCommit":{"message":"[Security
Solution] Fix misaligned top nav (#175516)\n\n## Summary\r\n\r\nIssue
and steps to
reproduce:\r\nhttps://github.com//issues/171682\r\n\r\nBefore:\r\n\r\n<img
width=\"1728\"
alt=\"misaligned\"\r\nsrc=\"https://github.com/elastic/kibana/assets/7074629/6c0f8484-7bfb-4329-9029-b53a3c118047\">\r\n\r\n\r\nAfter:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/6295984/58d3e5bc-0a9a-475b-99dd-00e061b8c4b1\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"a8f538d15cc40be82bf5abf697a94ee2a5f0466f"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175516","number":175516,"mergeCommit":{"message":"[Security
Solution] Fix misaligned top nav (#175516)\n\n## Summary\r\n\r\nIssue
and steps to
reproduce:\r\nhttps://github.com//issues/171682\r\n\r\nBefore:\r\n\r\n<img
width=\"1728\"
alt=\"misaligned\"\r\nsrc=\"https://github.com/elastic/kibana/assets/7074629/6c0f8484-7bfb-4329-9029-b53a3c118047\">\r\n\r\n\r\nAfter:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/6295984/58d3e5bc-0a9a-475b-99dd-00e061b8c4b1\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"a8f538d15cc40be82bf5abf697a94ee2a5f0466f"}}]}]
BACKPORT-->

Co-authored-by: Angela Chuang <[email protected]>
  • Loading branch information
kibanamachine and angorayc authored Jan 25, 2024
1 parent b4d153e commit 836d11c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions x-pack/plugins/security_solution/public/helpers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
isSubPluginAvailable,
getSubPluginRoutesByCapabilities,
getField,
isDashboardViewPath,
} from './helpers';
import type { StartedSubPlugins } from './types';
import {
Expand Down Expand Up @@ -257,3 +258,23 @@ describe('public helpers getField', () => {
expect(signalQuery).toEqual(aadQuery);
});
});

describe('isDashboardViewPath', () => {
it('returns true for dashboard view path', () => {
expect(isDashboardViewPath('/dashboards/59c085c3-394d-49ab-a83a-56a63f38aa5f')).toEqual(true);
});

it('returns true for dashboard edit path', () => {
expect(isDashboardViewPath('/dashboards/59c085c3-394d-49ab-a83a-56a63f38aa5f/edit')).toEqual(
true
);
});

it('returns true for dashboard creation path', () => {
expect(isDashboardViewPath('/dashboards/create')).toEqual(true);
});

it('returns false for dashboard listing path', () => {
expect(isDashboardViewPath('/dashboards')).toEqual(false);
});
});
2 changes: 1 addition & 1 deletion x-pack/plugins/security_solution/public/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const isDetectionsPath = (pathname: string): boolean => {

export const isDashboardViewPath = (pathname: string): boolean =>
matchPath(pathname, {
path: `/${DASHBOARDS_PATH}/:id`,
path: `${DASHBOARDS_PATH}/:detailName`,
exact: false,
strict: false,
}) != null;
Expand Down

0 comments on commit 836d11c

Please sign in to comment.