From 0f4a93a235ed54be9a2e03d7ca2bef966316a900 Mon Sep 17 00:00:00 2001 From: Coen Warmer Date: Mon, 26 Feb 2024 09:28:33 +0100 Subject: [PATCH 1/6] Move to emotion css from scss --- .github/CODEOWNERS | 11 ----------- .../infra/public/apps/logs_app.tsx | 1 - .../infra/public/apps/metrics_app.tsx | 1 - .../public/components/virtual_columns/content.tsx | 9 +++++++-- .../pages/overview/components/news_feed/news_feed.tsx | 9 +++++++-- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 36ad20371d615..1f93fcebfa4db 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1541,16 +1541,6 @@ x-pack/plugins/security_solution/server/lib/security_integrations @elastic/secur # scss overrides should be below this line for specificity **/*.scss @elastic/kibana-design -# Observability design -<<<<<<< HEAD -/x-pack/plugins/apm/**/*.scss @elastic/observability-design -/x-pack/plugins/observability_solution/infra/**/*.scss @elastic/observability-design -======= -/x-pack/plugins/observability_solution/apm/**/*.scss @elastic/observability-design -/x-pack/plugins/infra/**/*.scss @elastic/observability-design ->>>>>>> 037d08745b89950be0631e06f0b39e275bd6a328 -/x-pack/plugins/fleet/**/*.scss @elastic/observability-design -/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design # Ent. Search design /x-pack/plugins/enterprise_search/**/*.scss @elastic/ent-search-design @@ -1560,7 +1550,6 @@ x-pack/plugins/security_solution/server/lib/security_integrations @elastic/secur /x-pack/plugins/security_solution/**/*.scss @elastic/security-design /x-pack/plugins/security_solution_ess/**/*.scss @elastic/security-design /x-pack/plugins/security_solution_serverless/**/*.scss @elastic/security-design -/x-pack/plugins/observability_solution/logs_explorer/**/*.scss @elastic/observability-design # Logstash #CC# /x-pack/plugins/logstash/ @elastic/logstash diff --git a/x-pack/plugins/observability_solution/infra/public/apps/logs_app.tsx b/x-pack/plugins/observability_solution/infra/public/apps/logs_app.tsx index f75f6fa29efd7..ff5631872bfe8 100644 --- a/x-pack/plugins/observability_solution/infra/public/apps/logs_app.tsx +++ b/x-pack/plugins/observability_solution/infra/public/apps/logs_app.tsx @@ -12,7 +12,6 @@ import ReactDOM from 'react-dom'; import { Router, Routes, Route } from '@kbn/shared-ux-router'; import { AppMountParameters } from '@kbn/core/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; -import '../index.scss'; import { LinkToLogsPage } from '../pages/link_to/link_to_logs'; import { LogsPage } from '../pages/logs'; import { InfraClientStartDeps, InfraClientStartExports } from '../types'; diff --git a/x-pack/plugins/observability_solution/infra/public/apps/metrics_app.tsx b/x-pack/plugins/observability_solution/infra/public/apps/metrics_app.tsx index 4bfd65cd1ac63..338f7df860a21 100644 --- a/x-pack/plugins/observability_solution/infra/public/apps/metrics_app.tsx +++ b/x-pack/plugins/observability_solution/infra/public/apps/metrics_app.tsx @@ -12,7 +12,6 @@ import ReactDOM from 'react-dom'; import { Router, Routes, Route } from '@kbn/shared-ux-router'; import { AppMountParameters } from '@kbn/core/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; -import '../index.scss'; import { InfraPublicConfig } from '../../common/plugin_config_types'; import { LinkToMetricsPage } from '../pages/link_to/link_to_metrics'; import { InfrastructurePage } from '../pages/metrics'; diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/content.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/content.tsx index 13ae9ce80fa09..172c58f00a966 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/content.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/content.tsx @@ -6,6 +6,7 @@ */ import React, { useMemo } from 'react'; +import { css } from '@emotion/css'; import { EuiButtonIcon, EuiText } from '@elastic/eui'; import type { DataGridCellValueElementProps } from '@kbn/unified-data-table'; import { getShouldShowFieldHandler } from '@kbn/discover-utils'; @@ -16,7 +17,6 @@ import { useDocDetail, getMessageWithFallbacks } from '../../hooks/use_doc_detai import { LogDocument } from '../../../common/document'; import { LogLevel } from '../common/log_level'; import * as constants from '../../../common/constants'; -import './virtual_column.scss'; const SourceDocument = dynamic( () => import('@kbn/unified-data-table/src/components/source_document') @@ -26,6 +26,11 @@ const DiscoverSourcePopoverContent = dynamic( () => import('@kbn/unified-data-table/src/components/source_popover_content') ); +const sourceDocumentClassName = css` + display: inline !important; + margin-left: $euiSizeXS; +`; + const LogMessage = ({ field, value }: { field?: string; value: string }) => { const renderFieldPrefix = field && field !== constants.MESSAGE_FIELD; return ( @@ -115,7 +120,7 @@ export const Content = ({ shouldShowFieldHandler={shouldShowFieldHandler} maxEntries={50} dataTestSubj="logsExplorerCellDescriptionList" - className="logsExplorerVirtualColumn__sourceDocument" + className={sourceDocumentClassName} /> )} diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.tsx b/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.tsx index 7fad8c53564e1..b0d4821d27aa3 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.tsx +++ b/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.tsx @@ -15,17 +15,22 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; +import { css } from '@emotion/css'; import { i18n } from '@kbn/i18n'; import { truncate } from 'lodash'; import React, { useContext } from 'react'; import { ThemeContext } from 'styled-components'; import { NewsItem as INewsItem } from './helpers/get_news_feed'; -import './news_feed.scss'; interface Props { items: INewsItem[]; } +const imageClassName = css` + box-shadow: 0 0.7px 1.4px rgba(0, 0, 0, 0.07), 0 1.9px 4px rgba(0, 0, 0, 0.05), + 0 4.5px 10px rgba(0, 0, 0, 0.05); +`; + export function NewsFeed({ items }: Props) { return ( // The news feed is manually added/edited, to prevent any errors caused by typos or missing fields, @@ -98,7 +103,7 @@ function NewsItem({ item }: { item: INewsItem }) { height={48} alt={item.title.en} src={item.image_url.en} - className="obsNewsFeed__itemImg" + className={imageClassName} /> )} From f49be1b1b3a10c07f2897c2ded8c2e4e20bd8cd3 Mon Sep 17 00:00:00 2001 From: Coen Warmer Date: Mon, 26 Feb 2024 09:36:43 +0100 Subject: [PATCH 2/6] Enable telemetry and i18n rules for all Observability plugins --- .eslintrc.js | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 918e469ae0a58..390c89d2bf390 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -911,19 +911,7 @@ module.exports = { { files: [ 'x-pack/plugins/aiops/**/*.tsx', - 'x-pack/plugins/infra/**/*.tsx', - 'x-pack/plugins/observability_solution/apm/**/*.tsx', - 'x-pack/plugins/observability_solution/dataset_quality/**/*.tsx', - 'x-pack/plugins/observability_solution/exploratory_view/**/*.tsx', - 'x-pack/plugins/observability_solution/infra/**/*.tsx', - 'x-pack/plugins/observability_solution/observability/**/*.tsx', - 'x-pack/plugins/observability_solution/observability_ai_assistant/**/*.tsx', - 'x-pack/plugins/observability_solution/observability_onboarding/**/*.tsx', - 'x-pack/plugins/observability_solution/observability_shared/**/*.tsx', - 'x-pack/plugins/observability_solution/profiling/**/*.tsx', - 'x-pack/plugins/observability_solution/synthetics/**/*.tsx', - 'x-pack/plugins/observability_solution/uptime/**/*.tsx', - 'x-pack/plugins/observability_solution/ux/**/*.tsx', + 'x-pack/plugins/observability_solution/**/*.tsx', 'src/plugins/ai_assistant_management/**/*.tsx', ], rules: { @@ -932,16 +920,7 @@ module.exports = { }, { files: [ - 'x-pack/plugins/observability_solution/apm/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/exploratory_view/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/infra/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/observability/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/observability_ai_assistant/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/observability_onboarding/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/observability_shared/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/profiling/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/synthetics/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', - 'x-pack/plugins/observability_solution/ux/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', + 'x-pack/plugins/observability_solution/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', 'src/plugins/ai_assistant_management/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)', ], rules: { From 31293b1e20bc1521e2c9253e937f22b541890f72 Mon Sep 17 00:00:00 2001 From: Coen Warmer Date: Mon, 26 Feb 2024 10:13:49 +0100 Subject: [PATCH 3/6] Remove extraneous scss files --- x-pack/plugins/observability_solution/infra/public/index.scss | 0 .../public/components/virtual_columns/virtual_column.scss | 4 ---- .../public/pages/overview/components/news_feed/news_feed.scss | 3 --- 3 files changed, 7 deletions(-) delete mode 100644 x-pack/plugins/observability_solution/infra/public/index.scss delete mode 100644 x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/virtual_column.scss delete mode 100644 x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.scss diff --git a/x-pack/plugins/observability_solution/infra/public/index.scss b/x-pack/plugins/observability_solution/infra/public/index.scss deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/virtual_column.scss b/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/virtual_column.scss deleted file mode 100644 index f4f407875d2b6..0000000000000 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/virtual_column.scss +++ /dev/null @@ -1,4 +0,0 @@ -.logsExplorerVirtualColumn__sourceDocument { - display: inline !important; - margin-left: $euiSizeXS; -} diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.scss b/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.scss deleted file mode 100644 index 82b1c88dc4038..0000000000000 --- a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.scss +++ /dev/null @@ -1,3 +0,0 @@ -.obsNewsFeed__itemImg { - @include euiBottomShadowSmall; -} \ No newline at end of file From f946a77ebdae8bfdfc5626edbd903c93d3d52abc Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 26 Feb 2024 10:02:58 +0000 Subject: [PATCH 4/6] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../data_source_selector/sub_components/list_status.tsx | 6 +++++- .../sub_components/search_controls.tsx | 1 + .../flyout_detail/sub_components/highlight_section.tsx | 1 + .../flyout_detail/sub_components/hover_popover_action.tsx | 1 + .../public/components/alerts_popover.tsx | 7 ++++++- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/list_status.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/list_status.tsx index 3d782544b92c5..ecdffbcefcbef 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/list_status.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/list_status.tsx @@ -60,7 +60,11 @@ export const ListStatus = ({ }} /> } - actions={[{noDataRetryLabel}]} + actions={[ + + {noDataRetryLabel} + , + ]} /> ); } diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/search_controls.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/search_controls.tsx index 5864dd37e42c0..77cb5082efa26 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/search_controls.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/search_controls.tsx @@ -42,6 +42,7 @@ export const SearchControls = ({ search, onSearch, onSort, isLoading }: SearchCo ( { {state.isAddRuleFlyoutOpen && addRuleFlyout} + Date: Tue, 5 Mar 2024 11:33:32 +0100 Subject: [PATCH 5/6] Update x-pack/plugins/observability_solution/logs_explorer/public/components/flyout_detail/sub_components/highlight_section.tsx Co-authored-by: Marco Antonio Ghiani --- .../flyout_detail/sub_components/highlight_section.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/flyout_detail/sub_components/highlight_section.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/components/flyout_detail/sub_components/highlight_section.tsx index a3b8b38a443d1..80260a6cff11c 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/flyout_detail/sub_components/highlight_section.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/components/flyout_detail/sub_components/highlight_section.tsx @@ -41,7 +41,7 @@ export function HighlightSection({ title, children, columns, ...props }: Highlig const showMoreButtonLabel = flyoutAccordionShowMoreText(hiddenCount); const showMoreButton = ( Date: Thu, 14 Mar 2024 10:15:54 +0000 Subject: [PATCH 6/6] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../sub_components/add_data_button.tsx | 7 ++++++- .../logs_shared/public/components/data_search_progress.tsx | 1 + .../public/components/nav_control/index.tsx | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/add_data_button.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/add_data_button.tsx index 51e1925e82cbe..28d08aedc4a77 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/add_data_button.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/components/data_source_selector/sub_components/add_data_button.tsx @@ -37,7 +37,12 @@ export const AddDataButton: React.FunctionComponent<{}> = ({}) => { }); return ( - + {addDataLabel} ); diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/data_search_progress.tsx b/x-pack/plugins/observability_solution/logs_shared/public/components/data_search_progress.tsx index 8ccc14a4d9acd..a03844fa9b2fd 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/data_search_progress.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/data_search_progress.tsx @@ -29,6 +29,7 @@ export const DataSearchProgress: React.FC<{ {onCancel ? ( { service.conversations.openNewConversation({