-
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.
[8.x] [Security Solution][Data Quality Dashboard]: migrate styled-com…
…ponent… (#205559) (#206370) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution][Data Quality Dashboard]: migrate styled-component… (#205559)](#205559) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-06T13:48:11Z","message":"[Security Solution][Data Quality Dashboard]: migrate styled-component… (#205559)\n\n…s to Emotion\r\n\r\nAddresses #205449\r\n\r\nThis PR migrates `ecs_data_quality_dashboard` package from\r\n`styled-components` to `emotion`. In the process we also convert the\r\n`kbn/ui-theme` json tokens to `euiTheme` counterparts.\r\n\r\nAdditionally we decorate root `babel-jest`\r\n[transform](https://github.com/kapral18/kibana/blob/211d4a6889f314eb11761b0bc65f7f93d3b55ffd/packages/kbn-test/src/jest/transforms/babel.js)\r\nlocally in `security_solution/public/overview` and\r\n`ecs_data_quality_dashboard` package folder to include\r\n`@emotion/babel-preset-css-prop`.\r\n\r\nThe reason for local `babel-jest` transforms is that root `babel-jest`\r\ntransform doesn't include `@emotion/babel-preset-css-prop` which is\r\nnecessary for proper compilation of emotion css prop in tests. Without\r\nit there is a warning\r\n\r\n![image](https://github.com/user-attachments/assets/c75b9827-a731-469c-a762-ff04f86cd80e)\r\nappearing in every test that tests a component that uses css prop with\r\ntheme function passed into it. Other use cases seem to be compiling fine\r\nwithout this babel preset. But theme callback is a valid way of using\r\nemotion so we shouldn't avoid using it just because it's not added\r\nproperly to the test compilation step. Hence I am adding it locally to\r\n`ecs_data_quality_dashboard` package and\r\n`security_solution/public/overview`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"72980e1676589d0089f02a6e0499855702a3c64a","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","v9.0.0","Team:Threat Hunting:Explore","backport:prev-minor"],"number":205559,"url":"https://github.com/elastic/kibana/pull/205559","mergeCommit":{"message":"[Security Solution][Data Quality Dashboard]: migrate styled-component… (#205559)\n\n…s to Emotion\r\n\r\nAddresses #205449\r\n\r\nThis PR migrates `ecs_data_quality_dashboard` package from\r\n`styled-components` to `emotion`. In the process we also convert the\r\n`kbn/ui-theme` json tokens to `euiTheme` counterparts.\r\n\r\nAdditionally we decorate root `babel-jest`\r\n[transform](https://github.com/kapral18/kibana/blob/211d4a6889f314eb11761b0bc65f7f93d3b55ffd/packages/kbn-test/src/jest/transforms/babel.js)\r\nlocally in `security_solution/public/overview` and\r\n`ecs_data_quality_dashboard` package folder to include\r\n`@emotion/babel-preset-css-prop`.\r\n\r\nThe reason for local `babel-jest` transforms is that root `babel-jest`\r\ntransform doesn't include `@emotion/babel-preset-css-prop` which is\r\nnecessary for proper compilation of emotion css prop in tests. Without\r\nit there is a warning\r\n\r\n![image](https://github.com/user-attachments/assets/c75b9827-a731-469c-a762-ff04f86cd80e)\r\nappearing in every test that tests a component that uses css prop with\r\ntheme function passed into it. Other use cases seem to be compiling fine\r\nwithout this babel preset. But theme callback is a valid way of using\r\nemotion so we shouldn't avoid using it just because it's not added\r\nproperly to the test compilation step. Hence I am adding it locally to\r\n`ecs_data_quality_dashboard` package and\r\n`security_solution/public/overview`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"72980e1676589d0089f02a6e0499855702a3c64a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205559","number":205559,"mergeCommit":{"message":"[Security Solution][Data Quality Dashboard]: migrate styled-component… (#205559)\n\n…s to Emotion\r\n\r\nAddresses #205449\r\n\r\nThis PR migrates `ecs_data_quality_dashboard` package from\r\n`styled-components` to `emotion`. In the process we also convert the\r\n`kbn/ui-theme` json tokens to `euiTheme` counterparts.\r\n\r\nAdditionally we decorate root `babel-jest`\r\n[transform](https://github.com/kapral18/kibana/blob/211d4a6889f314eb11761b0bc65f7f93d3b55ffd/packages/kbn-test/src/jest/transforms/babel.js)\r\nlocally in `security_solution/public/overview` and\r\n`ecs_data_quality_dashboard` package folder to include\r\n`@emotion/babel-preset-css-prop`.\r\n\r\nThe reason for local `babel-jest` transforms is that root `babel-jest`\r\ntransform doesn't include `@emotion/babel-preset-css-prop` which is\r\nnecessary for proper compilation of emotion css prop in tests. Without\r\nit there is a warning\r\n\r\n![image](https://github.com/user-attachments/assets/c75b9827-a731-469c-a762-ff04f86cd80e)\r\nappearing in every test that tests a component that uses css prop with\r\ntheme function passed into it. Other use cases seem to be compiling fine\r\nwithout this babel preset. But theme callback is a valid way of using\r\nemotion so we shouldn't avoid using it just because it's not added\r\nproperly to the test compilation step. Hence I am adding it locally to\r\n`ecs_data_quality_dashboard` package and\r\n`security_solution/public/overview`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"72980e1676589d0089f02a6e0499855702a3c64a"}}]}] BACKPORT-->
- Loading branch information
Showing
69 changed files
with
1,028 additions
and
679 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
const babelJest = require('babel-jest'); | ||
const transformerConfig = require('./transformer_config'); | ||
|
||
module.exports = babelJest.default.createTransformer(transformerConfig); |
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
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.