-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Remove SavedObjects client UI for CTI and risk sc…
…ores module (#156213) ## Summary issue: #155995 1. Remove SO client from UI. 2. Replace **Kibana** dashboard url with **Security** dashboard url in threat intel overview. ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co> Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
- Loading branch information
1 parent
6f5f7d0
commit 973f4f3
Showing
57 changed files
with
1,133 additions
and
906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
x-pack/plugins/security_solution/public/common/containers/dashboards/__mocks__/utils.ts
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
x-pack/plugins/security_solution/public/common/containers/dashboards/api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { HttpSetup } from '@kbn/core/public'; | ||
import { INTERNAL_DASHBOARDS_URL } from '../../../../common/constants'; | ||
|
||
export interface Dashboard { | ||
id: string; | ||
type: string; | ||
attributes: { | ||
title: string; | ||
description: string; | ||
}; | ||
references: Array<{ name: string; type: string; id: string }>; | ||
} | ||
|
||
export const getDashboardsByTagIds = ( | ||
{ http, tagIds }: { http: HttpSetup; tagIds: string[] }, | ||
abortSignal?: AbortSignal | ||
): Promise<Dashboard[] | null> => | ||
http.post(INTERNAL_DASHBOARDS_URL, { | ||
body: JSON.stringify({ tagIds }), | ||
signal: abortSignal, | ||
}); |
20 changes: 0 additions & 20 deletions
20
x-pack/plugins/security_solution/public/common/containers/dashboards/api/index.ts
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
...curity_solution/public/common/containers/dashboards/use_create_security_dashboard_link.ts
This file was deleted.
Oops, something went wrong.
86 changes: 0 additions & 86 deletions
86
x-pack/plugins/security_solution/public/common/containers/dashboards/utils.test.ts
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
x-pack/plugins/security_solution/public/common/containers/dashboards/utils.ts
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
x-pack/plugins/security_solution/public/common/containers/tags/__mocks__/api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export const MOCK_TAG_ID = 'securityTagId'; | ||
|
||
export const DEFAULT_TAGS_RESPONSE = [ | ||
{ | ||
id: MOCK_TAG_ID, | ||
name: 'test tag', | ||
description: 'test tag description', | ||
color: '#2c7b82', | ||
}, | ||
]; | ||
|
||
export const getTagsByName = jest | ||
.fn() | ||
.mockImplementation(() => Promise.resolve(DEFAULT_TAGS_RESPONSE)); | ||
export const createTag = jest | ||
.fn() | ||
.mockImplementation(() => Promise.resolve(DEFAULT_TAGS_RESPONSE[0])); |
25 changes: 25 additions & 0 deletions
25
x-pack/plugins/security_solution/public/common/containers/tags/api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { HttpSetup } from '@kbn/core/public'; | ||
import type { Tag } from '@kbn/saved-objects-tagging-plugin/public'; | ||
import type { TagAttributes } from '@kbn/saved-objects-tagging-plugin/common'; | ||
import { INTERNAL_TAGS_URL } from '../../../../common/constants'; | ||
|
||
export const getTagsByName = ( | ||
{ http, tagName }: { http: HttpSetup; tagName: string }, | ||
abortSignal?: AbortSignal | ||
): Promise<Tag[]> => http.get(INTERNAL_TAGS_URL, { query: { name: tagName }, signal: abortSignal }); | ||
|
||
export const createTag = ( | ||
{ http, tag }: { http: HttpSetup; tag: Omit<TagAttributes, 'color'> & { color?: string } }, | ||
abortSignal?: AbortSignal | ||
): Promise<Tag> => | ||
http.put(INTERNAL_TAGS_URL, { | ||
body: JSON.stringify(tag), | ||
signal: abortSignal, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.