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 12.1.0 #39601

Merged
merged 12 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from 7 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 @@ -104,7 +104,7 @@
"@babel/register": "7.4.4",
"@elastic/charts": "^6.0.1",
"@elastic/datemath": "5.0.2",
"@elastic/eui": "11.3.2",
"@elastic/eui": "12.1.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.3",
Expand Down
4 changes: 2 additions & 2 deletions src/core/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
ErrorToastOptions,
NotificationsSetup,
NotificationsStart,
Toast,
EuiGlobalToastListToast,
ToastInput,
ToastsApi,
} from './notifications';
Expand Down Expand Up @@ -163,7 +163,7 @@ export {
NotificationsStart,
OverlayRef,
OverlayStart,
Toast,
EuiGlobalToastListToast as Toast,
ToastInput,
ToastsApi,
UiSettingsClient,
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/notifications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

export { ErrorToastOptions, Toast, ToastInput, ToastsApi } from './toasts';
export { ErrorToastOptions, EuiGlobalToastListToast, ToastInput, ToastsApi } from './toasts';
export {
NotificationsService,
NotificationsSetup,
Expand Down
8 changes: 4 additions & 4 deletions src/core/public/notifications/toasts/global_toast_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
* under the License.
*/

import { EuiGlobalToastList, Toast } from '@elastic/eui';
import { EuiGlobalToastList, EuiGlobalToastListToast } from '@elastic/eui';

import React from 'react';
import * as Rx from 'rxjs';

interface Props {
toasts$: Rx.Observable<Toast[]>;
dismissToast: (t: Toast) => void;
toasts$: Rx.Observable<EuiGlobalToastListToast[]>;
dismissToast: (t: EuiGlobalToastListToast) => void;
}

interface State {
toasts: Toast[];
toasts: EuiGlobalToastListToast[];
}

export class GlobalToastList extends React.Component<Props, State> {
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/notifications/toasts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

export { ToastsService, ToastsSetup, ToastsStart } from './toasts_service';
export { ErrorToastOptions, ToastsApi, ToastInput } from './toasts_api';
export { Toast } from '@elastic/eui';
export { EuiGlobalToastListToast } from '@elastic/eui';
10 changes: 5 additions & 5 deletions src/core/public/notifications/toasts/toasts_api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
* under the License.
*/

import { Toast } from '@elastic/eui';
import { EuiGlobalToastListToast } from '@elastic/eui';
import React from 'react';
import * as Rx from 'rxjs';

import { ErrorToast } from './error_toast';
import { UiSettingsSetup } from '../../ui_settings';
import { OverlayStart } from '../../overlays';

type ToastInputFields = Pick<Toast, Exclude<keyof Toast, 'id'>>;
type ToastInputFields = Pick<EuiGlobalToastListToast, Exclude<keyof EuiGlobalToastListToast, 'id'>>;

/** @public */
export type ToastInput = string | ToastInputFields | Promise<ToastInputFields>;
Expand Down Expand Up @@ -56,7 +56,7 @@ const normalizeToast = (toastOrTitle: ToastInput) => {

/** @public */
export class ToastsApi {
private toasts$ = new Rx.BehaviorSubject<Toast[]>([]);
private toasts$ = new Rx.BehaviorSubject<EuiGlobalToastListToast[]>([]);
private idCounter = 0;
private uiSettings: UiSettingsSetup;

Expand All @@ -75,7 +75,7 @@ export class ToastsApi {
}

public add(toastOrTitle: ToastInput) {
const toast: Toast = {
const toast: EuiGlobalToastListToast = {
id: String(this.idCounter++),
toastLifeTimeMs: this.uiSettings.get('notifications:lifetime:info'),
...normalizeToast(toastOrTitle),
Expand All @@ -86,7 +86,7 @@ export class ToastsApi {
return toast;
}

public remove(toast: Toast) {
public remove(toast: EuiGlobalToastListToast) {
const list = this.toasts$.getValue();
const listWithoutToast = list.filter(t => t !== toast);
if (listWithoutToast.length !== list.length) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/public/notifications/toasts/toasts_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';

import { Toast } from '@elastic/eui';
import { EuiGlobalToastListToast } from '@elastic/eui';
import { I18nStart } from '../../i18n';
import { UiSettingsSetup } from '../../ui_settings';
import { GlobalToastList } from './global_toast_list';
Expand Down Expand Up @@ -59,7 +59,7 @@ export class ToastsService {
render(
<i18n.Context>
<GlobalToastList
dismissToast={(toast: Toast) => this.api!.remove(toast)}
dismissToast={(toast: EuiGlobalToastListToast) => this.api!.remove(toast)}
toasts$={this.api!.get$()}
/>
</i18n.Context>,
Expand Down
1 change: 1 addition & 0 deletions src/dev/jest/setup/babel_polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
// include the necessary polyfills when using `@babel/preset-env`, but for some
// reason it did not work. See https://github.com/elastic/kibana/issues/14506
import '../../../setup_node_env/babel_register/polyfill';
import 'regenerator-runtime/runtime';
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Props {
[propName: string]: any;
}

export const FilterView: SFC<Props> = ({ filter, ...rest }: Props) => {
export const FilterView: SFC<Props> = ({ filter, iconOnClick, onClick, ...rest }: Props) => {
let title = `Filter: ${getFilterDisplayText(filter)}. ${i18n.translate(
'data.filter.filterBar.moreFilterActionsMessage',
{
Expand All @@ -51,16 +51,17 @@ export const FilterView: SFC<Props> = ({ filter, ...rest }: Props) => {
<EuiBadge
title={title}
iconType="cross"
// @ts-ignore
iconSide="right"
closeButtonProps={{
// Removing tab focus on close button because the same option can be optained through the context menu
// Also, we may want to add a `DEL` keyboard press functionality
tabIndex: '-1',
tabIndex: -1,
}}
iconOnClick={iconOnClick}
iconOnClickAriaLabel={i18n.translate('data.filter.filterBar.filterItemBadgeIconAriaLabel', {
defaultMessage: 'Delete',
})}
onClick={onClick}
onClickAriaLabel={i18n.translate('data.filter.filterBar.filterItemBadgeAriaLabel', {
defaultMessage: 'Filter actions',
})}
Expand Down

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

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

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

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

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

5 changes: 4 additions & 1 deletion src/legacy/ui/public/share/components/url_panel_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ class UrlPanelContentUI extends Component<Props, State> {

{this.renderShortUrlSwitch()}

<EuiCopy textToCopy={this.state.url} anchorClassName="kbnShareContextMenu__copyAnchor">
<EuiCopy
textToCopy={this.state.url || ''}
anchorClassName="kbnShareContextMenu__copyAnchor"
>
{(copy: () => void) => (
<EuiButton
fill
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@elastic/eui": "11.3.2",
"@elastic/eui": "12.1.0",
"react": "^16.8.0",
"react-dom": "^16.8.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@elastic/eui": "11.3.2",
"@elastic/eui": "12.1.0",
"react": "^16.8.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@elastic/eui": "11.3.2",
"@elastic/eui": "12.1.0",
"react": "^16.8.0"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@elastic/eui": "11.3.2",
"@elastic/eui": "12.1.0",
"react": "^16.8.0"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@elastic/eui": "11.3.2",
"@elastic/eui": "12.1.0",
"react": "^16.8.0",
"react-dom": "^16.8.0"
}
Expand Down
1 change: 0 additions & 1 deletion typings/@elastic/eui/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { Direction } from '@elastic/eui/src/services/sort/sort_direction';

declare module '@elastic/eui' {
export const EuiWrappingPopover: React.SFC<any>;
export const EuiCopy: React.SFC<any>;
export const EuiOutsideClickDetector: React.SFC<any>;
export const EuiSideNav: React.SFC<any>;

Expand Down
Loading