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

[ResponseOps][UI] - EUI Visual Refresh integration and QA #204352

Merged
merged 38 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
44c8e2e
[ResponseOps][UI]EUI Visual Refresh integration and QA - tasks 1 & 2 …
georgianaonoleata1904 Dec 16, 2024
5ea1c45
[ResponseOps][UI] EUI Visual Refresh integration and QA - replaced de…
georgianaonoleata1904 Dec 16, 2024
5f20ac6
[ResponseOps] [UI] Color palette tokens and functions dynamically upd…
georgianaonoleata1904 Dec 16, 2024
60a9959
changed color mapping
georgianaonoleata1904 Dec 16, 2024
58d146c
removed running MW highlighted background
georgianaonoleata1904 Dec 16, 2024
f0020dc
fixes for check types
georgianaonoleata1904 Dec 17, 2024
6bb2a1c
addressed comments
georgianaonoleata1904 Dec 17, 2024
7c644ef
small changes
georgianaonoleata1904 Dec 17, 2024
e2aebb6
fixed check types and changed the warning colors to pull from euiThem…
georgianaonoleata1904 Dec 18, 2024
c0ccec4
changed severity color values
georgianaonoleata1904 Dec 18, 2024
a155c28
fixed check types
georgianaonoleata1904 Dec 18, 2024
6c76609
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Dec 18, 2024
e5c1b96
fixes for the failes jest tests
georgianaonoleata1904 Dec 18, 2024
04ae65e
small fix
georgianaonoleata1904 Dec 18, 2024
893e241
Merge branch 'ro_eui_theme_borealis' of github.com:elastic/kibana int…
georgianaonoleata1904 Dec 18, 2024
1f4b407
added missing data-test-subj to the severity options
georgianaonoleata1904 Dec 18, 2024
bc23837
solved merge conflicts
georgianaonoleata1904 Jan 8, 2025
78cc221
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Jan 8, 2025
dc3c3fc
fixed check type failure
georgianaonoleata1904 Jan 8, 2025
7bdb51d
Merge branch 'ro_eui_theme_borealis' of github.com:elastic/kibana int…
georgianaonoleata1904 Jan 8, 2025
7c7e9bb
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Jan 8, 2025
306d385
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Jan 9, 2025
0fc2725
changed button to EuiButton
georgianaonoleata1904 Jan 10, 2025
97dc655
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Jan 10, 2025
1ed6fe8
fixed check type
georgianaonoleata1904 Jan 10, 2025
1feaf1a
Merge branch 'ro_eui_theme_borealis' of github.com:elastic/kibana int…
georgianaonoleata1904 Jan 10, 2025
06e4b19
fixed check type test
georgianaonoleata1904 Jan 10, 2025
a6748c8
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Jan 13, 2025
48a97bb
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Jan 13, 2025
7790689
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jan 13, 2025
fa1537c
addressed comments
georgianaonoleata1904 Jan 14, 2025
a2f0cb1
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine Jan 14, 2025
caa5e1b
revert prev changes
georgianaonoleata1904 Jan 14, 2025
f29548c
Merge branch 'ro_eui_theme_borealis' of github.com:elastic/kibana int…
georgianaonoleata1904 Jan 14, 2025
974f34c
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine Jan 14, 2025
b0df5e3
removed unused import
georgianaonoleata1904 Jan 14, 2025
8bc77e1
Merge branch 'ro_eui_theme_borealis' of github.com:elastic/kibana int…
georgianaonoleata1904 Jan 14, 2025
f694052
Merge branch 'main' into ro_eui_theme_borealis
georgianaonoleata1904 Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import {
EuiTabbedContentProps,
useEuiOverflowScroll,
EuiBasicTableColumn,
useEuiTheme,
useEuiFontSize,
} from '@elastic/eui';
import { css } from '@emotion/react';
import React, { memo, useMemo } from 'react';
import { Alert } from '@kbn/alerting-types';
import { euiThemeVars } from '@kbn/ui-theme';
import { useEuiTablePersist } from '@kbn/shared-ux-table-persist';

export const search = {
Expand Down Expand Up @@ -90,6 +91,8 @@ export interface AlertFieldsTableProps {
* A paginated, filterable table to show alert object fields
*/
export const AlertFieldsTable = memo(({ alert, fields }: AlertFieldsTableProps) => {
const { euiTheme } = useEuiTheme();
const xsFontSize = useEuiFontSize('xs').fontSize;
const { pageSize, sorting, onTableChange } = useEuiTablePersist<AlertField>({
tableId: 'obltAlertFields',
initialPageSize: 25,
Expand Down Expand Up @@ -122,8 +125,8 @@ export const AlertFieldsTable = memo(({ alert, fields }: AlertFieldsTableProps)
search={search}
css={css`
& .euiTableRow {
font-size: ${euiThemeVars.euiFontSizeXS};
font-family: ${euiThemeVars.euiCodeFontFamily};
font-size: ${xsFontSize};
font-family: ${euiTheme.font.familyCode};
}
`}
/>
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-alerts-ui-shared/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@kbn/data-views-plugin",
"@kbn/unified-search-plugin",
"@kbn/es-query",
"@kbn/ui-theme",
"@kbn/controls-plugin",
"@kbn/embeddable-plugin",
"@kbn/core-http-browser",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import {
EuiFlexItem,
EuiPopover,
EuiToolTip,
useEuiTheme,
useEuiFontSize,
} from '@elastic/eui';
import React, { Fragment, useCallback, useMemo, useState } from 'react';
import { Filter } from '@kbn/es-query';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
import { GroupStatsItem } from '../types';
import { statsContainerCss } from '../styles';
import { TAKE_ACTION } from '../translations';

interface GroupStatsProps<T> {
Expand All @@ -34,14 +34,15 @@ interface GroupStatsProps<T> {
}

const Separator = () => {
const { euiTheme } = useEuiTheme();
return (
<EuiFlexItem
grow={false}
role="separator"
css={css`
align-self: center;
height: 20px;
border-right: ${euiThemeVars.euiBorderThin};
border-right: ${euiTheme.border.thin};
`}
/>
);
Expand All @@ -55,6 +56,9 @@ const GroupStatsComponent = <T,>({
stats,
takeActionItems: getTakeActionItems,
}: GroupStatsProps<T>) => {
const { euiTheme } = useEuiTheme();
const xsFontSize = useEuiFontSize('xs').fontSize;

const [isPopoverOpen, setPopover] = useState(false);
const takeActionItems = useMemo(() => {
return getTakeActionItems?.(groupFilter, groupNumber) ?? [];
Expand Down Expand Up @@ -86,14 +90,28 @@ const GroupStatsComponent = <T,>({

return (
<EuiFlexItem grow={false} key={stat.title}>
<span css={statsContainerCss} data-test-subj={dataTestSubj}>
<span
css={css`
font-size: ${xsFontSize};
font-weight: ${euiTheme.font.weight.semiBold};
.smallDot {
width: 3px !important;
display: inline-block;
}
.euiBadge__text {
text-align: center;
width: 100%;
}
`}
data-test-subj={dataTestSubj}
>
{stat.title}
{component}
</span>
</EuiFlexItem>
);
}) ?? [],
[stats]
[stats, euiTheme, xsFontSize]
);

const takeActionMenu = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ const testProps = {
},
],
title: 'Group alerts by',
euiTheme: {
border: {
thin: '1px solid #E3E8F2',
},
},
};
describe('group selector', () => {
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import type {
import {
EuiContextMenuPanelDescriptor,
EuiContextMenuPanelItemDescriptor,
useEuiTheme,
} from '@elastic/eui';
import { EuiPopover } from '@elastic/eui';
import React, { useCallback, useMemo, useState } from 'react';
Expand Down Expand Up @@ -44,6 +45,8 @@ const GroupSelectorComponent = ({
[groupsSelected]
);

const { euiTheme } = useEuiTheme();

const panels: EuiContextMenuPanelDescriptor[] = useMemo(() => {
const isOptionDisabled = (key?: string) => {
// Do not disable when maxGroupingLevels is 1 to allow toggling between groups
Expand Down Expand Up @@ -147,6 +150,7 @@ const GroupSelectorComponent = ({
data-test-subj="groupByContextMenu"
initialPanelId="firstPanel"
panels={panels}
euiTheme={euiTheme}
/>
</EuiPopover>
);
Expand Down
20 changes: 18 additions & 2 deletions packages/kbn-grouping/src/components/grouping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import {
EuiProgress,
EuiSpacer,
EuiTablePagination,
useEuiTheme,
useEuiFontSize,
} from '@elastic/eui';
import { css } from '@emotion/react';
import type { Filter } from '@kbn/es-query';
import React, { useMemo, useState } from 'react';
import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics';
Expand All @@ -22,7 +25,7 @@ import { createGroupFilter, getNullGroupFilter } from '../containers/query/helpe
import { GroupPanel } from './accordion_panel';
import { GroupStats } from './accordion_panel/group_stats';
import { EmptyGroupingComponent } from './empty_results_panel';
import { countCss, groupingContainerCss, groupingContainerCssLevel } from './styles';
import { groupingContainerCss, groupingContainerCssLevel } from './styles';
import { GROUPS_UNIT, NULL_GROUP } from './translations';
import type { ParsedGroupingAggregation, GroupPanelRenderer, GetGroupStats } from './types';
import { GroupingBucket, OnGroupToggle } from './types';
Expand Down Expand Up @@ -78,6 +81,17 @@ const GroupingComponent = <T,>({
unit = defaultUnit,
groupsUnit = GROUPS_UNIT,
}: GroupingProps<T>) => {
const { euiTheme } = useEuiTheme();
const xsFontSize = useEuiFontSize('xs').fontSize;

const countCss = css`
font-size: ${xsFontSize};
font-weight: ${euiTheme.font.weight.semiBold};
border-right: ${euiTheme.border.thin};
margin-right: 16px;
padding-right: 16px;
`;

const [trigger, setTrigger] = useState<Record<string, { state: 'open' | 'closed' | undefined }>>(
{}
);
Expand Down Expand Up @@ -219,7 +233,9 @@ const GroupingComponent = <T,>({
</EuiFlexGroup>
)}
<div
css={groupingLevel > 0 ? groupingContainerCssLevel : groupingContainerCss}
css={
groupingLevel > 0 ? groupingContainerCssLevel(euiTheme) : groupingContainerCss(euiTheme)
}
className="eui-xScroll"
>
{isLoading ? (
Expand Down
50 changes: 14 additions & 36 deletions packages/kbn-grouping/src/components/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,30 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { EuiButtonEmpty, EuiContextMenu } from '@elastic/eui';
import { EuiButtonEmpty, EuiContextMenu, type EuiThemeComputed } from '@elastic/eui';
import { euiStyled } from '@kbn/kibana-react-plugin/common';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';

export const countCss = css`
font-size: ${euiThemeVars.euiFontSizeXS};
font-weight: ${euiThemeVars.euiFontWeightSemiBold};
border-right: ${euiThemeVars.euiBorderThin};
margin-right: 16px;
padding-right: 16px;
`;

export const statsContainerCss = css`
font-size: ${euiThemeVars.euiFontSizeXS};
font-weight: ${euiThemeVars.euiFontWeightSemiBold};
.smallDot {
width: 3px !important;
display: inline-block;
}
.euiBadge__text {
text-align: center;
width: 100%;
}
`;

export const groupingContainerCss = css`
export const groupingContainerCss = (euiTheme: EuiThemeComputed<{}>) => css`
.groupingAccordionForm .euiAccordion__childWrapper .euiAccordion__children {
margin-left: 8px;
margin-right: 8px;
border-left: ${euiThemeVars.euiBorderThin};
border-right: ${euiThemeVars.euiBorderThin};
border-bottom: ${euiThemeVars.euiBorderThin};
border-left: ${euiTheme.border.thin};
border-right: ${euiTheme.border.thin};
border-bottom: ${euiTheme.border.thin};
border-radius: 0 0 6px 6px;
}
.groupingAccordionForm .euiAccordion__triggerWrapper {
border-bottom: ${euiThemeVars.euiBorderThin};
border-left: ${euiThemeVars.euiBorderThin};
border-right: ${euiThemeVars.euiBorderThin};
border-bottom: ${euiTheme.border.thin};
border-left: ${euiTheme.border.thin};
border-right: ${euiTheme.border.thin};
border-radius: 6px;
min-height: 78px;
padding-left: 16px;
padding-right: 16px;
}
.groupingAccordionForm {
border-top: ${euiThemeVars.euiBorderThin};
border-top: ${euiTheme.border.thin};
border-bottom: none;
border-radius: 6px;
min-width: 1090px;
Expand All @@ -65,17 +43,17 @@ export const groupingContainerCss = css`
}
`;

export const groupingContainerCssLevel = css`
export const groupingContainerCssLevel = (euiTheme: EuiThemeComputed<{}>) => css`
.groupingAccordionFormLevel .euiAccordion__childWrapper .euiAccordion__children {
margin-left: 8px;
margin-right: 8px;
border-left: none;
border-right: none;
border-bottom: ${euiThemeVars.euiBorderThin};
border-bottom: ${euiTheme.border.thin};
border-radius: 0;
}
.groupingAccordionFormLevel .euiAccordion__triggerWrapper {
border-bottom: ${euiThemeVars.euiBorderThin};
border-bottom: ${euiTheme.border.thin};
border-left: none;
border-right: none;
min-height: 78px;
Expand All @@ -97,14 +75,14 @@ export const groupingContainerCssLevel = css`
}
`;

export const StyledContextMenu = euiStyled(EuiContextMenu)`
export const StyledContextMenu = euiStyled(EuiContextMenu)<{ euiTheme: EuiThemeComputed }>`
width: 250px;
& .euiContextMenuItem__text {
overflow: hidden;
text-overflow: ellipsis;
}
.euiContextMenuItem {
border-bottom: ${euiThemeVars.euiBorderThin};
border-bottom: ${(props) => props.euiTheme.border.thin};
}
.euiContextMenuItem:last-child {
border: none;
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-grouping/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@kbn/i18n-react",
"@kbn/kibana-react-plugin",
"@kbn/shared-svg",
"@kbn/ui-theme",
"@kbn/analytics",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
EuiPanel,
EuiButtonIcon,
useEuiTheme,
useEuiBackgroundColor,
EuiIcon,
EuiText,
EuiTabs,
Expand Down Expand Up @@ -110,9 +109,9 @@ export const RuleActionsItem = (props: RuleActionsItemProps) => {
} = useRuleFormState();

const [tab, setTab] = useState<string>(MESSAGES_TAB);
const subdued = useEuiBackgroundColor('subdued');
const plain = useEuiBackgroundColor('plain');
const { euiTheme } = useEuiTheme();
const subdued = euiTheme.colors.lightestShade;
const plain = euiTheme.colors.backgroundBasePlain;

const [availableActionVariables, setAvailableActionVariables] = useState<ActionVariable[]>(() => {
if (!selectedRuleType.actionVariables) {
Expand Down Expand Up @@ -692,7 +691,7 @@ export const RuleActionsItem = (props: RuleActionsItemProps) => {
}
buttonContentClassName="eui-fullWidth"
buttonContent={
<EuiPanel color="subdued" paddingSize="m">
<EuiPanel color="transparent" paddingSize="m">
<EuiFlexGroup alignItems="center" responsive={false}>
{accordionIcon}
{connectorTitle}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export const RuleActionsSystemActionsItem = (props: RuleActionsSystemActionsItem
>({});
const [warning, setWarning] = useState<string | null>(null);

const subdued = useEuiBackgroundColor('subdued');
const { euiTheme } = useEuiTheme();
const subdued = euiTheme.colors.lightestShade;

const dispatch = useRuleFormDispatch();
const actionTypeModel = actionTypeRegistry.get(action.actionTypeId);
Expand Down Expand Up @@ -267,7 +267,7 @@ export const RuleActionsSystemActionsItem = (props: RuleActionsSystemActionsItem
buttonContent={
<EuiPanel
data-test-subj="ruleActionsSystemActionsItemAccordionButton"
color="subdued"
color="transparent"
paddingSize="m"
>
<EuiFlexGroup alignItems="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import React from 'react';
import { useEuiBackgroundColorCSS, EuiPageTemplate } from '@elastic/eui';
import { EuiPageTemplate } from '@elastic/eui';

interface RuleFormErrorPromptWrapperProps {
hasBorder?: boolean;
Expand All @@ -18,7 +18,9 @@ interface RuleFormErrorPromptWrapperProps {
export const RuleFormErrorPromptWrapper: React.FC<
React.PropsWithChildren<RuleFormErrorPromptWrapperProps>
> = ({ children, hasBorder, hasShadow }) => {
const styles = useEuiBackgroundColorCSS().transparent;
const styles = {
backgroundColor: 'transparent',
};
return (
<EuiPageTemplate offset={0} css={styles}>
<EuiPageTemplate.EmptyPrompt paddingSize="none" hasBorder={hasBorder} hasShadow={hasShadow}>
Expand Down
Loading