-
Notifications
You must be signed in to change notification settings - Fork 8.5k
kibana-cloud-security-posture owned UX adjustment for borealis #205136
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
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
7fdda71
review the use of success colors
maxcold 76c495a
mark euiColorVis usage with TODOs
maxcold 0461c8d
add todo for replacing hardcoded color
maxcold 081b0fb
update comments
maxcold 534662a
add TODO regarding discontinue of euiThemeVars
maxcold 73e762f
Merge branch 'main' into csp-update-to-borealis
maxcold 324d4b2
implement vuln severity color utils for borealis
maxcold 58f7c58
replace border color with color token for cvss badge
maxcold 4dc1687
replace misconfig colors with color tokens from euiTheme
maxcold 723fc89
remove euiPaletteColorBlindBehindText usage from cloud_defend
maxcold 4da5c31
replace euiThemeVars for nvd logo
maxcold d058d36
replace euiThemeVars with euiTheme in findings flyout
maxcold 4331c44
replace EuiThemeVars with euiTheme in vulnerability flyout
maxcold 23123f0
replace euiThemeVars in vulnerability overview tab
maxcold a9fcb94
replace euiThemeVars in k8s_security routes
maxcold 55f8ab4
replace euiThemeVars with euiTheme for misconfig details table
maxcold 693d6f4
remove unused hook in session_view
maxcold 5405bd1
replace vis colors with color tokens for tree node buttons
maxcold 42816c6
use matching color from Borealis for tty control markers
maxcold 1d4635e
Merge branch 'main' into csp-update-to-borealis
maxcold 5aa0b99
clarify todos for vulnerability color palette
maxcold 5d74600
use getMisconfigurationStatusColor utility function for misconfig det…
maxcold 80e3202
create useMisconfigurationStatusColor hook and use instead of getMisc…
maxcold 6d51d79
use useGetCvsScoreColor instead of getCvsScoreColor
maxcold 8e91a02
introduce useGetSeverityStatusColor to avoid passing euiTheme around
maxcold b037cb8
fix eslint
maxcold 860cbec
introduce MisconfigurationEvaluationStatus type
maxcold 1559140
remove euiThemeVars from distribution bar stories
maxcold a360730
fix tests for get_findings_colors
maxcold f4e9eaa
rename get_finding_colors test file
maxcold d5dd00a
add clarifying comment
maxcold e036036
update todos for session_view
maxcold 1ea43b1
Merge branch 'main' into csp-update-to-borealis
maxcold 2c23441
Merge branch 'main' into csp-update-to-borealis
maxcold 6c0b8d7
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine c904efa
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 2d511a6
fix linting errors
maxcold 3886bc3
fix types
maxcold 9740b3e
fix types
maxcold 0f58306
hardcode colors for severity and failed/passed findings
maxcold 591571f
Merge branch 'main' into csp-update-to-borealis
maxcold cdb5557
fix test
maxcold bf8c679
remove unused color mocks
maxcold 4c349ce
add severity palette ticket to todos
maxcold 10b0525
Merge branch 'main' into csp-update-to-borealis
maxcold 31bf2c6
Merge branch 'main' into csp-update-to-borealis
maxcold 5703e77
Merge branch 'main' into csp-update-to-borealis
maxcold dd899e3
removed todos from k8s dashboard plugin to avoid conflicts with remov…
maxcold 87fa9b3
revert changes in k8s dashboard plugin as it is being removed from Ki…
maxcold 834501a
cr comments
maxcold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
8 changes: 8 additions & 0 deletions
8
x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/misconfigurations.ts
This file contains hidden or 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,8 @@ | ||
| /* | ||
| * 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 type MisconfigurationEvaluationStatus = 'passed' | 'failed' | 'unknown'; |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ | |
| }, | ||
| "include": ["**/*.ts", "**/*.tsx"], | ||
| "kbn_references": [ | ||
| "@kbn/ui-theme", | ||
| ], | ||
| "exclude": ["target/**/*"] | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
16 changes: 0 additions & 16 deletions
16
.../security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
.../security/packages/kbn-cloud-security-posture/public/src/hooks/use_get_cvs_score_color.ts
This file contains hidden or 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,20 @@ | ||
| /* | ||
| * 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 { useEuiTheme } from '@elastic/eui'; | ||
|
|
||
| import { getCvsScoreColor as getCvsScoreColorUtil } from '../..'; | ||
|
|
||
| export const useGetCvsScoreColor = () => { | ||
| const { euiTheme } = useEuiTheme(); | ||
|
|
||
| const getCvsScoreColor = (score: number) => { | ||
| return getCvsScoreColorUtil(score, euiTheme); | ||
| }; | ||
|
|
||
| return { getCvsScoreColor }; | ||
| }; |
19 changes: 19 additions & 0 deletions
19
...ity/packages/kbn-cloud-security-posture/public/src/hooks/use_get_severity_status_color.ts
This file contains hidden or 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,19 @@ | ||
| /* | ||
| * 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 { useEuiTheme } from '@elastic/eui'; | ||
| import { VulnSeverity } from '@kbn/cloud-security-posture-common'; | ||
|
|
||
| import { getSeverityStatusColor as getSeverityStatusColorUtil } from '../..'; | ||
|
|
||
| export const useGetSeverityStatusColor = () => { | ||
| const { euiTheme } = useEuiTheme(); | ||
| const getSeverityStatusColor = (status: VulnSeverity) => { | ||
| return getSeverityStatusColorUtil(status, euiTheme); | ||
| }; | ||
| return { getSeverityStatusColor }; | ||
| }; |
77 changes: 77 additions & 0 deletions
77
.../security/packages/kbn-cloud-security-posture/public/src/utils/get_finding_colors.test.ts
This file contains hidden or 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,77 @@ | ||
| /* | ||
| * 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 { getCvsScoreColor, getSeverityStatusColor, SEVERITY_COLOR } from './get_finding_colors'; | ||
| import { EuiThemeComputed } from '@elastic/eui'; | ||
|
|
||
| const mockEuiThemeBorealis = { | ||
| themeName: 'borialis', | ||
| }; | ||
|
|
||
| describe('getSeverityStatusColor', () => { | ||
| it('should return the correct color for LOW severity', () => { | ||
| expect(getSeverityStatusColor('LOW', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.low | ||
| ); | ||
| }); | ||
|
|
||
| it('should return the correct color for MEDIUM severity', () => { | ||
| expect(getSeverityStatusColor('MEDIUM', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.medium | ||
| ); | ||
| }); | ||
|
|
||
| it('should return the correct color for HIGH severity', () => { | ||
| expect(getSeverityStatusColor('HIGH', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.high | ||
| ); | ||
| }); | ||
|
|
||
| it('should return the correct color for CRITICAL severity', () => { | ||
| expect(getSeverityStatusColor('CRITICAL', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.critical | ||
| ); | ||
| }); | ||
|
|
||
| it('should return the correct color for an unknown severity', () => { | ||
| expect(getSeverityStatusColor('UNKNOWN', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.unknown | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
| describe('getCvsScoreColor', () => { | ||
| it('returns correct color for low severity score', () => { | ||
| expect(getCvsScoreColor(1.5, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.low | ||
| ); | ||
| }); | ||
|
|
||
| it('returns correct color for medium severity score', () => { | ||
| expect(getCvsScoreColor(5.5, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.medium | ||
| ); | ||
| }); | ||
|
|
||
| it('returns correct color for high severity score', () => { | ||
| expect(getCvsScoreColor(7.9, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.high | ||
| ); | ||
| }); | ||
|
|
||
| it('returns correct color for critical severity score', () => { | ||
| expect(getCvsScoreColor(10.0, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.critical | ||
| ); | ||
| }); | ||
|
|
||
| it('returns correct color for low severity score for undefined value', () => { | ||
| expect(getCvsScoreColor(-0.2, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
| SEVERITY_COLOR.unknown | ||
| ); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.