Skip to content
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

[Observability Solution][Maintenance] Move to Emotion CSS, enable Telemetry and i18n ESLint rules for all Obs plugins #177785

Merged
Merged
25 changes: 2 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: {
Expand Down
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1542,8 +1542,6 @@ x-pack/plugins/security_solution/server/lib/security_integrations @elastic/secur
**/*.scss @elastic/kibana-design

# 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/fleet/**/*.scss @elastic/observability-design
/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design

Expand All @@ -1555,7 +1553,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
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pageLoadAssetSize:
licensing: 29004
links: 44490
lists: 22900
logsExplorer: 55000
logsExplorer: 57000
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundle was going 1.2kb over the limit

logsShared: 281060
logstash: 53548
management: 46112
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export const ListStatus = ({
}}
/>
}
actions={[<EuiButton onClick={onRetry}>{noDataRetryLabel}</EuiButton>]}
actions={[
<EuiButton data-test-subj="logsExplorerListStatusButton" onClick={onRetry}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Telemetry ESLint rule is configured to autofix, so the CI has added these.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<EuiButton data-test-subj="logsExplorerListStatusButton" onClick={onRetry}>
<EuiButton data-test-subj="logsExplorerListStatusRetryButton" onClick={onRetry}>

{noDataRetryLabel}
</EuiButton>,
]}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const SearchControls = ({ search, onSearch, onSort, isLoading }: SearchCo
<EuiFlexGroup gutterSize="xs" responsive={false}>
<EuiFlexItem>
<EuiFieldSearch
data-test-subj="logsExplorerSearchControlsFieldSearch"
compressed
incremental
value={search.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function HighlightSection({ title, children, columns, ...props }: Highlig
const showMoreButtonLabel = flyoutAccordionShowMoreText(hiddenCount);
const showMoreButton = (
<EuiButtonEmpty
data-test-subj="logsExplorerHighlightSectionButton"
CoenWarmer marked this conversation as resolved.
Show resolved Hide resolved
size="xs"
flush="left"
css={{ width: '80px' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const HoverActionPopover = ({
{hoverActions.map((action) => (
<EuiToolTip content={action.tooltipContent} key={action.id}>
<EuiButtonIcon
data-test-subj="logsExplorerHoverActionPopoverButton"
size="xs"
iconType={action.iconType}
aria-label={action.tooltipContent as string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
*/

import React, { useMemo } from 'react';
import { css } from '@emotion/css';
import { EuiButtonIcon, EuiText } from '@elastic/eui';
import { euiThemeVars } from '@kbn/ui-theme';
import type { DataGridCellValueElementProps } from '@kbn/unified-data-table';
import { getShouldShowFieldHandler } from '@kbn/discover-utils';
import { i18n } from '@kbn/i18n';
Expand All @@ -16,7 +18,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')
Expand All @@ -26,6 +27,11 @@ const DiscoverSourcePopoverContent = dynamic(
() => import('@kbn/unified-data-table/src/components/source_popover_content')
);

const sourceDocumentClassName = css`
display: inline !important;
margin-left: ${euiThemeVars.euiSizeXS};
`;

const LogMessage = ({ field, value }: { field?: string; value: string }) => {
const renderFieldPrefix = field && field !== constants.MESSAGE_FIELD;
return (
Expand Down Expand Up @@ -115,7 +121,7 @@ export const Content = ({
shouldShowFieldHandler={shouldShowFieldHandler}
maxEntries={50}
dataTestSubj="logsExplorerCellDescriptionList"
className="logsExplorerVirtualColumn__sourceDocument"
className={sourceDocumentClassName}
/>
)}
</span>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}
/>
</EuiFlexItem>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ export const AlertsPopover = () => {
{state.isAddRuleFlyoutOpen && addRuleFlyout}
<EuiPopover
button={
<EuiButtonEmpty onClick={togglePopover} iconType="arrowDown" iconSide="right">
<EuiButtonEmpty
data-test-subj="observabilityLogsExplorerAlertsPopoverAlertsButton"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Telemetry ESLint rule is configured to autofix, so the CI has added these.

onClick={togglePopover}
iconType="arrowDown"
iconSide="right"
>
<FormattedMessage
id="xpack.observabilityLogsExplorer.alertsPopover.buttonLabel"
defaultMessage="Alerts"
Expand Down