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

Upgrade EUI to v85.1.0 #162660

Merged
merged 12 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch@8.9.0",
"@elastic/ems-client": "8.4.0",
"@elastic/eui": "85.0.1",
"@elastic/eui": "85.1.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const LICENSE_OVERRIDES = {
'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/ems-client@8.4.0': ['Elastic License 2.0'],
'@elastic/eui@85.0.1': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@85.1.0': ['SSPL-1.0 OR Elastic License 2.0'],
'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React from 'react';
import { EuiIcon, EuiSpacer } from '@elastic/eui';
import { EuiSelectableMessage, EuiIcon, EuiSpacer } from '@elastic/eui';

import { OptionsListStrings } from './options_list_strings';

Expand All @@ -17,19 +17,16 @@ export const OptionsListPopoverEmptyMessage = ({
showOnlySelected: boolean;
}) => {
return (
<span
className="euiFilterSelect__note"
<EuiSelectableMessage
data-test-subj={`optionsList-control-${
showOnlySelected ? 'selectionsEmptyMessage' : 'noSelectionsMessage'
}`}
>
<span className="euiFilterSelect__noteContent">
<EuiIcon type="minusInCircle" />
<EuiSpacer size="xs" />
{showOnlySelected
? OptionsListStrings.popover.getSelectionsEmptyMessage()
: OptionsListStrings.popover.getEmptyMessage()}
</span>
</span>
<EuiIcon type="minusInCircle" />
<EuiSpacer size="xs" />
{showOnlySelected
? OptionsListStrings.popover.getSelectionsEmptyMessage()
: OptionsListStrings.popover.getEmptyMessage()}
</EuiSelectableMessage>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
EuiFilterButton,
EuiFilterGroup,
EuiFilterSelectItem,
EuiSelectableMessage,
EuiIcon,
EuiPopover,
EuiPopoverTitle,
Expand All @@ -32,18 +33,16 @@ const SELECT_PICKER_HEIGHT = '250px';

const NoFilterItems = () => {
return (
<div className="euiFilterSelect__note">
<div className="euiFilterSelect__noteContent">
<EuiIcon type="minusInCircle" />
<EuiSpacer size="xs" />
<p>
<FormattedMessage
id="xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage"
defaultMessage="No filters found"
/>
</p>
</div>
</div>
<EuiSelectableMessage>
Copy link
Contributor

Choose a reason for hiding this comment

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

@breehall what are the plans for switching out the deprecated EuiFilterSelectItem for EuiSelectable, as is still being used in our file here?

Copy link
Member

Choose a reason for hiding this comment

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

There's a few too many usages in Kibana for EUI to tackle every single one of these ourselves, so we left the inline comments in hopes that Kibana teams would grab the deprecation conversions in their own time. It should hopefully be a fairly straightforward conversion, and if needed you can reference our docs example: https://elastic.github.io/eui/#/forms/filter-group#multi-select

As I mentioned in another comment, the final removal of EuiFilterSelectItem is still 6months+ out, so hopefully plenty of time for y'all - but please let us know if we can be a resource for this!

<EuiIcon type="minusInCircle" />
<EuiSpacer size="xs" />
<p>
<FormattedMessage
id="xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage"
defaultMessage="No filters found"
/>
</p>
</EuiSelectableMessage>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

import React from 'react';

import { EuiFilterGroup, EuiPopover, EuiPopoverTitle, EuiButtonEmpty } from '@elastic/eui';
import {
EuiFilterGroup,
EuiPopover,
EuiPopoverTitle,
EuiButtonEmpty,
useEuiTheme,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { ContentSource } from '../../../types';
Expand All @@ -29,6 +35,8 @@ export const GroupRowSourcesDropdown: React.FC<GroupRowSourcesDropdownProps> = (
onButtonClick,
closePopover,
}) => {
const { euiTheme } = useEuiTheme();

const toggleLink = (
<EuiButtonEmpty className="user-group-source--additional" onClick={onButtonClick}>
+ {numOptions}
Expand Down Expand Up @@ -58,7 +66,9 @@ export const GroupRowSourcesDropdown: React.FC<GroupRowSourcesDropdownProps> = (
panelPaddingSize="none"
>
<EuiPopoverTitle>{contentSourceCountHeading}</EuiPopoverTitle>
<div className="euiFilterSelect__items">{sources}</div>
<div className="eui-yScroll" css={{ maxHeight: euiTheme.base * 30 }}>
{sources}
</div>
</EuiPopover>
</EuiFilterGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';

import { EuiFilterSelectItem } from '@elastic/eui';
import { EuiFilterSelectItem, useEuiTheme } from '@elastic/eui';

import { ContentSource } from '../../../types';

Expand All @@ -26,6 +26,8 @@ export const SourcesList: React.FC<SourcesListProps> = ({
addFilteredSource,
removeFilteredSource,
}) => {
const { euiTheme } = useEuiTheme();

const sourceIds = contentSources.map(({ id }) => id);
const sources = sourceIds.map((sourceId, index) => {
const checked = filteredSources.indexOf(sourceId) > -1 ? 'on' : undefined;
Expand All @@ -38,5 +40,12 @@ export const SourcesList: React.FC<SourcesListProps> = ({
);
});

return <div className="euiFilterSelect__items">{sources}</div>;
return (
// EUI NOTE: Please use EuiSelectable (which already has height/scrolling built in)
// instead of EuiFilterSelectItem (which is pending deprecation).
// @see https://elastic.github.io/eui/#/forms/filter-group#multi-select
<div className="eui-yScroll" css={{ maxHeight: euiTheme.base * 30 }}>
{sources}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EuiPopover,
EuiText,
EuiTourStep,
useEuiTheme,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -153,6 +154,9 @@ export const AgentStatusFilter: React.FC<{

setIsStatusFilterOpen(isOpen);
};

const { euiTheme } = useEuiTheme();

return (
<InactiveAgentsTourStep
isOpen={newlyInactiveAgentsCount > 0 && !inactiveAgentsCalloutHasBeenDismissed}
Expand All @@ -177,7 +181,10 @@ export const AgentStatusFilter: React.FC<{
closePopover={() => updateIsStatusFilterOpen(false)}
panelPaddingSize="none"
>
<div className="euiFilterSelect__items">
{/* EUI NOTE: Please use EuiSelectable (which already has height/scrolling built in)
instead of EuiFilterSelectItem (which is pending deprecation).
@see https://elastic.github.io/eui/#/forms/filter-group#multi-select */}
<div className="eui-yScroll" css={{ maxHeight: euiTheme.base * 30 }}>
{statusFilters.map(({ label, status }, idx) => (
<EuiFilterSelectItem
key={idx}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
EuiIcon,
EuiPopover,
EuiToolTip,
useEuiTheme,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import styled from 'styled-components';
Expand Down Expand Up @@ -91,6 +92,7 @@ export const SearchAndFilterBar: React.FunctionComponent<SearchAndFilterBarProps
onClickAgentActivity,
showAgentActivityTour,
}) => {
const { euiTheme } = useEuiTheme();
const { isFleetServerStandalone } = useFleetServerStandalone();
const showAddFleetServerBtn = !isFleetServerStandalone;

Expand Down Expand Up @@ -218,7 +220,10 @@ export const SearchAndFilterBar: React.FunctionComponent<SearchAndFilterBarProps
closePopover={() => setIsTagsFilterOpen(false)}
panelPaddingSize="none"
>
<div className="euiFilterSelect__items">
{/* EUI NOTE: Please use EuiSelectable (which already has height/scrolling built in)
instead of EuiFilterSelectItem (which is pending deprecation).
@see https://elastic.github.io/eui/#/forms/filter-group#multi-select */}
<div className="eui-yScroll" css={{ maxHeight: euiTheme.base * 30 }}>
<>
{tags.map((tag, index) => (
<EuiFilterSelectItem
Expand Down Expand Up @@ -283,7 +288,10 @@ export const SearchAndFilterBar: React.FunctionComponent<SearchAndFilterBarProps
closePopover={() => setIsAgentPoliciesFilterOpen(false)}
panelPaddingSize="none"
>
<div className="euiFilterSelect__items">
{/* EUI NOTE: Please use EuiSelectable (which already has height/scrolling built in)
instead of EuiFilterSelectItem (which is pending deprecation).
@see https://elastic.github.io/eui/#/forms/filter-group#multi-select */}
<div className="eui-yScroll" css={{ maxHeight: euiTheme.base * 30 }}>
{agentPolicies.map((agentPolicy, index) => (
<EuiFilterSelectItem
checked={selectedAgentPolicies.includes(agentPolicy.id) ? 'on' : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ $heightHeader: $euiSizeL * 2;
border-bottom: $euiBorderThin;
border-top: $euiBorderThin;
border-left: $euiBorderThin;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
box-shadow: none;
height: $euiSizeXXL; /* [2] */

&,
& > :first-child .euiFilterButton { /* EUI specificity override */
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}

&__listWrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

import React, { useState } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiFilterButton, EuiPopover, EuiFilterSelectItem, EuiFilterGroup } from '@elastic/eui';
import {
EuiFilterButton,
EuiPopover,
EuiFilterSelectItem,
EuiFilterGroup,
useEuiTheme,
} from '@elastic/eui';

interface Filter {
name: string;
Expand All @@ -24,6 +30,7 @@ export interface Filters {
}

export function FilterListButton({ onChange, filters }: Props) {
const { euiTheme } = useEuiTheme();
const [isPopoverOpen, setIsPopoverOpen] = useState(false);

const activeFilters = Object.values(filters).filter((v) => (v as Filter).checked === 'on');
Expand Down Expand Up @@ -76,7 +83,10 @@ export function FilterListButton({ onChange, filters }: Props) {
panelPaddingSize="none"
data-test-subj="filterList"
>
<div className="euiFilterSelect__items">
{/* EUI NOTE: Please use EuiSelectable (which already has height/scrolling built in)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there an approximate timeline yet for the deprecation of EuiFilterSelectItem?

Copy link
Member

Choose a reason for hiding this comment

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

Apologies for not clarifying this - we're shooting for the end of the 2023, although this isn't a firm timeline on our end and we're super happy to flex/work with Kibana teams on this!

instead of EuiFilterSelectItem (which is pending deprecation).
@see https://elastic.github.io/eui/#/forms/filter-group#multi-select */}
<div className="eui-yScroll" css={{ maxHeight: euiTheme.base * 30 }}>
cee-chen marked this conversation as resolved.
Show resolved Hide resolved
{Object.entries(filters).map(([filter, item], index) => (
<EuiFilterSelectItem
checked={(item as Filter).checked}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

import React, { useState } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiFilterButton, EuiFilterGroup, EuiPopover, EuiFilterSelectItem } from '@elastic/eui';
import {
EuiFilterButton,
EuiFilterGroup,
EuiPopover,
EuiFilterSelectItem,
useEuiTheme,
} from '@elastic/eui';

interface Filter {
name: string;
Expand All @@ -24,6 +30,7 @@ export type Filters<T extends string> = {
};

export function FilterListButton<T extends string>({ onChange, filters }: Props<T>) {
const { euiTheme } = useEuiTheme();
const [isPopoverOpen, setIsPopoverOpen] = useState(false);

const activeFilters = Object.values(filters).filter((v) => (v as Filter).checked === 'on');
Expand Down Expand Up @@ -74,7 +81,10 @@ export function FilterListButton<T extends string>({ onChange, filters }: Props<
panelPaddingSize="none"
data-test-subj="filterList"
>
<div className="euiFilterSelect__items">
{/* EUI NOTE: Please use EuiSelectable (which already has height/scrolling built in)
instead of EuiFilterSelectItem (which is pending deprecation).
@see https://elastic.github.io/eui/#/forms/filter-group#multi-select */}
<div className="eui-yScroll" css={{ maxHeight: euiTheme.base * 30 }}>
{Object.entries(filters).map(([filter, item], index) => (
<EuiFilterSelectItem
checked={(item as Filter).checked}
Expand Down
Loading
Loading